LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.app.behaviorinterface
Interface LySetBehaviorInterface

All Superinterfaces:
LyActionBehaviorInterface, LyBehaviorInterface, LyConsultBehaviorInterface, LyFormBehaviorInterface
All Known Subinterfaces:
LyClassBehaviorInterface, LyCreateBehaviorInterface
All Known Implementing Classes:
LyClassBehavior

public interface LySetBehaviorInterface
extends LyConsultBehaviorInterface

This interface defines the methods to implement in order to modify the behavior of a modification action. A modification action includes create, set and clone.

See Also:
LySetController

Field Summary
static java.lang.String __VERSION
          File version
static short STATUS_CANCEL
          Code returned when there is no modification on the value for controlNewValue, checkNewValue and controlNewValues.
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.
 
Method Summary
 void addExtraValues(LySetController set, LyValueSet values)
          This method adds the given extra values before completing the current operation.
 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.
 boolean enableChoiceOption(LySetController set, LyChoiceFieldInfo choice, LyChoiceOption option)
          Indicates if the given option is enabled on the given choice fieldInfo.
 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 endSet(LySetController set, LyValueSet values)
          Final step of 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.
 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.Object getDefaultValue(LySetController set, LyFieldInfo fieldInfo)
          Gets the default value of the given fieldInfo.
 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.
 LyInfoDataList<LyAction,LyClassInfo> getTransverseActions(LySetController set, LyFieldInfo fieldInfo)
          Gets actions enabled by the given field.
 LyInfoDataList<LyAction,LyClassInfo> getTransverseActions(LySetController set, LyRelationFieldInfo relation)
          Gets actions enabled by the given relation.
 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 options 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.
 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 propagate(LySetController set, LyFieldInfoValue newValue)
          Progates modifications of the given field on all other fields.
 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 interface leon.app.behaviorinterface.LyConsultBehaviorInterface
enableRelationHRef, getAction, setObject
 
Methods inherited from interface leon.app.behaviorinterface.LyFormBehaviorInterface
getImage, getValue, isDisplayed
 
Methods inherited from interface leon.app.behaviorinterface.LyActionBehaviorInterface
endAction, getClientContext, getContextTitle, getHelpFile, getImage, getImageTooltip, getKeyValue, getMenuItemImage, getTitle, reset, startAction
 
Methods inherited from interface leon.app.behaviorinterface.LyBehaviorInterface
free, handleDemand, init
 

Field Detail

__VERSION

static final java.lang.String __VERSION
File version

See Also:
Constant Field Values

STATUS_CANCEL

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

See Also:
Constant Field Values

STATUS_IGNORE

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

See Also:
STATUS_CANCEL, Constant Field Values

STATUS_OK

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

See Also:
STATUS_CANCEL, Constant Field Values

STATUS_KO

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

See Also:
STATUS_CANCEL, Constant Field Values

STATUS_WARNING

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

See Also:
STATUS_CANCEL, Constant Field Values
Method Detail

isOptional

boolean isOptional(LySetController set,
                   LyFieldInfo fieldInfo)
Checks if the given fieldInfo is optional or not for the given controller.

Parameters:
set - the current LySetController instance
fieldInfo - the target fieldInfo to test
Returns:
true if the given fieldInfo is optional, false otherwise

isEditable

boolean isEditable(LySetController set,
                   LyFieldInfo fieldInfo)
Checks if the given fieldInfo is editable or not for the given controller.

Parameters:
set - the current LySetController instance
fieldInfo - the target fieldInfo to test
Returns:
true if the given fieldInfo is editable, false otherwise

isEnabled

boolean isEnabled(LySetController set,
                  LyFieldInfo fieldInfo)
Checks if the given fieldInfo is enabled or not for the given controller.

Parameters:
set - the current LySetController instance
fieldInfo - the target fieldInfo to test
Returns:
true if the given fieldInfo is enabled, false otherwise

getAutoCompletionMaximum

int getAutoCompletionMaximum(LySetController set,
                             LyTextFieldInfo fieldInfo)
Indicates the maximum number of values displayed in text components for auto-completion.

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

java.lang.String[] getAutoCompletionValues(LySetController set,
                                           LyTextFieldInfo fieldInfo)
Computes the list of values displayed in text components for auto-completion.

Parameters:
set - the current LySetController instance.
fieldInfo - the target text fieldInfo to test.
Returns:
the list of values for auto-completion.

getChoiceDomain

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

Parameters:
set - the current LySetController instance
choice - target choice fieldInfo
Returns:
the list of LyChoiceOption allowed for this choice field info

isValidGroup

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

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

boolean enableChoiceOption(LySetController set,
                           LyChoiceFieldInfo choice,
                           LyChoiceOption option)
Indicates if the given option is enabled on the given choice fieldInfo.

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

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.

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

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

Parameters:
set - the current LySetController instance
relation - the target relation field
Returns:
a list of LyObjects available for this relation

enableRelationLink

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.

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

enableRelationLink

boolean enableRelationLink(LySetController set,
                           LyRelationFieldInfo relation,
                           LyObject link)
Allows the given link object as a possible value for the given relation field info.

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

getRelationClasses

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

Parameters:
set - the current LySetController instance
relation - the target relation fieldInfo
Returns:
the list of classInfo available for this relation

getRelationContext

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

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

getAutoCompletionMaximum

int getAutoCompletionMaximum(LySetController set,
                             LyRelationFieldInfo relation)
Indicates the maximum number of values displayed in relation components for auto-completion.

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.

getRelationDomain

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.

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

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

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

useLocalCompletion

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.

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

getTransverseActions

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

Parameters:
set - the current LySetController instance
relation - the relation that may enabled some actions
Returns:
the list of actions enabled by the given relation

getTransverseActions

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.

Parameters:
set - the current LySetController instance
fieldInfo - the field that may enabled some actions
Returns:
a list of actions enabled by the given field

getDefaultValue

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

Parameters:
set - the current LySetController instance.
fieldInfo - the fieldInfo that contains the value.
Returns:
the value of the given fieldInfo as an Object

needCheck

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).

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

void propagate(LySetController set,
               LyFieldInfoValue newValue)
Progates modifications of the given field on all other fields. Propagate modidication of a fieldInfo with the given value on other fields.

Parameters:
set - the current LySetController instance
newValue - new field info value to propagate

controlNewValue

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.

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

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...).

Parameters:
set - the current LySetController instance
newValue - field info value to check.
Returns:
a code to indicates the check result. Possible values are:
  • STATUS_KO if the value is not correct
  • STATUS_OK if the value is correct

controlNewValues

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.

Parameters:
set - the current LySetController instance
newValues - Set of values to control
Returns:
  • STATUS_IGNORE if the value has not change
  • STATUS_KO if the value is not correct
  • STATUS_OK if the value is correct

addExtraValues

void addExtraValues(LySetController set,
                    LyValueSet values)
This method adds the given extra values before completing the current operation.

Parameters:
set - the current LySetController instance
values - Current set of values. Additionnal values must be add to this set

endSet

boolean endSet(LySetController set,
               LyValueSet values)
Final step of object set process.

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

getRelationFilter

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.

Parameters:
controller - the current LyController 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.

useEditTable

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

Parameters:
controller - The current LySetController instance.
array - The array field info.
Returns:
True if an edit table is requested, false otherwise.

useEditTable

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

Parameters:
controller - The current LySetController instance.
relation - The relation field info.
Returns:
True if an edit table is requested, false otherwise.

startCommit

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

Parameters:
controller - The current LySetController instance.

endCommit

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

Parameters:
controller - The current LySetController instance.

getInsertPosition

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.

Parameters:
controller - the set controller
relation - the relation field
Returns:
Position where operations must be inserted, may be null if left to controller decision.

formSaved

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

Parameters:
controller - The current LySetController instance.
formSave - The formSave that was created.

formRestored

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

Parameters:
controller - The current LySetController instance.
formSave - The formSave that was restored.

useSingleContext

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

Parameters:
controller - The current LySetController instance.
parentRelation - the parent relation for this controller (may be null)

isLocked

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

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

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

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