LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.app.behavior
Class LyClassBehavior

java.lang.Object
  extended by leon.app.behavior.LyBehavior
      extended by leon.app.behavior.LyActionBehavior
          extended by leon.app.behavior.LyClassBehavior
All Implemented Interfaces:
LyActionBehaviorInterface, LyBehaviorInterface, LyClassBehaviorInterface, LyConsultBehaviorInterface, LyCreateBehaviorInterface, LyDeleteBehaviorInterface, LyFilterBehaviorInterface, LyFormBehaviorInterface, LyOutlineBehaviorInterface, LySetBehaviorInterface, LyGetSessionInterface

public class LyClassBehavior
extends LyActionBehavior
implements LyClassBehaviorInterface

This class implements the default behavior for consult, set, filter and delete actions. It can be inherited by a specific user behavior.

See Also:
LyFormBehaviorInterface, LyFormController, LyConsultBehaviorInterface, LyConsultController, LySetBehaviorInterface, LySetController, LyCreateBehaviorInterface, LyCreateController, LyFilterBehaviorInterface, LyFilterController, LyDeleteBehaviorInterface, LyDeleteController

Field Summary
static java.lang.String __VERSION
          File version.
static short STATUS_IGNORE
          Code returned when there is no modification on the value for controlNewValue, checkNewValue and controlNewValues.
static short STATUS_KO
          Code returned when the value is not correct for controlNewValue, checkNewValue and controlNewValues.
static short STATUS_OK
          Code returned when the value is correct for controlNewValue, checkNewValue and controlNewValues.
static short STATUS_WARNING
          Code returned when the value is on warning for controlNewValue, checkNewValue and controlNewValues.
 
Fields inherited from interface leon.app.behaviorinterface.LySetBehaviorInterface
STATUS_CANCEL
 
Constructor Summary
LyClassBehavior()
          Construct a class behavior.
 
Method Summary
 void addExtraValues(LySetController set, LyValueSet values)
          This method adds the given extra values before completing the current operation.
 LyFilterElement buildFilterElement(LyFilterController filter, LyFieldInfo fieldInfo, boolean not, LyFilterExpression.Condition condition, java.lang.Object value, java.util.BitSet modifiers)
          Builds a filter element with the given parameters.
 void changeState(LyController parent, LyAction action, LyObjectList objects, LyFieldInfo fieldInfo)
          Generic method to handle modification of the state of an object (loop on values of a choice field info).
 java.lang.String checkDeletion(LyDeleteController delete, LyObject object)
          Checks if the given object deletion is enabled or not (used before asking to the end-user if he want to delete it).
 LyObjectList checkDeletions(LyDeleteController delete, LyObjectList list)
          Checks if the given objects list deletion is enabled or not (used before asking to the end-user if he want to delete them).
 short checkNewValue(LySetController set, LyFieldInfoValue newValue)
          Dynamicaly checks the given value for its associated field.
 short controlNewValue(LySetController set, LyFieldInfoValue newValue)
          This method controls the given value before creating or modifying an object.
 short controlNewValues(LySetController set, LyValueSet newValues)
          Global control of values before creating or modifying an object.
 void copy(LyController parent, LyAction action, LyObjectList objects)
          Generic method to copy an object.
 boolean enableChoiceOption(LySetController set, LyChoiceFieldInfo choice, LyChoiceOption option)
          Indicates if the given option is enabled on the given choice fieldInfo.
 boolean enableRelationHRef(LyConsultController consult, LyRelationFieldInfo relation, LyObject href)
          Enables the given href object on the given relation field info.
 boolean enableRelationLink(LySetController set, LyRelationFieldInfo relation, LyObject link)
          Allows the given link object as a possible value for the given relation field info.
 boolean enableRelationLink(LySetController set, LyRelationFieldInfo relation, LyObject link, boolean showError)
          Allows the given link object as a possible value for the given relation field info.
 void endCommit(LySetController controller)
          Invoked when controller is ending commit, default implementation does nothing.
 boolean endCreation(LyCreateController create, LyValueSet values)
          Final step of the object creation process.
 boolean endDeletion(LyDeleteController delete)
          Final step of object deletion process.
 boolean endSet(LySetController set, LyValueSet values)
          Final step of the object set process.
 void formRestored(LySetController controller, LyFormSave formSave)
          Method called on form restore.
 void formSaved(LySetController controller, LyFormSave formSave)
          Method called on form save.
 LyAction getAction(LyConsultController consult, LyRelationFieldInfo relation, LyClassInfo classInfo)
          Get action to use for consulting or editing the given relation with the specified class info selected on it.
 int getAutoCompletionMaximum(LySetController set, LyRelationFieldInfo relation)
          Indicates the maximum number of values displayed in relation components for auto-completion.
 int getAutoCompletionMaximum(LySetController set, LyTextFieldInfo fieldInfo)
          Indicates the maximum number of values displayed in text components for auto-completion.
 java.lang.String[] getAutoCompletionValues(LySetController set, LyTextFieldInfo fieldInfo)
          Computes the list of values displayed in text components for auto-completion.
 java.util.Vector<LyChoiceOption> getChoiceDomain(LySetController set, LyChoiceFieldInfo choice)
          Gets domain (list of allowed options) of the given choice fieldInfo.
 java.lang.String getConfirmDeletionMessage(LyDeleteController delete, LyObject object)
          Asks for the deletion message for the given object.
 java.lang.Object getDefaultValue(LySetController set, LyFieldInfo fieldInfo)
          Gets a default value for the given fieldInfo.
 java.util.Vector<LyChoiceOption> getFilterChoiceDomain(LyFilterController filter, LyChoiceFieldInfo choice)
          Gets domain (list of allowed options) of the given choice fieldInfo.
 LyInfoList<LyClassInfo> getFilterRelationClasses(LyFormController filter, LyRelationFieldInfo relation)
          Gets the list of available class info for the given relation filtering.
 LyObjectList getFilterRelationDomain(LyFilterController filter, LyRelationFieldInfo relation)
          Gets relation domain (list of available links in the filter context) for the given relation fieldInfo for filter actions.
 LyInfoDataList<LyAction,LyClassInfo> getFilterTransverseActions(LyFilterController filter, LyFieldInfo fieldInfo)
          Gets all actions enabled by the given field for a filter action.
 LyInfoDataList<LyAction,LyClassInfo> getFilterTransverseActions(LyFilterController filter, LyRelationFieldInfo relation)
          Gets all actions enabled by the given relation for a filter action.
 java.lang.String getImage(LyFormController formController, LyObject object)
          Gets the image associated to the given object for the given form.
 LyContext.Position getInsertPosition(LySetController controller, LyRelationFieldInfo relation)
          Indicates if the operations of the controller context must be inserted at the beginning of the parent operations or at the end.
 java.lang.String getLinkShortLabel(LySetController set, LyRelationFieldInfo relation, LyObject link)
          Gets the short label that must be used for the given relation fieldInfo.
 LyInfoList<LyClassInfo> getRelationClasses(LySetController set, LyRelationFieldInfo relation)
          Gets the list of available classInfo of the given relation fieldInfo.
 LyObjectList getRelationContext(LySetController set, LyRelationFieldInfo relation)
          Gets the list of objects of the given relation context.
 LyObjectList getRelationDomain(LySetController set, LyRelationFieldInfo relation)
          Gets relation domain (list of available links) for the given relation fieldInfo.
 LyObjectList getRelationDomain(LySetController set, LyRelationFieldInfo relation, java.lang.String prefix, boolean fill)
          Gets relation domain (list of available links) for the given relation fieldInfo with the given prefix for related objects.
 LyFilter getRelationFilter(LySetController controller, LyRelationFieldInfo relation, LyClassInfo classInfo)
          Gets the filter of the given relation and the given class.
 LyAction getSetAction(LyOutlineController outline, LyFieldInfo fieldInfo)
          Get action used for fast edition of given field.
 java.lang.String getTitle(LyAreaController areaController, LyAction action)
          Gets title corresponding to the given action.
 LyInfoDataList<LyAction,LyClassInfo> getTransverseActions(LySetController set, LyFieldInfo fieldInfo)
          Gets actions enabled by the given field.
 LyInfoDataList<LyAction,LyClassInfo> getTransverseActions(LySetController set, LyRelationFieldInfo relation)
          Gets all actions enabled by the given relation.
 java.lang.Object getValue(LyFormController form, LyFieldInfo fieldInfo)
          Gets value of the given fieldInfo.
 void hide(LyController parent, LyAction action, LyObjectList objects)
          Generic method to hide an objects list.
 boolean isDisplayed(LyFormController form, LyFieldInfo fieldInfo)
          Indicates if the given fieldInfo is displayed in the given form or not.
 boolean isEditable(LySetController set, LyFieldInfo fieldInfo)
          Checks if the given fieldInfo is editable or not for the given controller.
 boolean isEnabled(LySetController set, LyFieldInfo fieldInfo)
          Checks if the given fieldInfo is enabled or not for the given controller.
 java.lang.String isLocked(LySetController controller, LyObject object)
          Checks if given object is locked for edition.
 boolean isOptional(LySetController set, LyFieldInfo fieldInfo)
          Checks if the given fieldInfo is optional or not for the given controller.
 boolean isValidGroup(LySetController set, LyChoiceFieldInfo choice, LyChoiceOption option, LyChoiceOptionGroup group)
          Checks if the given group is valid for the given option of the choice fieldinfo.
 boolean lockObject(LySetController controller, LyObject object, boolean lock)
          Locks/Unlocks given object for edition.
 void modify(LyController parent, LyAction action, LyObjectList objects, LyValueSet fieldValues)
          Generic method to handle modification of an objects list.
 boolean needCheck(LySetController set, LyFieldInfo fieldInfo)
          Indicates if the given fieldInfo needs to be checked when the value is modified (in creation and set mode).
 void paste(LyController parent, LyAction action, java.lang.String objectString)
          Generic method to paste an object.
 void propagate(LySetController set, LyFieldInfoValue newValue)
          Progates the given field value to all fields.
 void setObject(LyConsultController controller, LyObject object)
          Method called when object shown in the form is changed.
 void show(LyController parent, LyAction action, LyObjectList objects)
          Generic method to show an objects list.
 void startCommit(LySetController controller)
          Invoked when controller is starting to commit, default implementation does nothing.
 boolean useEditTable(LySetController controller, LyArrayFieldInfo array)
          Checks if an edit table should be used for the given array field.
 boolean useEditTable(LySetController controller, LyRelationFieldInfo relation)
          Checks if an edit table should be used for the given relation field.
 boolean useLocalCompletion(LySetController set, LyRelationFieldInfo relation)
          Indicates if auto-completion on the given relation fieldInfo is managed by the graphical component or by the field controller.
 boolean useSingleContext(LySetController controller, LyRelationFieldInfo parentRelation)
          Indicates if the given controller must link its context to its parent context.
 boolean validateChoiceOption(LySetController set, LyChoiceFieldInfo choice, LyChoiceOption option)
          Indicates if the given option is hidden on the given choice fieldInfo.
 
Methods inherited from class leon.app.behavior.LyActionBehavior
endAction, getClientContext, getContextTitle, getHelpFile, getImage, getImageTooltip, getKeyValue, getMenuItemImage, reset, startAction
 
Methods inherited from class leon.app.behavior.LyBehavior
free, getSession, handleDemand, init
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface leon.app.behaviorinterface.LyActionBehaviorInterface
endAction, getClientContext, getContextTitle, getHelpFile, getImage, getImageTooltip, getKeyValue, getMenuItemImage, reset, startAction
 
Methods inherited from interface leon.app.behaviorinterface.LyBehaviorInterface
free, handleDemand, init
 

Field Detail

__VERSION

public static final java.lang.String __VERSION
File version.

See Also:
Constant Field Values

STATUS_IGNORE

public static final short STATUS_IGNORE
Code returned when there is no modification on the value for controlNewValue, checkNewValue and controlNewValues.
All codes are :

See Also:
Constant Field Values

STATUS_OK

public static final short STATUS_OK
Code returned when the value is correct for controlNewValue, checkNewValue and controlNewValues.

See Also:
STATUS_IGNORE, Constant Field Values

STATUS_KO

public static final short STATUS_KO
Code returned when the value is not correct for controlNewValue, checkNewValue and controlNewValues.

See Also:
STATUS_IGNORE, Constant Field Values

STATUS_WARNING

public static final short STATUS_WARNING
Code returned when the value is on warning for controlNewValue, checkNewValue and controlNewValues.

See Also:
STATUS_IGNORE, Constant Field Values
Constructor Detail

LyClassBehavior

public LyClassBehavior()
Construct a class behavior.

Method Detail

getImage

public java.lang.String getImage(LyFormController formController,
                                 LyObject object)
Gets the image associated to the given object for the given form.

Specified by:
getImage in interface LyFormBehaviorInterface
Parameters:
formController - the form controller
object - object whose image is looked for
Returns:
Logical name of the image.
See Also:
LyController.getImage(leon.info.LyObjectInfo)

getTitle

public java.lang.String getTitle(LyAreaController areaController,
                                 LyAction action)
Gets title corresponding to the given action. Overriden to computes title with the action name and the action classInfo name and the object name separated by " : ".

Specified by:
getTitle in interface LyActionBehaviorInterface
Overrides:
getTitle in class LyActionBehavior
Parameters:
areaController - the current LyAreaController instance
action - the action that was executed
Returns:
Title for the given action.

getValue

public java.lang.Object getValue(LyFormController form,
                                 LyFieldInfo fieldInfo)
Gets value of the given fieldInfo. This method must be efficient because it can be called frequently.
The default implementation gets the value of the object associated to the given form.

Specified by:
getValue in interface LyFormBehaviorInterface
Parameters:
form - the current LyFormController instance.
fieldInfo - the fieldInfo that contains the value.
Returns:
the value of the given fieldInfo as an Object

isDisplayed

public boolean isDisplayed(LyFormController form,
                           LyFieldInfo fieldInfo)
Indicates if the given fieldInfo is displayed in the given form or not.
The default implementation does nothing and return true.

Specified by:
isDisplayed in interface LyFormBehaviorInterface
Parameters:
form - the current LyFormController instance.
fieldInfo - the fieldInfo which is tested for addition in the view.
Returns:
true if the field should be added, false if it should be skipped.

getDefaultValue

public java.lang.Object getDefaultValue(LySetController set,
                                        LyFieldInfo fieldInfo)
Gets a default value for the given fieldInfo. This method can be called:

Specified by:
getDefaultValue in interface LySetBehaviorInterface
Parameters:
set - the current LySetController instance.
fieldInfo - the fieldInfo that contains the value.
Returns:
the value of the given fieldInfo as an Object

isOptional

public boolean isOptional(LySetController set,
                          LyFieldInfo fieldInfo)
Checks if the given fieldInfo is optional or not for the given controller.
The default implementation tests if the given fieldInfo has the optional mark.

Specified by:
isOptional in interface LySetBehaviorInterface
Parameters:
set - the current LySetController instance (creation or set action)
fieldInfo - the target fieldInfo to test
Returns:
true if the given fieldInfo is optional, false otherwise

isEditable

public boolean isEditable(LySetController set,
                          LyFieldInfo fieldInfo)
Checks if the given fieldInfo is editable or not for the given controller.
The default implementation return false if the given fieldInfo has the readOnly mark, otherwise if the action is a creation and if the field info has a readOnly control then return true if the read only control priority level is greater than the application priority level on the set object.

Specified by:
isEditable in interface LySetBehaviorInterface
Parameters:
set - the current LySetController instance (creation or set action)
fieldInfo - the target fieldInfo to test
Returns:
true if the given fieldInfo is editable, false otherwise

isEnabled

public boolean isEnabled(LySetController set,
                         LyFieldInfo fieldInfo)
Checks if the given fieldInfo is enabled or not for the given controller.
The default implementation checks if the given fieldInfo has not the disable mark.

Specified by:
isEnabled in interface LySetBehaviorInterface
Parameters:
set - the current LySetController instance
fieldInfo - the target fieldInfo to test
Returns:
true if the given fieldInfo is enabled, false otherwise

getAutoCompletionMaximum

public int getAutoCompletionMaximum(LySetController set,
                                    LyTextFieldInfo fieldInfo)
Indicates the maximum number of values displayed in text components for auto-completion.
Default implementation returns the value of the LY_TEXT_AUTO_COMPLETION_MAXIMUM resource except for fields that have the secret or private mark (returns 0).

Specified by:
getAutoCompletionMaximum in interface LySetBehaviorInterface
Parameters:
set - the current LySetController instance
fieldInfo - the target text fieldInfo to test
Returns:
a positive number if auto-completion is activated, 0 if auto-completion is not activated, a negative value if there is no maximum.

getAutoCompletionValues

public java.lang.String[] getAutoCompletionValues(LySetController set,
                                                  LyTextFieldInfo fieldInfo)
Computes the list of values displayed in text components for auto-completion.
Default implementation returns the list of values already loaded for given text field info.

Specified by:
getAutoCompletionValues in interface LySetBehaviorInterface
Parameters:
set - the current LySetController instance.
fieldInfo - the target text fieldInfo.
Returns:
the list of values for auto-completion.

getChoiceDomain

public java.util.Vector<LyChoiceOption> getChoiceDomain(LySetController set,
                                                        LyChoiceFieldInfo choice)
Gets domain (list of allowed options) of the given choice fieldInfo.

Specified by:
getChoiceDomain in interface LySetBehaviorInterface
Parameters:
set - the current LySetController instance
choice - target choice fieldInfo
Returns:
a list of LyChoiceOption allowed for this choice field info

isValidGroup

public boolean isValidGroup(LySetController set,
                            LyChoiceFieldInfo choice,
                            LyChoiceOption option,
                            LyChoiceOptionGroup group)
Checks if the given group is valid for the given option of the choice fieldinfo.

Specified by:
isValidGroup in interface LySetBehaviorInterface
Parameters:
set - the current set controller
choice - the choice fieldInfo
option - the choiceOption
group - the choiceOption group
Returns:
true if the group is valid, false otherwise.

enableChoiceOption

public boolean enableChoiceOption(LySetController set,
                                  LyChoiceFieldInfo choice,
                                  LyChoiceOption option)
Indicates if the given option is enabled on the given choice fieldInfo.
The default implementation checks if the option is not disabled.

Specified by:
enableChoiceOption in interface LySetBehaviorInterface
Parameters:
set - the current LySetController instance
choice - choiceFieldInfo that contains this option
option - the option to enabled
Returns:
true if the option is enabled, false otherwise

validateChoiceOption

public boolean validateChoiceOption(LySetController set,
                                    LyChoiceFieldInfo choice,
                                    LyChoiceOption option)
Indicates if the given option is hidden on the given choice fieldInfo.
The default implementation checks if the option is not disabled.

Specified by:
validateChoiceOption in interface LySetBehaviorInterface
Parameters:
set - the current LySetController instance
choice - choiceFieldInfo that contains this option
option - the option to check
Returns:
true if the option is hidden, false otherwise

getRelationDomain

public LyObjectList getRelationDomain(LySetController set,
                                      LyRelationFieldInfo relation)
Gets relation domain (list of available links) for the given relation fieldInfo.

Specified by:
getRelationDomain in interface LySetBehaviorInterface
Parameters:
set - the current LySetController instance
relation - the target relation field
Returns:
a list of LyObjects available for this relation

getFilterRelationDomain

public LyObjectList getFilterRelationDomain(LyFilterController filter,
                                            LyRelationFieldInfo relation)
Gets relation domain (list of available links in the filter context) for the given relation fieldInfo for filter actions.

Specified by:
getFilterRelationDomain in interface LyFilterBehaviorInterface
Parameters:
filter - the current LyFilterController instance
relation - the target relation field
Returns:
a list of LyObjects available for this relation in filtering context.

getFilterRelationClasses

public LyInfoList<LyClassInfo> getFilterRelationClasses(LyFormController filter,
                                                        LyRelationFieldInfo relation)
Gets the list of available class info for the given relation filtering.

Specified by:
getFilterRelationClasses in interface LyFilterBehaviorInterface
Parameters:
filter - the current instance of "filter controller" This parameter could be both a LyFilterController or a LyFilterRelationController. That's why its type is LyFormController which is the common inheritance.
relation - the target relation field
Returns:
a list of classInfo available for filtering the relation

getFilterChoiceDomain

public java.util.Vector<LyChoiceOption> getFilterChoiceDomain(LyFilterController filter,
                                                              LyChoiceFieldInfo choice)
Gets domain (list of allowed options) of the given choice fieldInfo.

Specified by:
getFilterChoiceDomain in interface LyFilterBehaviorInterface
Parameters:
filter - the current LyFilterController instance
choice - target choice fieldInfo
Returns:
a list of LyChoiceOption allowed for this choice field info

getRelationFilter

public LyFilter getRelationFilter(LySetController controller,
                                  LyRelationFieldInfo relation,
                                  LyClassInfo classInfo)
Gets the filter of the given relation and the given class.
This method is used by the getRelationDomain(LySetController, LyRelationFieldInfo) method when the target objets of the relation need to be filtered. The current implementation return null if the relation is null, the relation filter ( relation.getFilter(classInfo))

Specified by:
getRelationFilter in interface LySetBehaviorInterface
Parameters:
controller - the current LySetController instance
relation - the relation field info we want to filter
classInfo - ClassInfo for which we look for an associated filter.
Returns:
The filter associated to the given classInfo, or null if no filter has been specified for this classInfo in this relation.

enableRelationLink

public boolean enableRelationLink(LySetController set,
                                  LyRelationFieldInfo relation,
                                  LyObject link,
                                  boolean showError)
Allows the given link object as a possible value for the given relation field info.
The default implementation only calls enableRelationLink(set, relation, link) .

Specified by:
enableRelationLink in interface LySetBehaviorInterface
Parameters:
set - the current LySetController instance
relation - the relation that contains the link
link - the link to enabled
showError - indicates if an error should be shown if the given link is rejected.
Returns:
true if the link is enabled on this relation, false otherwise
See Also:
enableRelationLink(LySetController, LyRelationFieldInfo, LyObject)

enableRelationLink

public boolean enableRelationLink(LySetController set,
                                  LyRelationFieldInfo relation,
                                  LyObject link)
Allows the given link object as a possible value for the given relation field info.
The default implementation always returns true.

Specified by:
enableRelationLink in interface LySetBehaviorInterface
Parameters:
set - the current LySetController instance
relation - the relation that contains the link
link - the link to enabled
Returns:
true if the link is enabled on this relation, false otherwise

enableRelationHRef

public boolean enableRelationHRef(LyConsultController consult,
                                  LyRelationFieldInfo relation,
                                  LyObject href)
Enables the given href object on the given relation field info.
The default implementation always returns true.

Specified by:
enableRelationHRef in interface LyConsultBehaviorInterface
Parameters:
consult - the current LyConsultController instance
relation - the relation that contains the href
href - the href to enabled
Returns:
true if the href is enabled on this relation, false otherwise

getRelationClasses

public LyInfoList<LyClassInfo> getRelationClasses(LySetController set,
                                                  LyRelationFieldInfo relation)
Gets the list of available classInfo of the given relation fieldInfo.

Specified by:
getRelationClasses in interface LySetBehaviorInterface
Parameters:
set - the current LySetController instance
relation - the target relation fieldInfo
Returns:
the list of classInfo available for this relation

getRelationContext

public LyObjectList getRelationContext(LySetController set,
                                       LyRelationFieldInfo relation)
Gets the list of objects of the given relation context.

Specified by:
getRelationContext in interface LySetBehaviorInterface
Parameters:
set - the current LySetController instance
relation - the target relation fieldInfo
Returns:
a list of LyObject available in this relation field

getAutoCompletionMaximum

public int getAutoCompletionMaximum(LySetController set,
                                    LyRelationFieldInfo relation)
Indicates the maximum number of values displayed in relation components for auto-completion.
The default implementation returns the LY_MULTIPLE_RELATION_AUTO_COMPLETION_MAX resource if relation is multiple or the LY_SIMPLE_RELATION_AUTO_COMPLETION_MAX resource if relation is simple.

Specified by:
getAutoCompletionMaximum in interface LySetBehaviorInterface
Parameters:
set - the current LySetController instance.
relation - the target relation fieldInfo to test.
Returns:
a positive number if auto-completion is activated, 0 if auto-completion is not activated, a negative value if there is no maximum.

useLocalCompletion

public boolean useLocalCompletion(LySetController set,
                                  LyRelationFieldInfo relation)
Indicates if auto-completion on the given relation fieldInfo is managed by the graphical component or by the field controller.

Specified by:
useLocalCompletion in interface LySetBehaviorInterface
Parameters:
set - the current LySetController instance
relation - the fieldInfo that may need to be checked
Returns:
true if auto-completion is managed by the graphical component, false otherwise

getRelationDomain

public LyObjectList getRelationDomain(LySetController set,
                                      LyRelationFieldInfo relation,
                                      java.lang.String prefix,
                                      boolean fill)
Gets relation domain (list of available links) for the given relation fieldInfo with the given prefix for related objects.

Specified by:
getRelationDomain in interface LySetBehaviorInterface
Parameters:
set - the current LySetController instance
relation - the target relation field
prefix - the prefix for related objects
fill - indicates whether the domain must be filtered with given prefix or not
Returns:
a list of LyObjects available for this relation and given prefix

getLinkShortLabel

public java.lang.String getLinkShortLabel(LySetController set,
                                          LyRelationFieldInfo relation,
                                          LyObject link)
Gets the short label that must be used for the given relation fieldInfo. The default implementation returns null.

Specified by:
getLinkShortLabel in interface LySetBehaviorInterface
Parameters:
set - the current LySetController instance
relation - the target relation field
link - the object represented by the link
Returns:
the short name of the link (displayed when selected) or null if no short label must be used

getTransverseActions

public LyInfoDataList<LyAction,LyClassInfo> getTransverseActions(LySetController set,
                                                                 LyFieldInfo fieldInfo)
Gets actions enabled by the given field. A list of pairs (action, classInfo) has to be returned.
The default implementation returns null if the given field is a not relation fied info, the getTransverseActions(set, (LyRelationFieldInfo) fieldInfo) result otherwise

Specified by:
getTransverseActions in interface LySetBehaviorInterface
Parameters:
set - the current LySetController instance
fieldInfo - the field that may enabled some actions
Returns:
the list of actions enabled by the given field

getTransverseActions

public LyInfoDataList<LyAction,LyClassInfo> getTransverseActions(LySetController set,
                                                                 LyRelationFieldInfo relation)
Gets all actions enabled by the given relation. A list of pairs (action, classInfo) has to be returned.

Specified by:
getTransverseActions in interface LySetBehaviorInterface
Parameters:
set - the current LySetController instance
relation - the relation that may enabled some actions
Returns:
a list of actions that are enabled by the given relation

getFilterTransverseActions

public LyInfoDataList<LyAction,LyClassInfo> getFilterTransverseActions(LyFilterController filter,
                                                                       LyFieldInfo fieldInfo)
Gets all actions enabled by the given field for a filter action. A list of pairs (action, classInfo) has to be returned.

Specified by:
getFilterTransverseActions in interface LyFilterBehaviorInterface
Parameters:
filter - the current LyFilterController instance
fieldInfo - the fieldInfo that may enabled some actions
Returns:
a list of actions enabled by the given relation for a filter action

getFilterTransverseActions

public LyInfoDataList<LyAction,LyClassInfo> getFilterTransverseActions(LyFilterController filter,
                                                                       LyRelationFieldInfo relation)
Gets all actions enabled by the given relation for a filter action. A list of pairs (action, classInfo) has to be returned.

Specified by:
getFilterTransverseActions in interface LyFilterBehaviorInterface
Parameters:
filter - the current LyFilterController instance
relation - the relation that may enabled some actions
Returns:
a list of actions enabled by the given relation for a filter action

needCheck

public boolean needCheck(LySetController set,
                         LyFieldInfo fieldInfo)
Indicates if the given fieldInfo needs to be checked when the value is modified (in creation and set mode).
The default implementation returns true if the given field has the mark NEED_POST or has dependencies.

Specified by:
needCheck in interface LySetBehaviorInterface
Parameters:
set - the current LySetController instance
fieldInfo - the fieldInfo that may need to be checked
Returns:
true if the field need to be checked, false otherwise

propagate

public void propagate(LySetController set,
                      LyFieldInfoValue newValue)
Progates the given field value to all fields.
The default implementation gets the field associated to the value and propagates it on all fields in the list of dependencies and that are managed by the given set controller.

Specified by:
propagate in interface LySetBehaviorInterface
Parameters:
set - the current LySetController instance
newValue - new field info value to propagate.

controlNewValue

public short controlNewValue(LySetController set,
                             LyFieldInfoValue newValue)
This method controls the given value before creating or modifying an object. It does not checks its content but the coherence between it and its field marks.
The default implementation checks that:

Specified by:
controlNewValue in interface LySetBehaviorInterface
Parameters:
set - the current LySetController instance
newValue - field info value to check. This value cannot be null.
Returns:
a code to indicates the control result. Possible values are:

checkNewValue

public short checkNewValue(LySetController set,
                           LyFieldInfoValue newValue)
Dynamicaly checks the given value for its associated field. This method is called when there is a modification of the field in the user interface (Value changed, focus lost...).
The default implementation call the checkValue method of the field associated to the new value.

Specified by:
checkNewValue in interface LySetBehaviorInterface
Parameters:
set - the current LySetController instance
newValue - field info value to check.
Returns:
a code to indicates the check result. Possible values are:

controlNewValues

public short controlNewValues(LySetController set,
                              LyValueSet newValues)
Global control of values before creating or modifying an object. If needed, extra values may be added during this control.
The default implementation controls:

Specified by:
controlNewValues in interface LySetBehaviorInterface
Parameters:
set - the current LySetController instance
newValues - Set of values to control
Returns:

addExtraValues

public void addExtraValues(LySetController set,
                           LyValueSet values)
This method adds the given extra values before completing the current operation.
The default implementation checks that every field with the NOT_NULL mark are not null. If a field has a null value and is not optionnal, this method tries to fill it with a default value.

Specified by:
addExtraValues in interface LySetBehaviorInterface
Parameters:
set - the current LySetController instance
values - Current set of values. Additionnal values must be add to this set.

endCreation

public boolean endCreation(LyCreateController create,
                           LyValueSet values)
Final step of the object creation process.
The default implementation creates the object with the given values.

Specified by:
endCreation in interface LyCreateBehaviorInterface
Parameters:
create - the current LyCreateController instance
values - Set of values corresponding to the object to create
Returns:
true if the create process is successfull, false otherwise

endSet

public boolean endSet(LySetController set,
                      LyValueSet values)
Final step of the object set process.
The default implementation commits modifications.

Specified by:
endSet in interface LySetBehaviorInterface
Parameters:
set - the current LySetController instance
values - Set of values for the modified object
Returns:
true if the modification process is done, false otherwise

checkDeletion

public java.lang.String checkDeletion(LyDeleteController delete,
                                      LyObject object)
Checks if the given object deletion is enabled or not (used before asking to the end-user if he want to delete it).
The default implementation does nothing and return null.

Specified by:
checkDeletion in interface LyDeleteBehaviorInterface
Parameters:
delete - current LyDeleteController instance
object - Object checked before deletion.
Returns:
Error message if deletion is not allowed, null otherwise.

checkDeletions

public LyObjectList checkDeletions(LyDeleteController delete,
                                   LyObjectList list)
Checks if the given objects list deletion is enabled or not (used before asking to the end-user if he want to delete them).
The default implementation creates a new LySimpleObjectList(list) and return it.

Specified by:
checkDeletions in interface LyDeleteBehaviorInterface
Parameters:
delete - current LyDeleteController instance
list - list of objects to checked before deletion.
Returns:
The list of allowed objects to delete.

getConfirmDeletionMessage

public java.lang.String getConfirmDeletionMessage(LyDeleteController delete,
                                                  LyObject object)
Asks for the deletion message for the given object.
The default implementation does nothing and return null.

Specified by:
getConfirmDeletionMessage in interface LyDeleteBehaviorInterface
Parameters:
delete - current LyDeleteController instance
object - Object checked before deletion.
Returns:
Confirmation message to display to the user if necessary, null otherwise.

endDeletion

public boolean endDeletion(LyDeleteController delete)
Final step of object deletion process.
The default implementation delete the object associated to the given controller.

Specified by:
endDeletion in interface LyDeleteBehaviorInterface
Parameters:
delete - current LyDeleteController instance
Returns:
true if the deletion is complete, false otherwise

setObject

public void setObject(LyConsultController controller,
                      LyObject object)
Method called when object shown in the form is changed.
The default implementation does nothing.

Specified by:
setObject in interface LyConsultBehaviorInterface
Parameters:
controller - the current LyConsultController instance.
object - the object shown in the form.

changeState

public void changeState(LyController parent,
                        LyAction action,
                        LyObjectList objects,
                        LyFieldInfo fieldInfo)
Generic method to handle modification of the state of an object (loop on values of a choice field info).

Parameters:
parent - Parent controller from which the given action was invoked.
action - Action of changing state.
objects - Objects on which the state is changed.
fieldInfo - Field info that symbolises state (Generic action only considers a non-multiple choiceFieldInfo)

modify

public void modify(LyController parent,
                   LyAction action,
                   LyObjectList objects,
                   LyValueSet fieldValues)
Generic method to handle modification of an objects list.

Parameters:
parent - Parent controller from which the given action was invoked.
action - Action of modifying.
objects - Objects to modify.
fieldValues - Values to assign on given objects.

show

public void show(LyController parent,
                 LyAction action,
                 LyObjectList objects)
Generic method to show an objects list.

Parameters:
parent - Parent controller from which the given action was invoked.
action - Action of showing.
objects - Objects to show.

hide

public void hide(LyController parent,
                 LyAction action,
                 LyObjectList objects)
Generic method to hide an objects list.

Parameters:
parent - Parent controller from which the given action was invoked.
action - Action of hidding.
objects - Objects to hide.

copy

public void copy(LyController parent,
                 LyAction action,
                 LyObjectList objects)
Generic method to copy an object.

Parameters:
parent - Parent controller from which the given action was invoked.
action - Action of copying.
objects - Objects to copy.

paste

public void paste(LyController parent,
                  LyAction action,
                  java.lang.String objectString)
Generic method to paste an object.

Parameters:
parent - Parent controller from which the given action was invoked.
action - pasting action
objectString - description of objects to paste

getAction

public LyAction getAction(LyConsultController consult,
                          LyRelationFieldInfo relation,
                          LyClassInfo classInfo)
Get action to use for consulting or editing the given relation with the specified class info selected on it.

Specified by:
getAction in interface LyConsultBehaviorInterface
Parameters:
consult - the current LyConsultController instance.
relation - Edited relation
classInfo - Selected class info.
Returns:
The action to use, if null let controller decides.

useEditTable

public boolean useEditTable(LySetController controller,
                            LyArrayFieldInfo array)
Checks if an edit table should be used for the given array field.

Specified by:
useEditTable in interface LySetBehaviorInterface
Parameters:
controller - The current LySetController instance.
array - The array field info.
Returns:
True if an edit table is requested, false otherwise.

useEditTable

public boolean useEditTable(LySetController controller,
                            LyRelationFieldInfo relation)
Checks if an edit table should be used for the given relation field.

Specified by:
useEditTable in interface LySetBehaviorInterface
Parameters:
controller - The current LySetController instance.
relation - The relation field info.
Returns:
True if an edit table is requested, false otherwise.

buildFilterElement

public LyFilterElement buildFilterElement(LyFilterController filter,
                                          LyFieldInfo fieldInfo,
                                          boolean not,
                                          LyFilterExpression.Condition condition,
                                          java.lang.Object value,
                                          java.util.BitSet modifiers)
Builds a filter element with the given parameters.
The default implementation does nothing.

Specified by:
buildFilterElement in interface LyFilterBehaviorInterface
Parameters:
filter - the current LyFilterController instance
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.

getSetAction

public LyAction getSetAction(LyOutlineController outline,
                             LyFieldInfo fieldInfo)
Get action used for fast edition of given field.

Specified by:
getSetAction in interface LyOutlineBehaviorInterface
Parameters:
outline - the current LyOutlineController instance.
fieldInfo - the fieldInfo to be edited.
Returns:
The action to be used for fast editing or null if field id not editable.

startCommit

public void startCommit(LySetController controller)
Invoked when controller is starting to commit, default implementation does nothing.

Specified by:
startCommit in interface LySetBehaviorInterface
Parameters:
controller - The current LySetController instance.

endCommit

public void endCommit(LySetController controller)
Invoked when controller is ending commit, default implementation does nothing.

Specified by:
endCommit in interface LySetBehaviorInterface
Parameters:
controller - The current LySetController instance.

getInsertPosition

public LyContext.Position getInsertPosition(LySetController controller,
                                            LyRelationFieldInfo relation)
Indicates if the operations of the controller context must be inserted at the beginning of the parent operations or at the end.

Specified by:
getInsertPosition in interface LySetBehaviorInterface
Parameters:
controller - the set controller
relation - the relation field info
Returns:
Position where operations must be inserted, may be null if left to controller decision.

formSaved

public void formSaved(LySetController controller,
                      LyFormSave formSave)
Method called on form save.

Specified by:
formSaved in interface LySetBehaviorInterface
Parameters:
controller - The current LySetController instance.
formSave - The formSave that was created.

formRestored

public void formRestored(LySetController controller,
                         LyFormSave formSave)
Method called on form restore.

Specified by:
formRestored in interface LySetBehaviorInterface
Parameters:
controller - The current LySetController instance.
formSave - The formSave that was restored.

useSingleContext

public boolean useSingleContext(LySetController controller,
                                LyRelationFieldInfo parentRelation)
Indicates if the given controller must link its context to its parent context.

Specified by:
useSingleContext in interface LySetBehaviorInterface
Parameters:
controller - The current LySetController instance.
parentRelation - the parent relation for this controller (may be null)

isLocked

public java.lang.String isLocked(LySetController controller,
                                 LyObject object)
Checks if given object is locked for edition.

Specified by:
isLocked in interface LySetBehaviorInterface
Parameters:
controller - The current LySetController instance.
object - Object to be checked.
Returns:
Null if not locked, otherwise a string message giving information about the lock (user, date...).

lockObject

public boolean lockObject(LySetController controller,
                          LyObject object,
                          boolean lock)
Locks/Unlocks given object for edition.

Specified by:
lockObject in interface LySetBehaviorInterface
Parameters:
controller - The current LySetController instance.
object - Object to be locked/unlocked.
lock - True if lock is required, false for unlock.
Returns:
True if successful, false otherwise.

(c) January 2013 - W4 S.A.

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