Ontimize 5.2072EN

com.ontimize.gui.field
Class FilterComponent

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended bycom.ontimize.gui.field.AbstractFormComponent
                  extended bycom.ontimize.gui.field.IdentifiedAbstractFormComponent
                      extended bycom.ontimize.gui.field.FilterComponent
All Implemented Interfaces:
AccessForm, FormComponent, HasPreferenceComponent, IdentifiedElement, java.awt.image.ImageObserver, Internationalization, java.awt.MenuContainer, SecureElement, java.io.Serializable

public class FilterComponent
extends IdentifiedAbstractFormComponent
implements HasPreferenceComponent

This class implements a component for filtering in advanced queries.

Author:
Imatia Innovation
See Also:
Serialized Form

Nested Class Summary
protected  class FilterComponent.PopupListener
           
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected  RolloverButton arrowButton
           
protected  javax.swing.JButton clearButton
           
protected  java.lang.String entityName
           
static java.lang.String EXPRESSION
           
protected  RolloverButton filterButton
           
protected  javax.swing.JTextField filterText
           
protected  javax.swing.JLabel label
           
protected  java.lang.String[] lCols
           
protected  javax.swing.JPopupMenu pList
           
protected  javax.swing.JPopupMenu popup
           
protected  QueryExpression queryExpression
           
protected  java.lang.String[] tCols
           
protected  java.lang.String text
           
 
Fields inherited from class com.ontimize.gui.field.IdentifiedAbstractFormComponent
attribute, enabledPermission, parentForm, restricted, visiblePermission
 
Fields inherited from class com.ontimize.gui.field.AbstractFormComponent
defaultBottomMargin, defaultLeftMargin, defaultRightMargin, defaultTopMargin
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface com.ontimize.gui.SecureElement
DESACTIVATE_COMPONENT_BY_PERMISSION_TIP
 
Fields inherited from interface com.ontimize.gui.field.FormComponent
DEBUG
 
Fields inherited from interface com.ontimize.gui.i18n.Internationalization
DEBUG_LANGUAGE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
FilterComponent(java.util.Hashtable h)
          Initializes parameters.
 
Method Summary
 void clearAction()
           
 void filterAction(java.awt.event.ActionEvent e)
           
 java.lang.String[] getCols()
           
 java.lang.String getDetailFormSizePreferenceKey()
           
 SQLStatementBuilder.Expression getFilter()
          Returns the standard expression.
 QueryExpression getQueryExpression()
          Returns the query expression for field.
 java.lang.String[] getTypeOfCols()
           
 void init(java.util.Hashtable h)
          Inits parameters.
protected static java.lang.String[] initList(java.lang.String columns)
           
 void initPreferences(ApplicationPreferences ap, java.lang.String user)
           
 void savePreferences(java.lang.String preferenceName)
           
 void setEnabled(boolean enabled)
          Description method to set enabled or not the component according the boolean condition in parameter.
 void setResourceBundle(java.util.ResourceBundle res)
          Sets the language resource bundle.
 
Methods inherited from class com.ontimize.gui.field.IdentifiedAbstractFormComponent
checkEnabledPermission, checkVisiblePermission, getAttribute, getParentForm, initPermissions, isRestricted, setParentForm
 
Methods inherited from class com.ontimize.gui.field.AbstractFormComponent
getConstraints, getTextsToTranslate, setComponentLocale
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.ontimize.gui.field.FormComponent
isEnabled, setVisible
 

Field Detail

EXPRESSION

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

entityName

protected java.lang.String entityName

filterButton

protected RolloverButton filterButton

text

protected java.lang.String text

filterText

protected javax.swing.JTextField filterText

label

protected javax.swing.JLabel label

lCols

protected java.lang.String[] lCols

tCols

protected java.lang.String[] tCols

queryExpression

protected QueryExpression queryExpression

popup

protected javax.swing.JPopupMenu popup

pList

protected javax.swing.JPopupMenu pList

arrowButton

protected RolloverButton arrowButton

clearButton

protected javax.swing.JButton clearButton
Constructor Detail

FilterComponent

public FilterComponent(java.util.Hashtable h)
Initializes parameters. Possible XML configurations:

entity parameter defined:


entity parameter no defined:

Parameters:
h - the Hashtable with XML parameters:

attribute values default required meaning
attr yes yes Indicates the component attribute.
entity no The entity where filter is applied.
icon ImageManager.FUNNEL_NEW no Path for component icon.
text no Indicates button text for component.
labelvisible yes/no no no Indicates the visibility condition of component label.
labeltext no Indicates the label text for component.
filtervisible yes no Indicates the visibility condition of filter text field.
cols col1;col2;...;coln Only required when entity parameter is not specified. Entity columns.
typecols typecol1;typecol2;...;typecoln no Data types for columns. Only String, Date or Number are allowed./td>
Method Detail

initList

protected static java.lang.String[] initList(java.lang.String columns)

setResourceBundle

public void setResourceBundle(java.util.ResourceBundle res)
Description copied from interface: Internationalization
Sets the language resource bundle. When the application changes the configured language, for all the objects that implement this interface this method must be called with the new file.
The method must translate all the elements that have texts in the GUI

Specified by:
setResourceBundle in interface Internationalization
Overrides:
setResourceBundle in class AbstractFormComponent

init

public void init(java.util.Hashtable h)
Description copied from class: IdentifiedAbstractFormComponent
Inits parameters.

Specified by:
init in interface FormComponent
Overrides:
init in class IdentifiedAbstractFormComponent
Parameters:
h - the Hashtable with parameters

attribute values default required meaning
... ... ... ... ...

getFilter

public SQLStatementBuilder.Expression getFilter()
Returns the standard expression. If the expression contains the typecols parameter, it will be returned a OR operation between String column types.

Returns:
the filter expression

getQueryExpression

public QueryExpression getQueryExpression()
Returns the query expression for field. Filter expression is obtained from getFilter() method.

Returns:
the query expression

getDetailFormSizePreferenceKey

public java.lang.String getDetailFormSizePreferenceKey()

initPreferences

public void initPreferences(ApplicationPreferences ap,
                            java.lang.String user)
Specified by:
initPreferences in interface HasPreferenceComponent

savePreferences

public void savePreferences(java.lang.String preferenceName)

setEnabled

public void setEnabled(boolean enabled)
Description copied from interface: FormComponent
Description method to set enabled or not the component according the boolean condition in parameter.

Specified by:
setEnabled in interface FormComponent

getCols

public java.lang.String[] getCols()

getTypeOfCols

public java.lang.String[] getTypeOfCols()

clearAction

public void clearAction()

filterAction

public void filterAction(java.awt.event.ActionEvent e)

Ontimize