LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.control
Class LyFilterController

java.lang.Object
  extended by leon.control.LyController
      extended by leon.control.LyAreaController
          extended by leon.control.LyMultiAreaController
              extended by leon.control.LyFormController
                  extended by leon.control.LySimpleFilterController
                      extended by leon.control.LyFilterController
All Implemented Interfaces:
LyGetSessionInterface, LyContextInterface, LyFormResultInterface, LyGetActionInterface, LySelectFileListenerInterface, LyAdvancedWorkSpaceListener, LyGuiListener, LyWorkSpaceListener, LyGetClassInfoInterface, LyInfoListener, LyEvaluator, LyDemandListener
Direct Known Subclasses:
LyMultiFilterController

public class LyFilterController
extends LySimpleFilterController
implements LyFormResultInterface

This class implements the simple filter edition area. This form enables the user to type in elementary filtering criteria (fieldInfo / condition / value).

This controller is associated to a behavior which implements LyFilterBehaviorInterface. Usually the behavior is an instance of LyClassBehavior.

A simple filter can only create a simple filter criteria (1 field info / 1 condition (lower than, greater than, equals ...) and 1 value). To build advanced filters, use LyFilterEditorController.

See Also:
LyFilterEditorController, LyFilterEndInterface

Field Summary
static java.lang.String __VERSION
          File Version
static java.lang.String ID_DATE_NORMAL
          Id for modifier DATE_NORMAL.
static java.lang.String ID_DAY
          Id for modifier DAY.
static java.lang.String ID_MODIFIER_NOT
          Id for modifier NOT.
static java.lang.String ID_NOW
          Id for modifier NOW.
static java.lang.String ID_OPERATION_REMOVE
          Id for operation remove.
static java.lang.String ID_TODAY
          Id for modifier TODAY.
static java.lang.String SELECT_CONDITION
          Identifier of an input field : selected condition.
static java.lang.String SELECT_DATE_DAY_VALUE
          Identifier of an input field : selected day.
static java.lang.String SELECT_DATE_SPECIAL_VALUE
          Identifier of an input field : selected today.
static java.lang.String SELECT_FIELDINFO
          Identifier of an input field : selected fieldInfo.
static java.lang.String SELECT_MODIFIERS
          Identifier of an input field : selected modifiers.
static java.lang.String SELECT_VALUE
          Identifier of an input field : user specified value.
 
Fields inherited from class leon.control.LyFormController
DEMAND_APPLY, DEMAND_NEXT_OBJECT, DEMAND_NEXT_STEP, DEMAND_PREVIOUS_OBJECT, DEMAND_PREVIOUS_STEP, DEMAND_SAVE, DEMAND_SELECTION, DEMAND_VALIDATE, FORM_FIELD_SEP
 
Fields inherited from class leon.control.LyAreaController
DEFAULT_MENU_ITEM_IMAGE_SIZE, DEMAND_CANCEL, DEMAND_CLOSE, DEMAND_CREATE_CHART, DEMAND_DELETE_CHART, DEMAND_DELETE_OBJECTINFOS, DEMAND_DELETE_PREFERENCE, DEMAND_UPDATE_VIEW
 
Fields inherited from class leon.control.LyController
_nbControllers, _nextId, CONTROLLER_ID_SEP, DEFAULT_IMAGE_FORMAT, DEMAND_HELP, ID_SEP
 
Constructor Summary
LyFilterController(LySession session, LyController parent, LyAction action, LyClassInfo classInfo, LyObjectList objects)
          Constructor.
 
Method Summary
 void actionDemand(LyActionDemand demand)
          Invoked when an action notification is sent to this listener.
 LyFilterElement buildFilterElement(LyFieldInfo fieldInfo, boolean not, LyFilterExpression.Condition condition, java.lang.Object value, java.util.BitSet modifiers)
          Builds filter element for given parameters.
 LyComponent getComponent()
          Accessor to the view component instance.
 LyFormField getFormField(LyFieldInfo fieldInfo)
          Accessor to the formField (View component) associated to the fieldInfo.
 LyUnit getUnit(LyFieldInfo fieldInfo, LyFormField formField)
          Get current unit for the specified fieldInfo in the form.
 boolean isViewResizable()
          Indicates if the view for this import controller is resizable.
 void notifyFormResult(LyObject object, LyRelationFieldInfo relationField)
          Internal use.
 boolean setObjects(LyObjectList objects)
          Accessor to the list of objects associated with this form.
 
Methods inherited from class leon.control.LySimpleFilterController
checkIfModified, getBehaviorInterface, getDefaultFilter, getFilterEndInterface, setContextClient, setFilterEndInterface
 
Methods inherited from class leon.control.LyFormController
clearViewCache, contains, fieldControllerFactory, findFormField, free, getAreaController, getClassInfo, getCompositionRelation, getContent, getDefaultFieldUnit, getEnvironment, getFieldController, getFieldMarks, getFields, getFieldValue, getFieldValue, getImage, getImage, getKeyValue, getObject, getObjectList, getSelection, getState, getTabs, isChangingObject, isComposition, isDisplayed, menuDemand, objectAdded, objectChanged, objectRemoved, objectStateChanged, objectUserEvent, reset, resetFormContent, resetFromObject, setActiveField, setCompositionRelation, setContext, setFieldMarks, setState, showError, workSpaceEventsGrouped
 
Methods inherited from class leon.control.LyMultiAreaController
addAreaController, addAreaControllerStack, canClose, getAreaController, getAreaController, getAreaControllersCount, getAreaControllerStack, getAreaControllerStackCount, getFinalAreaControllers, getLastModified, openSubAreaController, removeAreaController, removeAreaControllerStack, setAction, setIdle, setViewController, update
 
Methods inherited from class leon.control.LyAreaController
canFree, completeMenuBar, completeMessages, free, getAction, getAreaStackController, getBehavior, getBuilder, getContext, getContextClient, getContextTitle, getDefaultAction, getFastEditionAction, getHelpFile, getImageTooltip, getInfoLabel, getInfoLabel, getLabel, getMenuItemImage, getName, getParameter, getParameter, getParameterMarks, getParent, getParent, getParentAreaController, getRefreshTime, getShortLabel, getTarget, getTitle, getViewController, getViewController, hasMark, hasNotMark, hasViewController, hideView, infoEvent, initialize, isInitialized, isOutlined, reset, selectFileDemand, setContext, setPreference, showView, showView, testParameter, toString, updateTitleBar
 
Methods inherited from class leon.control.LyController
activateViewDemand, demandPerformed, dragDropDemand, getApplication, getClassInfo, getId, getImage, getImage, getImage, getImageFromPrefix, getImageFromPrefix, getImageFromPrefix, getName, getObjectId, getSession, getUserData, getView, getViewManager, helpDemand, hideView, isFreed, isIdle, selectionDemand, setBuilder, setBuilderClass, setLastModified, setName, setUserData, showError, showWarning, updateViewFromValues
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

__VERSION

public static final java.lang.String __VERSION
File Version

See Also:
Constant Field Values

SELECT_FIELDINFO

public static final java.lang.String SELECT_FIELDINFO
Identifier of an input field : selected fieldInfo.

See Also:
Constant Field Values

SELECT_CONDITION

public static final java.lang.String SELECT_CONDITION
Identifier of an input field : selected condition.

See Also:
Constant Field Values

SELECT_VALUE

public static final java.lang.String SELECT_VALUE
Identifier of an input field : user specified value.

See Also:
Constant Field Values

SELECT_DATE_DAY_VALUE

public static final java.lang.String SELECT_DATE_DAY_VALUE
Identifier of an input field : selected day.

See Also:
Constant Field Values

SELECT_MODIFIERS

public static final java.lang.String SELECT_MODIFIERS
Identifier of an input field : selected modifiers.

See Also:
Constant Field Values

SELECT_DATE_SPECIAL_VALUE

public static final java.lang.String SELECT_DATE_SPECIAL_VALUE
Identifier of an input field : selected today.

See Also:
Constant Field Values

ID_MODIFIER_NOT

public static final java.lang.String ID_MODIFIER_NOT
Id for modifier NOT.

See Also:
Constant Field Values

ID_DATE_NORMAL

public static final java.lang.String ID_DATE_NORMAL
Id for modifier DATE_NORMAL.

See Also:
Constant Field Values

ID_TODAY

public static final java.lang.String ID_TODAY
Id for modifier TODAY.

See Also:
Constant Field Values

ID_NOW

public static final java.lang.String ID_NOW
Id for modifier NOW.

See Also:
Constant Field Values

ID_DAY

public static final java.lang.String ID_DAY
Id for modifier DAY.

See Also:
Constant Field Values

ID_OPERATION_REMOVE

public static final java.lang.String ID_OPERATION_REMOVE
Id for operation remove.

See Also:
Constant Field Values
Constructor Detail

LyFilterController

public LyFilterController(LySession session,
                          LyController parent,
                          LyAction action,
                          LyClassInfo classInfo,
                          LyObjectList objects)
Constructor.

Parameters:
session - current session associated to the controller. The controller automatically registers on the specified session.
parent - parent controller. If the parent implements LyFilterEndInterface, it will be notified when the filter form is closed.
action - related action. (action based on '_filter' action)
classInfo - the application class associated to the filter
objects - the current context for this action
Method Detail

getComponent

public LyComponent getComponent()
Accessor to the view component instance. (XML description of the view) This instance is created by the builder, and multiple calls to this method always return the same instance.

Overrides:
getComponent in class LyController
Returns:
the LyComponent instance of the view package, memory representation (parsed) of the XML description of the view.

actionDemand

public void actionDemand(LyActionDemand demand)
Invoked when an action notification is sent to this listener.

method implements VALIDATE, APPLY and CANCEL action events and subsequently invoke endFilter on the client.

Additionally, the controller handles field changes and impact on form content. (The nature of components shown in the view is field dependant).

Overrides:
actionDemand in class LyFormController
Parameters:
demand - demand parameters sent by the view component.
See Also:
LyController.demandPerformed(leon.view.event.LyDemand)

getUnit

public LyUnit getUnit(LyFieldInfo fieldInfo,
                      LyFormField formField)
Get current unit for the specified fieldInfo in the form.

Parameters:
fieldInfo - the fieldInfo
formField - the associated formfield
Returns:
current unit, or null if not found or field is disabled.

buildFilterElement

public LyFilterElement buildFilterElement(LyFieldInfo fieldInfo,
                                          boolean not,
                                          LyFilterExpression.Condition condition,
                                          java.lang.Object value,
                                          java.util.BitSet modifiers)
Builds filter element for given parameters.

Parameters:
fieldInfo - FieldInfo on which this filter expression applies.
not - Inverts filter condition or not.
condition - Filter condition.
value - Value of this expression (may be null). This value is an instance of the class returned by the getValueClass method of LyFieldInfo.
modifiers - List of modifiers (may be null).
Returns:
The corresponding filter element.

isViewResizable

public boolean isViewResizable()
Indicates if the view for this import controller is resizable.

Overrides:
isViewResizable in class LyFormController
Returns:
true if the view is resizable, false otherwise.

setObjects

public boolean setObjects(LyObjectList objects)
Accessor to the list of objects associated with this form. The user may navigate through this list of objects.

Overrides:
setObjects in class LyFormController
Parameters:
objects - list of objects which could be shown in the form.
Returns:
true if successfull

getFormField

public LyFormField getFormField(LyFieldInfo fieldInfo)
Accessor to the formField (View component) associated to the fieldInfo.

Overrides:
getFormField in class LyFormController
Parameters:
fieldInfo - the fieldInfo which is associated to the view component.
Returns:
the formField corresponding to the given fieldInfo

notifyFormResult

public void notifyFormResult(LyObject object,
                             LyRelationFieldInfo relationField)
Internal use. When an object is created in a popup creation form for a relation, the child controller invokes this method to set the newly created object as the current value of the relation (if a new object is created we automatically select this value). This method is never used by the application : use setFieldValue instead

Specified by:
notifyFormResult in interface LyFormResultInterface
Parameters:
object - newly created object. The new value of the relation fieldInfo.
relationField - the relation

(c) January 2013 - W4 S.A.

Website: W4 S.A., contact us: support@w4global.com