com.tekann.codegen.pda
Class FilterForm

java.lang.Object
  extended by totalcross.ui.gfx.GfxSurface
      extended by totalcross.ui.Control
          extended by totalcross.ui.Container
              extended by com.tekann.codegen.pda.FilterForm
All Implemented Interfaces:
IFilterForm, IForm, Internacionalizable

public abstract class FilterForm
extends totalcross.ui.Container
implements IFilterForm

This class is used to make possible the use of a filter in the TKN Mobile Studio. Therefore you can create a Filter in the create form option on the tool.

Author:
Guilherme Frantz

Field Summary
static java.lang.String CONTAINS
           
(package private)  java.lang.String creatorId
           
protected  int[] dataTypes
           
static java.lang.String ENDS_WITH
           
protected  totalcross.util.Hashtable fieldGridColumns
           
protected  java.lang.Object[] fields
           
protected  java.lang.String filterTableName
           
protected  java.lang.String gridTableName
           
protected  totalcross.util.Vector preparedStatementColumns
           
protected  totalcross.util.Vector preparedStatementValues
           
static java.lang.String STARTS_WITH
           
protected  IFilter tableGrid
           
protected  java.lang.String where
           
protected  java.lang.String whereClause
           
 
Fields inherited from class totalcross.ui.Container
alwaysEraseBackground, BORDER_LOWERED, BORDER_NONE, BORDER_RAISED, BORDER_SIMPLE, children, finishedStart, ignoreOnAddAgain, ignoreOnRemove, insets, lastH, lastScreenWidth, lastW, lastX, lastY, started, tabOrder, tail
 
Fields inherited from class totalcross.ui.Control
AFTER, appId, appObj, asContainer, asWindow, backColor, BEFORE, BOTTOM, BOTTOM_OF, CENTER, CENTER_OF, clearValueInt, clearValueStr, enabled, enableUpdateScreen, FILL, FIT, fm, fmH, focusHandler, focusLess, focusOnPenDown, focusTraversable, font, foreColor, height, isHighlighting, KEEP, LEFT, onEventFirst, parent, PREFERRED, RANGE, repositionAllowed, RIGHT, RIGHT_OF, SAME, setFont, setH, setRel, setW, setX, setY, TOP, transparentBackground, uiCE, uiFlat, uiPalm, uiVista, visible, width, WILL_RESIZE, x, y
 
Constructor Summary
FilterForm()
          Default constructor.
 
Method Summary
 void changeStateFields(boolean arg0)
           
 void clear()
          Clear the fields.
static void filterTableExists(java.lang.String creatorID, java.lang.String filterTable, IFilter tableGrid, java.lang.Object[] fieldColumns, int[] types)
          if the Filter_Table doesn't exists the the filter button is set as disabled.
protected abstract  totalcross.ui.Button getAddButton()
          Gets the add button
protected abstract  totalcross.ui.Button getAlterButton()
          Gets the alter button
protected abstract  totalcross.ui.Button getClearButton()
          Gets the clear button
protected abstract  totalcross.ui.ComboBox getFieldComboBox()
          Gets the field button
 java.lang.Object getMenuBar()
          Gets the Menu Bar button A filter doesn't have one by default.
protected abstract  totalcross.ui.Button getOkButton()
          Gets the ok button
protected abstract  totalcross.ui.ComboBox getOperatorComboBox()
          Gets the operator comboBox
protected abstract  totalcross.ui.Edit getQueryEdit()
          Gets the query edit
protected abstract  totalcross.ui.Grid getQueryGrid()
          Gets the query grid
protected abstract  totalcross.ui.Button getRemoveButton()
          Gets the remove button
 java.lang.String getTitle()
          Gets the title.
protected abstract  totalcross.ui.Edit getValueEdit()
          Gets the value edit.
 java.lang.String getWhere()
          Gets the where search of a prepared statement.
 java.lang.String getWhereClause()
          Gets the where clause
 void initFilterForm(IFilter tableGrid, java.lang.String gridTableName, java.lang.String tableName, java.lang.String creatorId, java.lang.Object[] fields, java.lang.Object[] gridColumns, int[] dataTyppes)
          Initializes the FilterForm by the passed arguments.
 void loadFilterTable()
          Loads the Filter Table.
 void loadForm()
          Loads the form.
 void onEvent(totalcross.ui.event.Event e)
          Handle the events.
 void onSwap(totalcross.ui.Container container)
          Optional implementation while swapping
protected abstract  void setFieldComboBox(totalcross.ui.ComboBox fieldComboBox)
           
 void setTableGrid(IFilter tableGrid)
          Sets the table grid.
 void setTitle(java.lang.String arg0)
          Sets the form title.
 void showMessage(java.lang.String arg0, java.lang.String arg1)
          Shows a message to the user.
 
Methods inherited from class totalcross.ui.Container
add, add, add, add, add, broadcastEvent, findChild, findNextFocusControl, getBorderStyle, getChildren, getClientRect, getClientRect, getFocusableControls, getInsets, incLastX, incLastY, initUI, onAddAgain, onColorsChanged, onPaint, onRemove, paintChildren, remove, removeAll, resize, resizeHeight, resizeWidth, setBorderStyle, setEnabled, setHighlighting, setInsets, swapToTopmostWindow
 
Methods inherited from class totalcross.ui.Control
_onEvent, addFocusListener, addGridListener, addHighlightListener, addKeyListener, addPenListener, addPressListener, addTimer, addTimer, addTimerListener, addWindowListener, changeHighlighted, contains, getAbsoluteRect, getBackColor, getEventListeners, getFont, getForeColor, getGraphics, getHeight, getNext, getParent, getParentWindow, getPos, getPreferredHeight, getPreferredWidth, getPressedEvent, getPrev, getRect, getSize, getWidth, getX, getX2, getY, getY2, handleGeographicalFocusChangeKeys, isDisplayed, isEnabled, isVisible, isVisibleAndInside, onBoundsChanged, onFontChanged, onWindowPaintFinished, postEvent, postPressedEvent, removeListener, removeTimer, repaint, repaintNow, reposition, reposition, requestFocus, setBackColor, setBackForeColors, setFocusLess, setFont, setForeColor, setRect, setRect, setRect, setRect, setVisible, translateFromOrigin, uiStyleChanged, updateScreen, updateTemporary
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.tekann.codegen.pda.IForm
getFont, loadMenuBar
 
Methods inherited from interface com.tekann.i18n.Internacionalizable
getID, getResourceDir, getResourcePrefix
 

Field Detail

CONTAINS

public static final java.lang.String CONTAINS
See Also:
Constant Field Values

ENDS_WITH

public static final java.lang.String ENDS_WITH
See Also:
Constant Field Values

STARTS_WITH

public static final java.lang.String STARTS_WITH
See Also:
Constant Field Values

creatorId

java.lang.String creatorId

dataTypes

protected int[] dataTypes

fieldGridColumns

protected totalcross.util.Hashtable fieldGridColumns

fields

protected java.lang.Object[] fields

filterTableName

protected java.lang.String filterTableName

gridTableName

protected java.lang.String gridTableName

preparedStatementColumns

protected totalcross.util.Vector preparedStatementColumns

preparedStatementValues

protected totalcross.util.Vector preparedStatementValues

tableGrid

protected IFilter tableGrid

where

protected java.lang.String where

whereClause

protected java.lang.String whereClause
Constructor Detail

FilterForm

public FilterForm()
Default constructor.

Method Detail

filterTableExists

public static void filterTableExists(java.lang.String creatorID,
                                     java.lang.String filterTable,
                                     IFilter tableGrid,
                                     java.lang.Object[] fieldColumns,
                                     int[] types)
                              throws java.lang.Exception
if the Filter_Table doesn't exists the the filter button is set as disabled.

Throws:
java.lang.Exception

changeStateFields

public void changeStateFields(boolean arg0)

clear

public void clear()
Clear the fields.

Overrides:
clear in class totalcross.ui.Container

getAddButton

protected abstract totalcross.ui.Button getAddButton()
Gets the add button

Returns:
A Button

getAlterButton

protected abstract totalcross.ui.Button getAlterButton()
Gets the alter button

Returns:
A Button

getClearButton

protected abstract totalcross.ui.Button getClearButton()
Gets the clear button

Returns:
A Button

getFieldComboBox

protected abstract totalcross.ui.ComboBox getFieldComboBox()
Gets the field button

Returns:
A ComboBox

getMenuBar

public java.lang.Object getMenuBar()
Gets the Menu Bar button A filter doesn't have one by default.

Specified by:
getMenuBar in interface IForm
Returns:
An Object

onSwap

public void onSwap(totalcross.ui.Container container)
Description copied from interface: IForm
Optional implementation while swapping

Specified by:
onSwap in interface IForm

getOkButton

protected abstract totalcross.ui.Button getOkButton()
Gets the ok button

Returns:
A Button

getOperatorComboBox

protected abstract totalcross.ui.ComboBox getOperatorComboBox()
Gets the operator comboBox

Returns:
A ComboBox

getQueryEdit

protected abstract totalcross.ui.Edit getQueryEdit()
Gets the query edit

Returns:
An Edit

getQueryGrid

protected abstract totalcross.ui.Grid getQueryGrid()
Gets the query grid

Returns:
A Grid

getRemoveButton

protected abstract totalcross.ui.Button getRemoveButton()
Gets the remove button

Returns:
A Button

getTitle

public java.lang.String getTitle()
Gets the title. By default a FitlerForm doesn't have one.

Specified by:
getTitle in interface IForm
Returns:
A String

getValueEdit

protected abstract totalcross.ui.Edit getValueEdit()
Gets the value edit.

Returns:
An Edit

getWhere

public java.lang.String getWhere()
Gets the where search of a prepared statement.

Returns:
The where filter

getWhereClause

public java.lang.String getWhereClause()
Gets the where clause

Returns:
The where clause

initFilterForm

public void initFilterForm(IFilter tableGrid,
                           java.lang.String gridTableName,
                           java.lang.String tableName,
                           java.lang.String creatorId,
                           java.lang.Object[] fields,
                           java.lang.Object[] gridColumns,
                           int[] dataTyppes)
Initializes the FilterForm by the passed arguments.

Parameters:
tableGrid -
gridTableName -
tableName -
creatorId -
fields -
gridColumns -
dataTyppes -

loadFilterTable

public void loadFilterTable()
Loads the Filter Table.


loadForm

public void loadForm()
              throws java.lang.Exception
Description copied from interface: IForm
Loads the form.

Specified by:
loadForm in interface IForm
Throws:
java.lang.Exception

onEvent

public void onEvent(totalcross.ui.event.Event e)
Handle the events.

Overrides:
onEvent in class totalcross.ui.Control

setFieldComboBox

protected abstract void setFieldComboBox(totalcross.ui.ComboBox fieldComboBox)

setTableGrid

public void setTableGrid(IFilter tableGrid)
Sets the table grid.

Parameters:
tableGrid -

setTitle

public void setTitle(java.lang.String arg0)
Description copied from interface: IForm
Sets the form title.

Specified by:
setTitle in interface IForm

showMessage

public void showMessage(java.lang.String arg0,
                        java.lang.String arg1)
Description copied from interface: IForm
Shows a message to the user.

Specified by:
showMessage in interface IForm