LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.control.form
Class LyCompositionFieldUnitSetController

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.LyCompositionFieldUnitSetController
All Implemented Interfaces:
LyGetSessionInterface, LyControllerContextInterface, LyFormResultInterface, LyGuiListener, LyWorkSpaceListener, LyEvaluator, LyDemandListener

public class LyCompositionFieldUnitSetController
extends LyFieldSetController
implements LyFormResultInterface, LyWorkSpaceListener

Field controller for a modification of a simple composition relation.

See Also:
LySetController

Field Summary
static java.lang.String __VERSION
          File version
 
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
LyCompositionFieldUnitSetController(LySetController parent, LyRelationFieldInfo fieldInfo)
          Constructor.
 
Method Summary
 void actionDemand(LyActionDemand demand)
          Invoked when an action occurs.
 void cancel()
          Method called when editions is cancelled.
 boolean checkIfModified()
          Checks if the value for the fieldInfo has been modified.
 void clearViewCache()
          Clear view cache.
 void commit()
          Method called when all modifications are committed.
 short control()
          Controls current edition.
 short endValidate()
          Method called at the end of the parent form validation to complete the edition.
 void free()
          Free this controller.
 LyAreaController getAreaController()
          Gets the specific areaController for the given field info.
 LyClassInfo getFieldType()
          Gets the classInfo of the object pointed by the relation in the current form.
 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.
 LyUnit getUnit()
          Get current unit for the specified fieldInfo in the form.
 void invokeTransverseAction(LyAction action, LyClassInfo classInfo)
          Internal method to invoke on a relation a transverse action for a given classInfo.
 void notifyFormResult(LyObject object, LyRelationFieldInfo relation)
          Internal use.
 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.
 void setEditable(boolean editable)
          Changes current field status to (non-)editable.
 void setEnabled(boolean enabled)
          Changes current field status to (non-)enabled.
 void setFormField(LyFormField formField)
          Sets formField.
 short startValidate()
          Method called at the begining of the parent form validation to check if everything is ok before completing the edition.
 void unitChanged(java.lang.String newUnitId, java.lang.String oldUnitId)
          Internal method for propagating a unit change.
 
Methods inherited from class leon.control.form.LyFieldSetController
addTempFilePath, clear, completeValue, getControllerContext, getDefaultBuilder, getFinalValue, getLastValue, getModel, getParentFieldController, getSetController, getTransverseActions, getValue, isCreation, isEditable, isEnabled, isOptional, reset, resetFromValue, restore, save, setFieldValue, setHidden, setInternal, setOptional, update, updateFieldItem, updateViewContent, updateViewFromValues
 
Methods inherited from class leon.control.form.LyFieldConsultController
isHidden, propagate, setLabel
 
Methods inherited from class leon.control.form.LyFieldController
getAction, getBehavior, getClassInfo, getComponent, getDefaultFieldUnit, getDefaultFieldUnit, getEnvironment, getFieldController, getFieldInfo, getFormController, getFormField, getFormField, getImage, getInfoLabel, getInfoLabel, getLabel, getObject, getState, getViewController, hasMark, isIdle, menuDemand, setAreaNoScroll, setFieldValue, 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, selectionDemand, 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
Constructor Detail

LyCompositionFieldUnitSetController

public LyCompositionFieldUnitSetController(LySetController parent,
                                           LyRelationFieldInfo fieldInfo)
Constructor.

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

free

public void free()
Free this controller.

Overrides:
free in class LyFieldController

clearViewCache

public void clearViewCache()
Clear view cache.

Overrides:
clearViewCache in class LyFieldController

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)

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.

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

setFormField

public void setFormField(LyFormField formField)
Sets formField. Called by LyFormFieldBuilder to avoid loops. Reserved for internal use.

Overrides:
setFormField in class LyFieldController
Parameters:
formField - the form field

unitChanged

public void unitChanged(java.lang.String newUnitId,
                        java.lang.String oldUnitId)
Internal method for propagating a unit change. This methods is called when the field unit has been changed by the user.

The LySetController additionaly impact the view using the setValid method.

Overrides:
unitChanged in class LyFieldSetController
Parameters:
newUnitId - The new fieldinfo unit.
oldUnitId - The old fieldinfo unit.

getUnit

public LyUnit getUnit()
Get current unit for the specified fieldInfo in the form.

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

invokeTransverseAction

public void invokeTransverseAction(LyAction action,
                                   LyClassInfo classInfo)
Internal method to invoke on a relation a transverse action for a given classInfo.

Overrides:
invokeTransverseAction in class LyFieldController
Parameters:
action - Transverse action.
classInfo - Class info on which the action is applied.

notifyFormResult

public void notifyFormResult(LyObject object,
                             LyRelationFieldInfo relation)
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.
relation - the relation

getAreaController

public LyAreaController getAreaController()
Gets the specific areaController for the given field info.

Overrides:
getAreaController in class LyFieldController
Returns:
Area controller corresponding to the given field info, null in most cases.

getFieldType

public LyClassInfo getFieldType()
Gets the classInfo of the object pointed by the relation in the current form.

Returns:
The classInfo of the object pointed by the relation in the current form.

setEditable

public void setEditable(boolean editable)
Changes current field status to (non-)editable. If the field is not editable, the value is read-only but however submited with all other values. A disabled field is not submited with all other values and is just ignored.

Overrides:
setEditable in class LyFieldSetController
Parameters:
editable - new fieldInfo status. (default is true or obtained from the view description)

setEnabled

public void setEnabled(boolean enabled)
Changes current field status to (non-)enabled. If the field is not editable, and not submited with all other values.

Overrides:
setEnabled in class LyFieldSetController
Parameters:
enabled - new fieldInfo status. (default is true or obtained from the view description)

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

checkIfModified

public boolean checkIfModified()
Checks if the value for the fieldInfo has been modified.

Overrides:
checkIfModified in class LyFieldSetController
Returns:
true if the value has been modified, false otherwise.

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.

control

public short control()
Controls current edition.

Overrides:
control in class LyFieldSetController
Returns:
The error status.

(c) January 2013 - W4 S.A.

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