LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.control.form
Class LyStructFieldSetController

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

public class LyStructFieldSetController
extends LyFieldSetController
implements LyFormResultInterface, LyDataSourceListener

Field controller for modification of a LyStructFieldInfo.

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
LyStructFieldSetController(LySetController parent, LyStructFieldInfo fieldInfo)
          Constructor.
 
Method Summary
 void cancel()
          Method called when editions is cancelled.
 void free()
          Free this controller.
 LyClassInfo getFieldType()
          Gets the classInfo of the object pointed by the relation in the current form.
 LyValue getFieldValue(LyUnit unit)
          Extract current value for the specified fieldInfo in the form.
 LyObject getObject(boolean create)
          Get the associated object
 void invokeTransverseAction(LyAction action, LyClassInfo classInfo)
          Internal method to invoke on a relation a transverse action for a given classInfo.
 boolean isCreation()
          Indicate if thie field is in creation or modification mode of the struct object (use by array of structs).
 void notifyFormResult(LyObject object, LyRelationFieldInfo relation)
          Internal use.
 boolean objectCreated(LyDataSourceEvent event)
          Method for receiving an object creation.
 boolean objectDeleted(LyDataSourceEvent event)
          Method for receiving an object deletion.
 boolean objectModified(LyDataSourceEvent event)
          Method for receiving an object modification.
 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 setCreation(boolean status)
          Indicate if thie field is in creation or modification mode of the struct object (use by array of structs).
 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
actionDemand, addTempFilePath, checkIfModified, clear, commit, completeValue, control, endValidate, getControllerContext, getDefaultBuilder, getFieldValue, getFinalValue, getLastValue, getModel, getParentFieldController, getSetController, getTransverseActions, getUnit, getValue, isEditable, isEnabled, isOptional, reset, restore, save, setEditable, setEnabled, setFieldValue, setHidden, setInternal, setOptional, startValidate, update, updateFieldItem, updateViewContent, updateViewFromValues
 
Methods inherited from class leon.control.form.LyFieldConsultController
isHidden, propagate, setLabel
 
Methods inherited from class leon.control.form.LyFieldController
clearViewCache, getAction, getAreaController, getBehavior, getClassInfo, getComponent, getDefaultFieldUnit, getDefaultFieldUnit, getEnvironment, getFieldController, getFieldInfo, getFormController, getFormField, getFormField, getImage, getInfoLabel, getInfoLabel, getLabel, getObject, getState, getViewController, hasMark, 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, 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

LyStructFieldSetController

public LyStructFieldSetController(LySetController parent,
                                  LyStructFieldInfo fieldInfo)
Constructor.

Parameters:
parent - parent controller
fieldInfo - the struct fieldInfo handled by this controller
Method Detail

free

public void free()
Free this controller.

Overrides:
free in class LyFieldController

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.

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.

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.

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

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.

isCreation

public boolean isCreation()
Indicate if thie field is in creation or modification mode of the struct object (use by array of structs).

Overrides:
isCreation in class LyFieldSetController
Returns:
creation mode if true

setCreation

public void setCreation(boolean status)
Indicate if thie field is in creation or modification mode of the struct object (use by array of structs).

Parameters:
status - new creation status

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

cancel

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

Overrides:
cancel in class LyFieldSetController

objectCreated

public boolean objectCreated(LyDataSourceEvent event)
Method for receiving an object creation.

Specified by:
objectCreated in interface LyDataSourceListener
Parameters:
event - Event notifying the creation of an object.
Returns:
True indicating if the event was used, false otherwise.

objectModified

public boolean objectModified(LyDataSourceEvent event)
Method for receiving an object modification. Implemented to update value on object set notification.

Specified by:
objectModified in interface LyDataSourceListener
Parameters:
event - Event notifying the modification of an object.
Returns:
True indicating if the event was used, false otherwise.

objectDeleted

public boolean objectDeleted(LyDataSourceEvent event)
Method for receiving an object deletion.

Specified by:
objectDeleted in interface LyDataSourceListener
Parameters:
event - Event notifying the deletion of an object.
Returns:
True indicating if the event was used, false otherwise.

getObject

public LyObject getObject(boolean create)
Get the associated object

Parameters:
create - true to force creation of object
Returns:
the object

(c) January 2013 - W4 S.A.

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