LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.control.form
Class LyArrayFieldSetController

java.lang.Object
  extended by leon.control.LyController
      extended by leon.control.form.LyFieldController
          extended by leon.control.form.LyFieldConsultController
              extended by leon.control.form.LyFieldSetController
                  extended by leon.control.form.LyArrayFieldSetController
All Implemented Interfaces:
LyGetSessionInterface, LyControllerContextInterface, LyFormResultInterface, LyAdvancedWorkSpaceListener, LyGuiListener, LyWorkSpaceListener, LyEvaluator, LyDemandListener
Direct Known Subclasses:
LyArrayStructFieldSetController

public class LyArrayFieldSetController
extends LyFieldSetController
implements LyFormResultInterface, LyAdvancedWorkSpaceListener

Field controller for modification of LyArrayFieldInfo.

See Also:
LySetController

Field Summary
static java.lang.String __VERSION
          File version
static java.lang.String MOVE_DOWN_TOOL
          Name of the tranverse tool for moving down items in table.
static java.lang.String MOVE_UP_TOOL
          Name of the tranverse tool for moving up items in table.
 
Fields inherited from class leon.control.form.LyFieldSetController
STANDARD_ARRAY_TOOL, STANDARD_CLASSINFO, TRANSVERSE_ACTION_SEP
 
Fields inherited from class leon.control.form.LyFieldController
FORM_FIELD_SEP, OLD_FORM_FIELD_SEP
 
Fields inherited from class leon.control.LyController
_nbControllers, _nextId, CONTROLLER_ID_SEP, DEFAULT_IMAGE_FORMAT, DEMAND_HELP, ID_SEP
 
Constructor Summary
LyArrayFieldSetController(LySetController parent, LyArrayFieldInfo fieldInfo)
          Constructor.
 
Method Summary
 void actionDemand(LyActionDemand demand)
          Invoked when an action occurs.
 void cancel()
          Method called when editions is cancelled.
 void clearViewCache()
          Clear view cache.
 void commit()
          Method called when all modifications are committed.
 short control()
          Method called for controlling current edition.
 short endValidate()
          Method called at the end of the parent form validation to complete the edition.
 void free()
          Free this field controller.
 LyFieldController getFieldController(int index)
          Get the field controller at the given index.
 LyValue getFieldValue()
          Extract current value for the specified fieldInfo in the form.
 LyValue getFieldValue(LyUnit unit)
          Extract current value for the specified fieldInfo in the form.
 void notifyFormResult(LyObject object, LyRelationFieldInfo relation)
          Notify object creation to parent.
 boolean objectAdded(LyWorkSpaceEvent event)
          Called when an object is added in the workspace.
 boolean objectChanged(LyWorkSpaceEvent event)
          Called when an object has changed in the workspace.
 boolean objectRemoved(LyWorkSpaceEvent event)
          Called when an object is removed from the workspace.
 boolean objectStateChanged(LyAdvancedWorkSpaceEvent event)
          Called when an object state is changed.
 boolean objectUserEvent(LyAdvancedWorkSpaceEvent event)
          Called when an object user event occured.
 void resetFromValue(java.lang.Object value, boolean freeOldValue, boolean createNewValue)
          Sets the field content from the specified value Any value modified by the user is the form is lost.
 void selectionDemand(LySelectionDemand demand)
          Invoked when an selection notification is sent to this listener.
 void setEditable(boolean editable)
          Changes current field status to (non-)editable.
 void setEnabled(boolean enabled)
          Changes current field status to (non-)enabled.
 void setEnableInnerTool(boolean status)
          Change the enable/disable status of the update tool.
 short startValidate()
          Method called at the begining of the parent form validation to check if everything is ok before completing the edition.
 boolean workSpaceEventsGrouped(java.util.ArrayList<LyWorkSpaceEvent> events)
          Called when grouped events are sent.
 
Methods inherited from class leon.control.form.LyFieldSetController
addTempFilePath, checkIfModified, clear, completeValue, getControllerContext, getDefaultBuilder, getFinalValue, getLastValue, getModel, getParentFieldController, getSetController, getTransverseActions, getUnit, getValue, isCreation, isEditable, isEnabled, isOptional, reset, restore, save, setFieldValue, setHidden, setInternal, setOptional, unitChanged, update, updateFieldItem, updateViewContent, updateViewFromValues
 
Methods inherited from class leon.control.form.LyFieldConsultController
isHidden, propagate, setLabel
 
Methods inherited from class leon.control.form.LyFieldController
getAction, getAreaController, getBehavior, getClassInfo, getComponent, getDefaultFieldUnit, getDefaultFieldUnit, getEnvironment, getFieldInfo, getFormController, getFormField, getFormField, getImage, getInfoLabel, getInfoLabel, getLabel, getObject, getState, getViewController, hasMark, invokeTransverseAction, isIdle, menuDemand, setAreaNoScroll, setFieldValue, setFormField, setState, toString
 
Methods inherited from class leon.control.LyController
activateViewDemand, demandPerformed, dragDropDemand, getApplication, getBehaviorInterface, getBuilder, getClassInfo, getId, getImage, getImage, getImage, getImageFromPrefix, getImageFromPrefix, getImageFromPrefix, getKeyValue, getLastModified, getName, getObjectId, getParent, getSession, getUserData, getView, getViewManager, hasViewController, helpDemand, hideView, hideView, isFreed, setBuilder, setBuilderClass, setIdle, setLastModified, setName, setUserData, showError, showError, showView, showWarning
 
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

MOVE_UP_TOOL

public static final java.lang.String MOVE_UP_TOOL
Name of the tranverse tool for moving up items in table.

See Also:
Constant Field Values

MOVE_DOWN_TOOL

public static final java.lang.String MOVE_DOWN_TOOL
Name of the tranverse tool for moving down items in table.

See Also:
Constant Field Values
Constructor Detail

LyArrayFieldSetController

public LyArrayFieldSetController(LySetController parent,
                                 LyArrayFieldInfo fieldInfo)
Constructor.

Parameters:
parent - the parent set controller
fieldInfo - array field handled by this controller
Method Detail

free

public void free()
Free this field controller.

Overrides:
free in class LyFieldController

clearViewCache

public void clearViewCache()
Clear view cache.

Overrides:
clearViewCache in class LyFieldController

getFieldController

public LyFieldController getFieldController(int index)
Description copied from class: LyFieldController
Get the field controller at the given index.

Overrides:
getFieldController in class LyFieldController
Parameters:
index - an index
Returns:
null
See Also:
LyFieldController.getFieldController(int)

actionDemand

public void actionDemand(LyActionDemand demand)
Invoked when an action occurs. At this level, the implementation manages
DEMAND_VALIDATE demands. (demand.getType = LyActionDemand.TYPE_ACTION AND demand.getSource() = LyController.DEMAND_VALIDATE)
DEMAND_APPLY demands. (demand.getType = LyActionDemand.TYPE_ACTION AND demand.getSource() = LyController.DEMAND_APPLY)
Default action (double click)
Default action (double click)
VALUE_CHANGED demands. (demand.getType = LyActionDemand.TYPE_VALUE_CHANGED

Overrides:
actionDemand in class LyFieldSetController
Parameters:
demand - the action demand
See Also:
LyController.demandPerformed(leon.view.event.LyDemand)

selectionDemand

public void selectionDemand(LySelectionDemand demand)
Invoked when an selection notification is sent to this listener.

This method is called by demandPerformed and may be overriden in subclasses.

Default implementation makes nothing.

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

getFieldValue

public LyValue getFieldValue(LyUnit unit)
Extract current value for the specified fieldInfo in the form.

Overrides:
getFieldValue in class LyFieldSetController
Parameters:
unit - Unit of the value.
Returns:
current value, or null if not found or field is disabled.

getFieldValue

public LyValue getFieldValue()
Extract current value for the specified fieldInfo in the form.

Overrides:
getFieldValue in class LyFieldSetController
Returns:
current value, or null if not found or field is disabled.

setEnableInnerTool

public void setEnableInnerTool(boolean status)
Change the enable/disable status of the update tool.

Parameters:
status - new status of the tool

setEditable

public void setEditable(boolean editable)
Changes current field status to (non-)editable.

Overrides:
setEditable in class LyFieldSetController
Parameters:
editable - new fieldInfo status.

setEnabled

public void setEnabled(boolean enabled)
Changes current field status to (non-)enabled.

Overrides:
setEnabled in class LyFieldSetController
Parameters:
enabled - new fieldInfo status.

startValidate

public short startValidate()
Method called at the begining of the parent form validation to check if everything is ok before completing the edition.

Overrides:
startValidate in class LyFieldSetController
Returns:
One of the status codes indicating if the validation was done (STATUS_OK), if an error occured (STATUS_KO), or if nothing was done by the user (STATUS_IGNORE).
See Also:
LyFormInterface

endValidate

public short endValidate()
Method called at the end of the parent form validation to complete the edition.

Overrides:
endValidate in class LyFieldSetController
Returns:
One of the status codes indicating if the validation was complete (STATUS_OK), if an error occured (STATUS_KO), or if nothing was done by the user (STATUS_IGNORE).
See Also:
LyFormInterface

commit

public void commit()
Method called when all modifications are committed.

Overrides:
commit in class LyFieldSetController

cancel

public void cancel()
Method called when editions is cancelled.

Overrides:
cancel in class LyFieldSetController

control

public short control()
Method called for controlling current edition.

Overrides:
control in class LyFieldSetController
Returns:
the result of the control
See Also:
LyFormInterface

resetFromValue

public void resetFromValue(java.lang.Object value,
                           boolean freeOldValue,
                           boolean createNewValue)
Sets the field content from the specified value Any value modified by the user is the form is lost. Default implementation just call updateFieldItem but this may be overriden in subclasses.

Overrides:
resetFromValue in class LyFieldSetController
Parameters:
value - new value to set in the field.
freeOldValue - indicates if the old value should be freed (deleted) when it is an object
createNewValue - indicates if a new empty value should created when object is null and when the value is an object

notifyFormResult

public void notifyFormResult(LyObject object,
                             LyRelationFieldInfo relation)
Notify object creation to parent.

Specified by:
notifyFormResult in interface LyFormResultInterface
Parameters:
object - Object created by the creation form.
relation - Relation for which the object was created.

objectAdded

public boolean objectAdded(LyWorkSpaceEvent event)
Called when an object is added in the workspace.

Specified by:
objectAdded in interface LyWorkSpaceListener
Parameters:
event - Event notifying object add.
Returns:
True if the event is used by the listener, false otherwise.

objectRemoved

public boolean objectRemoved(LyWorkSpaceEvent event)
Called when an object is removed from the workspace.

Specified by:
objectRemoved in interface LyWorkSpaceListener
Parameters:
event - Event notifying object remove.
Returns:
True if the event is used by the listener, false otherwise.

objectChanged

public boolean objectChanged(LyWorkSpaceEvent event)
Called when an object has changed in the workspace. This call notifies a change on the object concerned by the event either because its values have changed or because the sort on the workspace has changed and consequently the object position within the list has changed. These two cases can easily be distinguished by accessing the values set contained in the event (if it's not null, this is an change on the object, not a modification of the sort).

Note that object position may also change if one of the modified fields is one of the fields specified in the list sort.

Specified by:
objectChanged in interface LyWorkSpaceListener
Parameters:
event - Event notifying object change.
Returns:
True if the event is used by the listener, false otherwise.

objectStateChanged

public boolean objectStateChanged(LyAdvancedWorkSpaceEvent event)
Called when an object state is changed.

Specified by:
objectStateChanged in interface LyAdvancedWorkSpaceListener
Parameters:
event - Event notifying object state change.
Returns:
True if the event is used by the listener, false otherwise.

objectUserEvent

public boolean objectUserEvent(LyAdvancedWorkSpaceEvent event)
Called when an object user event occured.

Specified by:
objectUserEvent in interface LyAdvancedWorkSpaceListener
Parameters:
event - Event notifying object user event.
Returns:
True if the event is used by the listener, false otherwise.

workSpaceEventsGrouped

public boolean workSpaceEventsGrouped(java.util.ArrayList<LyWorkSpaceEvent> events)
Called when grouped events are sent.

Specified by:
workSpaceEventsGrouped in interface LyAdvancedWorkSpaceListener
Parameters:
events - Sorted list of events.
Returns:
True if the events are used by the listener, false otherwise.

(c) January 2013 - W4 S.A.

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