LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.control
Class LyEditTableSetController

java.lang.Object
  extended by leon.control.LyController
      extended by leon.control.LyAreaController
          extended by leon.control.LyMultiAreaController
              extended by leon.control.LyFormController
                  extended by leon.control.LyConsultController
                      extended by leon.control.LySetController
                          extended by leon.control.LyEditTableSetController
All Implemented Interfaces:
LyGetSessionInterface, LyContextInterface, LyControllerContextInterface, LyFormInterface, LyFormResultInterface, LyGetActionInterface, LySelectFileListenerInterface, LyTransverseInterface, LyAdvancedWorkSpaceListener, LyContextListener, LyGuiListener, LyWorkSpaceListener, LyGetClassInfoInterface, LyInfoListener, LyEvaluator, LyDemandListener, LySubmitTab, LyAnswerInterface, LyQuestionAnswerInterface

public class LyEditTableSetController
extends LySetController

This class implements a set controller used by the LyEditTableController This class is for internal use only.

See Also:
LyEditTableController

Field Summary
static java.lang.String __VERSION
          File Version
 
Fields inherited from class leon.control.LySetController
_valueChange
 
Fields inherited from class leon.control.LyFormController
DEMAND_APPLY, DEMAND_NEXT_OBJECT, DEMAND_NEXT_STEP, DEMAND_PREVIOUS_OBJECT, DEMAND_PREVIOUS_STEP, DEMAND_SAVE, DEMAND_SELECTION, DEMAND_VALIDATE, FORM_FIELD_SEP
 
Fields inherited from class leon.control.LyAreaController
DEFAULT_MENU_ITEM_IMAGE_SIZE, DEMAND_CANCEL, DEMAND_CLOSE, DEMAND_CREATE_CHART, DEMAND_DELETE_CHART, DEMAND_DELETE_OBJECTINFOS, DEMAND_DELETE_PREFERENCE, DEMAND_UPDATE_VIEW
 
Fields inherited from class leon.control.LyController
_nbControllers, _nextId, CONTROLLER_ID_SEP, DEFAULT_IMAGE_FORMAT, DEMAND_HELP, ID_SEP
 
Fields inherited from interface leon.control.LyFormInterface
STATUS_CANCEL, STATUS_IGNORE, STATUS_KO, STATUS_OK
 
Constructor Summary
LyEditTableSetController(LySession session, LyController parent, LyAction action, LyClassInfo classInfo, LyObjectList objects)
          Constructor.
 
Method Summary
 void actionDemand(LyActionDemand demand)
          Invoked when an action occurs.
 void cancel(boolean update)
          Cancel changes.
 boolean checkIfModified()
          Check if the form content has been modified and if the object need to be created.
 void clearViewCache()
          Clears all cached data for this controller (especially the view and the component).
 LyObject createObject()
           
 short endValidate()
          Validate changes.
 LyFieldController fieldControllerFactory(LyFieldInfo fieldInfo, boolean forceConsult)
          Factory for constructing the field controller of a field info.
 void free()
          Free this controller.
 void free(LyController controller)
          Free this controller on request of the specified controller.
 LyInfoList<LyFieldInfo> getChangedFields()
          Indicates which fields have been changed in this controller.
 LyContext getControllerContext()
          Gets the controller context.
 LyValue getFieldValue(LyFieldInfo fieldInfo)
          Overridden to retrieve values for fields that are not displayed in the edit table.
 LyFormField getFormField(LyFieldInfo fieldInfo)
          Accessor to the formField corresponding to the given fieldInfo.
 LyValueSet getHiddenValues()
          Returns the list of values used for fields that are not displayed in the table.
 LyObject getModel()
          Get the model object
 short getState()
          Get state of this controller.
 LyViewController getViewController()
          Overriden to always return parent view controller.
 boolean isConsult()
          Is this table in a form consult or not.
 boolean isCreation()
          Returns a boolean indicating if the action is or not a creation.
 boolean isDisplayed(LyFieldInfo fieldInfo)
          Checks if the specified fieldInfo is currently being shown in the form.
 boolean isEnabled()
          Get boolean indicating if the controlled form is enabled or not.
 boolean isUpdating()
          Returns a boolean indicating if update is being performed.
 boolean isValid()
          Checks if this controller is valid : all changes are correct.
 boolean objectRemoved(LyWorkSpaceEvent event)
          Called when an object is removed from the dynamic object list.
 boolean setContext(LyWorkSpace context)
          Set current controller context.
 void setEditable(LyFieldInfo fieldInfo, boolean editable)
          Changes current field status to (non-)editable.
 void setEnabled(boolean enabled)
          Set boolean indicating if the controlled form is enabled or not.
 void setFieldValue(LyFieldInfo fieldInfo, LyValue newValue, boolean propagate)
          Overridden to register values for fields that are not displayed in the edit table.
 void setUpdating(boolean updating)
          Sets the _updating attribute.
 void showError(LyObject object, LyError error)
          Show an error for the specified object.
 void showError(java.lang.String message)
          Show a popup message error box with the specified message.
 void showWarning(java.lang.String message)
          Show a popup message warning box with the specified message.
 short startValidate()
          Start validating changes.
 void updateObject(LyValueSet oldValues)
          Called when current object has changed .
 short validate(boolean free)
          Overloaded to redirect the validation demand to the edit table controller.
 void valueChanged(LyFieldInfo fieldInfo)
          Internal method for control and propagate a value change.
 boolean wasChanged()
          Checks if something was changed.
 
Methods inherited from class leon.control.LySetController
addTempFilePath, apply, cancel, cancelChanges, canClose, canFree, clear, commit, computeFieldValue, contextEnded, control, execRule, getBehaviorInterface, getFields, getFormSave, getSetBehavior, getUnit, getValue, isApplied, isConsult, isEditable, isEditable, isEnabled, isHidden, isOptional, isValid, needUpdate, notifyFormResult, objectChanged, questionAnswer, reset, resetFieldInfoErrors, restore, save, setContextInternal, setEditable, setEnabled, setFastEditedField, setFieldValue, setFieldValue, setHidden, setLabel, setObject, setObjectInternal, setOptional, setRelationParent, setValid, subFormsCancel, subFormsCommit, update, update, updateValues, updateViewContent, updateViewFromValues
 
Methods inherited from class leon.control.LyConsultController
getConsultBehavior, menuDemand, setIdle, updateObjectFromCompositionRelation
 
Methods inherited from class leon.control.LyFormController
contains, findFormField, getAreaController, getClassInfo, getCompositionRelation, getContent, getDefaultFieldUnit, getEnvironment, getFieldController, getFieldMarks, getFieldValue, getImage, getImage, getKeyValue, getObject, getObjectList, getSelection, getState, getTabs, isChangingObject, isComposition, isViewResizable, objectAdded, objectStateChanged, objectUserEvent, reset, resetFormContent, resetFromObject, setActiveField, setCompositionRelation, setFieldMarks, setObjects, setState, workSpaceEventsGrouped
 
Methods inherited from class leon.control.LyMultiAreaController
addAreaController, addAreaControllerStack, getAreaController, getAreaController, getAreaControllersCount, getAreaControllerStack, getAreaControllerStackCount, getFinalAreaControllers, getLastModified, openSubAreaController, removeAreaController, removeAreaControllerStack, setAction, setContextClient, setViewController
 
Methods inherited from class leon.control.LyAreaController
completeMenuBar, completeMessages, getAction, getAreaStackController, getBehavior, getBuilder, getContext, getContextClient, getContextTitle, getDefaultAction, getFastEditionAction, getHelpFile, getImageTooltip, getInfoLabel, getInfoLabel, getLabel, getMenuItemImage, getName, getParameter, getParameter, getParameterMarks, getParent, getParent, getParentAreaController, getRefreshTime, getShortLabel, getTarget, getTitle, getViewController, hasMark, hasNotMark, hasViewController, hideView, infoEvent, initialize, isInitialized, isOutlined, reset, selectFileDemand, setContext, setPreference, showView, showView, testParameter, toString, updateTitleBar
 
Methods inherited from class leon.control.LyController
activateViewDemand, demandPerformed, dragDropDemand, getApplication, getClassInfo, getComponent, getId, getImage, getImage, getImage, getImageFromPrefix, getImageFromPrefix, getImageFromPrefix, getName, getObjectId, getSession, getUserData, getView, getViewManager, helpDemand, hideView, isFreed, isIdle, selectionDemand, setBuilder, setBuilderClass, setLastModified, setName, setUserData
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface leon.control.LyContextInterface
getContext
 

Field Detail

__VERSION

public static final java.lang.String __VERSION
File Version

See Also:
Constant Field Values
Constructor Detail

LyEditTableSetController

public LyEditTableSetController(LySession session,
                                LyController parent,
                                LyAction action,
                                LyClassInfo classInfo,
                                LyObjectList objects)
Constructor. Modification form for a list of objects. ClassInfo parameter is ignored, kept for compatibility and introspection capabilities.

Parameters:
session - current session associated to the controller. The controller automatically registers on the specified session.
parent - parent controller (or null for 'root' controller).
action - related action. If an action is specified, the controller uses action parameters (action name, action specific XML view description ...)
classInfo - this parameter is kept for introspection and compatibility. not used.
objects - list of objects currently being modified.
Method Detail

clearViewCache

public void clearViewCache()
Clears all cached data for this controller (especially the view and the component).

This method may be invoked for memory optimization, but the controller is still valid and may be used. (Unlike free) Further usage, needs to rebuild internal component & view which may be time consuming.

Overrides:
clearViewCache in class LySetController

createObject

public LyObject createObject()

getViewController

public LyViewController getViewController()
Overriden to always return parent view controller.

Overrides:
getViewController in class LyAreaController
Returns:
the view controller

fieldControllerFactory

public LyFieldController fieldControllerFactory(LyFieldInfo fieldInfo,
                                                boolean forceConsult)
Factory for constructing the field controller of a field info.

Overrides:
fieldControllerFactory in class LySetController
Parameters:
fieldInfo - Field info for which a controller is built.
forceConsult - indicates if the consult mode is forced for the field
Returns:
The field controller of the given field.

actionDemand

public void actionDemand(LyActionDemand demand)
Invoked when an action occurs.

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

getFormField

public LyFormField getFormField(LyFieldInfo fieldInfo)
Accessor to the formField corresponding to the given fieldInfo.

Overrides:
getFormField in class LyFormController
Parameters:
fieldInfo - the fieldInfo which is associated to the view component.
Returns:
the formField corresponding to the given fieldInfo

showWarning

public void showWarning(java.lang.String message)
Show a popup message warning box with the specified message. The message may be a text message, or the key to a String in the application disctionnary. (stringsXXX.properties files) This is a shortcut to getViewManager().showWarning()

Overrides:
showWarning in class LyController
Parameters:
message - the message to show
See Also:
LyViewManager, LyStrings

showError

public void showError(java.lang.String message)
Show a popup message error box with the specified message. The message may be a text message, or the key to a String in the application disctionnary. (stringsXXX.properties files) This is a shortcut to getViewManager().showError()

Overrides:
showError in class LySetController
Parameters:
message - the message to show
See Also:
LyViewManager, LyStrings

free

public void free()
Free this controller.

Overrides:
free in class LyAreaController
See Also:
LyAreaController.free(LyController)

free

public void free(LyController controller)
Free this controller on request of the specified controller.

Overrides:
free in class LySetController
Parameters:
controller - controller instance which requested the freeing of this controller. If the controller is the parent, this controller is freed otherwise the method does nothing.
See Also:
free()

startValidate

public short startValidate()
Start validating changes.

Specified by:
startValidate in interface LyFormInterface
Overrides:
startValidate in class LySetController
Returns:
the start validate status
See Also:
LyClassBehavior.addExtraValues(leon.control.LySetController, leon.data.LyValueSet), LyClassBehavior.controlNewValues(leon.control.LySetController, leon.data.LyValueSet), LyFormInterface

validate

public short validate(boolean free)
Overloaded to redirect the validation demand to the edit table controller.

Overrides:
validate in class LySetController
Parameters:
free - indicates if this controller must be freed at the end
Returns:
the validation status
See Also:
LyClassBehavior.addExtraValues(leon.control.LySetController, leon.data.LyValueSet), LyClassBehavior.controlNewValues(leon.control.LySetController, leon.data.LyValueSet), LyClassBehavior.endSet(leon.control.LySetController, leon.data.LyValueSet), LyFormInterface

endValidate

public short endValidate()
Validate changes.

Specified by:
endValidate in interface LyFormInterface
Overrides:
endValidate in class LySetController
Returns:
the end validate status
See Also:
LyFormInterface

cancel

public void cancel(boolean update)
Cancel changes.

Parameters:
update - indicates if an update must be performed

valueChanged

public void valueChanged(LyFieldInfo fieldInfo)
Internal method for control and propagate a value change.

Overrides:
valueChanged in class LySetController
Parameters:
fieldInfo - the fieldinfo
See Also:
LyClassBehavior.controlNewValue(leon.control.LySetController, leon.data.LyFieldInfoValue), LySetController.setValid(leon.info.LyFieldInfo, boolean)

wasChanged

public boolean wasChanged()
Checks if something was changed.

Returns:
true if something was changed

getChangedFields

public LyInfoList<LyFieldInfo> getChangedFields()
Indicates which fields have been changed in this controller.

Returns:
the list of fields that have been changed or an empty list if no field has been changed.

getState

public short getState()
Get state of this controller.

Overrides:
getState in class LySetController
Returns:
the state of this controller
See Also:
LyClassBehavior

isValid

public boolean isValid()
Checks if this controller is valid : all changes are correct.

Returns:
the valid status

isCreation

public boolean isCreation()
Returns a boolean indicating if the action is or not a creation.

Overrides:
isCreation in class LySetController
Returns:
the creation status

isConsult

public boolean isConsult()
Is this table in a form consult or not.

Returns:
the consult state

setEnabled

public void setEnabled(boolean enabled)
Set boolean indicating if the controlled form is enabled or not.

Specified by:
setEnabled in interface LyFormInterface
Overrides:
setEnabled in class LySetController
Parameters:
enabled - the enabled status

setEditable

public void setEditable(LyFieldInfo fieldInfo,
                        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 LySetController
Parameters:
fieldInfo - the field which should be marked editable
editable - new fieldInfo status. (default is true or obtained from the view description)

isEnabled

public boolean isEnabled()
Get boolean indicating if the controlled form is enabled or not.

Returns:
the enabled status

isDisplayed

public boolean isDisplayed(LyFieldInfo fieldInfo)
Checks if the specified fieldInfo is currently being shown in the form.

Overrides:
isDisplayed in class LySetController
Parameters:
fieldInfo - the fieldInfo we want to find
Returns:
true if the fieldInfo is present (modification/consultation), false otherwise.

setFieldValue

public void setFieldValue(LyFieldInfo fieldInfo,
                          LyValue newValue,
                          boolean propagate)
Overridden to register values for fields that are not displayed in the edit table.

Overrides:
setFieldValue in class LySetController
Parameters:
fieldInfo - the fieldinfo
newValue - the new value
propagate - indicates if we must propagate the changes
See Also:
LySetController.getFieldValue(leon.info.LyFieldInfo)

getFieldValue

public LyValue getFieldValue(LyFieldInfo fieldInfo)
Overridden to retrieve values for fields that are not displayed in the edit table.

Specified by:
getFieldValue in interface LyFormInterface
Overrides:
getFieldValue in class LySetController
Parameters:
fieldInfo - the fieldInfo
Returns:
the LyValue

getHiddenValues

public LyValueSet getHiddenValues()
Returns the list of values used for fields that are not displayed in the table.

Returns:
the value of the _hiddenValues attribute.

setContext

public boolean setContext(LyWorkSpace context)
Set current controller context.

Specified by:
setContext in interface LyContextInterface
Overrides:
setContext in class LyFormController
Parameters:
context - current context or null if none is specified
Returns:
true if successfull
See Also:
LyContextInterface.getContext()

getModel

public LyObject getModel()
Get the model object

Overrides:
getModel in class LySetController
Returns:
the model object

getControllerContext

public LyContext getControllerContext()
Gets the controller context.

Specified by:
getControllerContext in interface LyControllerContextInterface
Overrides:
getControllerContext in class LySetController
Returns:
The controller context.
See Also:
LyControllerContextInterface.getControllerContext()

updateObject

public void updateObject(LyValueSet oldValues)
Called when current object has changed . Keep the overall content consistent.

Overrides:
updateObject in class LySetController
Parameters:
oldValues - set of former values, or null if not specified.

showError

public void showError(LyObject object,
                      LyError error)
Show an error for the specified object. If object is null or if the resource LY_SHOWN_ERRORS_ON_OBJECTS is set to true, the error message is shown in a popup window else the specified error is added to the object.

Overrides:
showError in class LySetController
Parameters:
object - The object in error
error - The error o show
See Also:
showError(String)

checkIfModified

public boolean checkIfModified()
Check if the form content has been modified and if the object need to be created.

Specified by:
checkIfModified in interface LyFormInterface
Overrides:
checkIfModified in class LySetController
Returns:
the changed status

isUpdating

public boolean isUpdating()
Returns a boolean indicating if update is being performed.

Returns:
the updating status

setUpdating

public void setUpdating(boolean updating)
Sets the _updating attribute.

Parameters:
updating - the updating value

objectRemoved

public boolean objectRemoved(LyWorkSpaceEvent event)
Description copied from class: LyFormController
Called when an object is removed from the dynamic object list. Keep content consistent : go to next available object if any or close the view.

Specified by:
objectRemoved in interface LyWorkSpaceListener
Overrides:
objectRemoved in class LyFormController
Parameters:
event - event of removing object
Returns:
the event is used by the listener
See Also:
LyFormController.objectRemoved(leon.data.LyWorkSpaceEvent)

(c) January 2013 - W4 S.A.

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