|
LEONARDI Application Composer - 8.9.0.40 by W4 S.A. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectleon.control.LyController
leon.control.LyAreaController
leon.control.LyMultiAreaController
leon.control.LyFormController
leon.control.LyConsultController
leon.control.LySetController
public class LySetController
This class describes the controller associated to a modification form.
This class implements a 'read-write' LyFormController and specializes methods from its parent.
This form controller is associated to an object or a list of objects, however this is not mandatory. The LySetController is also inherited by LyCreateController which may not have any object.
The LySetController is associated to a LySetBuilder class which sets the content and the overall structure of the view.
This class uses a LyClassBehavior instance which may implement specific application logic, additional value validation, automatic field calculation, value filtering or dynamic impact on value changes...
Services supported by the LySetController :
LyClassBehavior
,
LySetBehaviorInterface
,
LySetBuilder
,
LyConsultController
,
LyCreateController
Field Summary | |
---|---|
static java.lang.String |
__VERSION
File Version |
boolean |
_valueChange
Indicate if propagation is caused by a value change or not. |
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 | |
---|---|
LySetController(LySession session,
LyController parent,
LyAction action,
LyClassInfo classInfo,
LyObjectList objects)
Constructor. |
Method Summary | |
---|---|
void |
actionDemand(LyActionDemand demand)
Invoked when an action occurs. |
void |
addTempFilePath(java.lang.String path)
Add a file to the delete on free list |
short |
apply()
Apply form. |
void |
cancel()
Method called when the form is cancelled. |
void |
cancelChanges()
Cancel all changes done in the form. |
boolean |
canClose(boolean showMessage)
Check if the area controller may be freed. |
boolean |
canFree(boolean showMessage)
Check if the area controller may be freed. |
boolean |
checkIfModified()
Check if the form content has been modified and if the object need to be created. |
void |
clear(LyFieldInfo fieldInfo)
Clears specified fieldInfo value : setting value to null. |
void |
clearViewCache()
Clears all cached data for this controller (especially the view and the component). |
void |
commit()
Method called when all modifications are committed. |
LyValue |
computeFieldValue(LyFieldInfo fieldInfo)
Method to recompute the field value of a field. |
void |
contextEnded(LyContext context,
LyContext brother)
Method called when a context is ended by a brother context. |
short |
control()
Controls current edition. |
short |
endValidate()
End validation of the form : commit edition. |
void |
execRule(LyRule rule,
boolean checked)
Exec given rule inside this controller. |
LyFieldController |
fieldControllerFactory(LyFieldInfo fieldInfo,
boolean forceConsult)
Factory for constructing the field controller of a field info. |
void |
free(LyController controller)
Free this controller on request of the specified controller. |
java.lang.Class<?> |
getBehaviorInterface()
Method that gives the interface that must be implemented by the behavior associated to this controller. |
LyContext |
getControllerContext()
Gets the controller context. |
LyInfoList<LyFieldInfo> |
getFields()
Gets the list of fields being displayed in the form. |
LyValue |
getFieldValue(LyFieldInfo fieldInfo)
Extract current value for the specified fieldInfo in the form. |
LyFormSave |
getFormSave()
Gets form save associated to this set controller. |
LyObject |
getModel()
Get the model of the current form |
LySetBehaviorInterface |
getSetBehavior()
Accessor to controler behavior : shortcut to (LySetBehaviorInterface)getBehavior(). |
short |
getState()
Get the state of the set controller. |
LyUnit |
getUnit(LyFieldInfo fieldInfo)
Get current unit for the specified fieldInfo in the form. |
java.lang.Object |
getValue(LyFieldInfo fieldInfo)
Accessor to the internal value associated to a filedInfo. |
boolean |
isApplied()
This method may be used at the end of the action to know if the user pushed Apply or Validate button. |
boolean |
isConsult(LyFieldInfo fieldInfo)
Checks if the specified fieldInfo is currently being shown as a 'read-only' field in the form. |
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 |
isEditable()
Boolean indicating if the controlled form is editable or not. |
boolean |
isEditable(LyFieldInfo fieldInfo)
Accessor to the editable/ non editable status for a field in the form. |
boolean |
isEnabled(LyFieldInfo fieldInfo)
Accessor to the enabled/disabled status for a field in the form. |
boolean |
isHidden(LyFieldInfo fieldInfo)
Accessor to the hidden status of a field in the form. |
boolean |
isOptional(LyFieldInfo fieldInfo)
Accessor to the optional status for a field in the form. |
boolean |
isValid(LyFieldInfo fieldInfo)
Accessor to the valid status for a field in the form. |
boolean |
needUpdate()
Checks if this controller needs update. |
void |
notifyFormResult(LyObject object,
LyRelationFieldInfo relationField)
Internal use. |
boolean |
objectChanged(LyWorkSpaceEvent event)
Called when an object has changed in the dynamic object list. |
void |
questionAnswer(boolean result,
java.lang.Object clientData)
Answer to a askQuestion request. |
void |
reset(LyFieldInfo fieldInfo)
Resets specified fieldInfo value : the default value is fetched from the associated behavior. |
void |
resetFieldInfoErrors(LyFieldInfo fieldInfo)
Reset fieldInfo errors on _object for fieldInfo. |
boolean |
restore(LyFormSave formSave)
Restore form inputs. |
LyFormSave |
save(boolean full)
Save form inputs. |
void |
setContextInternal()
Sets composition relation : this method is invoked when this form manages a relation in another form. |
void |
setEditable(boolean editable)
Set boolean indicating if the controlled form is editable or not. |
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 |
setEnabled(LyFieldInfo fieldInfo,
boolean enabled)
Changes current field status to (non-)enabled. |
boolean |
setFastEditedField(LyFieldInfo fieldInfo)
Set the fast edited field info. |
void |
setFieldValue(LyFieldInfo fieldInfo,
LyValue newValue,
boolean propagate)
Sets the value of a fieldInfo. |
void |
setFieldValue(LyFieldInfo fieldInfo,
java.lang.Object value)
Sets the value of a fieldInfo Shortcut for setFieldValue(fieldInfo, value, true). |
void |
setFieldValue(LyFieldInfo fieldInfo,
java.lang.Object value,
boolean propagate)
Sets the value of a fieldInfo. |
void |
setHidden(LyFieldInfo fieldInfo,
boolean hidden)
Changes current field status to (non-)hidden. |
void |
setLabel(LyFieldInfo fieldInfo,
LyInfoLabel label,
boolean labelSet)
Changes the label for the specified fieldinfo. |
boolean |
setObject(LyObject object)
Sets current object being modified. |
void |
setObjectInternal(LyObject object)
Accessor to the _object parameter (with no control) Applications should use setObject(object) and not invoke this method directly. |
void |
setOptional(LyFieldInfo fieldInfo,
boolean optional)
Changes current field status to (non-)optional. |
void |
setRelationParent(LyFormResultInterface client,
LyRelationFieldInfo relation)
Sets relation parent : this method is invoked when this form is a child of another form (dynamic popup creation of an object in a relation field). |
void |
setValid(LyFieldInfo fieldInfo,
boolean valid)
Sets the valid status of a field in the form. |
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. |
short |
startValidate()
Start validation of the form. |
void |
subFormsCancel()
Cancel sub-forms. |
void |
subFormsCommit()
Commit sub-forms. |
boolean |
update()
This method is called by the view controller when this area is shown to update its content. |
void |
update(LyFieldInfo fieldInfo,
LyFieldInfo origin,
boolean propagate)
Utility method (internal use for behavior) to calculate formulas of fieldInfos. |
void |
updateObject(LyValueSet oldValues)
Called when current object has changed . |
void |
updateValues()
Update all values... |
void |
updateViewContent()
Check (when it makes sense) the graphical components to see if they have a pending value typed by the user, and not yet refreshed in the LyView components. |
void |
updateViewFromValues(LyDemand demand)
Update the view of the controller with the specified values from the demand (internal use) . |
short |
validate(boolean free)
The form is closing and we check the values typed in by the user. |
void |
valueChanged(LyFieldInfo fieldInfo)
Internal method for control and propagate a value change. |
Methods inherited from class leon.control.LyConsultController |
---|
getConsultBehavior, menuDemand, setIdle, updateObjectFromCompositionRelation |
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, showWarning |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface leon.control.LyContextInterface |
---|
getContext, setContext |
Field Detail |
---|
public static final java.lang.String __VERSION
public boolean _valueChange
Constructor Detail |
---|
public LySetController(LySession session, LyController parent, LyAction action, LyClassInfo classInfo, LyObjectList objects)
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 |
---|
public java.lang.Class<?> getBehaviorInterface()
getBehaviorInterface
in class LyFormController
public LyFieldController fieldControllerFactory(LyFieldInfo fieldInfo, boolean forceConsult)
fieldControllerFactory
in class LyConsultController
fieldInfo
- Field info for which a controller is built.forceConsult
- indicates if the given field is forced in consult mode
public void updateViewFromValues(LyDemand demand)
updateViewFromValues
in class LyController
demand
- demand parameters sent by the view component.public void actionDemand(LyActionDemand demand)
actionDemand
in class LyFormController
demand
- the action demandLyController.demandPerformed(leon.view.event.LyDemand)
public void setFieldValue(LyFieldInfo fieldInfo, LyValue newValue, boolean propagate)
fieldInfo
- the field which should be modifiednewValue
- the new value of the field. This value may be null to set the value to blank
(empty).propagate
- Indicates whether the change is notified (propagated) to other fields or
not. This is useless if you reset all fields for instance.getFieldValue(leon.info.LyFieldInfo)
public LyValue computeFieldValue(LyFieldInfo fieldInfo)
fieldInfo
- Field to compute.
public void setFieldValue(LyFieldInfo fieldInfo, java.lang.Object value)
fieldInfo
- the field which should be modifiedvalue
- the new value of the field. This value may be null (to set the value
to blank (empty)), a primitive object type (String, Integer...) or a
LyValuesetFieldValue(LyFieldInfo, Object, boolean)
public void setFieldValue(LyFieldInfo fieldInfo, java.lang.Object value, boolean propagate)
fieldInfo
- the field which should be modifiedvalue
- the new value of the field. This value may be null, a LyValue instance or
the internal value associated to the fieldInfo. See LyValue.getValue()propagate
- Indicates whether the change is notified (propagated) to other fields or
not. This is useless if you reset all fields for instance.getFieldValue(leon.info.LyFieldInfo)
,
LyValue.getValue()
public LyValue getFieldValue(LyFieldInfo fieldInfo)
getFieldValue
in interface LyFormInterface
getFieldValue
in class LyFormController
fieldInfo
- fieldInfo associated to the requested value
public void showError(LyObject object, LyError error)
showError
in class LyFormController
object
- The object in errorerror
- The error to showLyController.showError(String)
public void showError(java.lang.String message)
showError
in class LyController
message
- the message to showLyViewManager
,
LyStrings
public void updateObject(LyValueSet oldValues)
oldValues
- set of former values, or null if not specified.public void execRule(LyRule rule, boolean checked)
execRule
in class LyConsultController
rule
- Rule to apply.checked
- True if the rule is checked, false if unchecked.public void valueChanged(LyFieldInfo fieldInfo)
This validity is called for possible specific application implementation on the LyClassBehavior instance.
The LySetController additionaly impact the view using the setValid method.
fieldInfo
- fieldInfo which was modified by the user.LyClassBehavior.controlNewValue(leon.control.LySetController, leon.data.LyFieldInfoValue)
,
setValid(leon.info.LyFieldInfo, boolean)
public short apply()
public short validate(boolean free)
This method is using the LyClassBehavior (LySetBehaviorInterface) to complete and validate the form.
When closing the validate method is following these steps :
free
- indicates if the form is closed and freed after a successful validation.
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
public void subFormsCommit()
public void subFormsCancel()
public void updateValues()
public short startValidate()
When closing the validate method is following these steps :
startValidate
in interface LyFormInterface
LyClassBehavior.addExtraValues(leon.control.LySetController, leon.data.LyValueSet)
,
LyClassBehavior.controlNewValues(leon.control.LySetController, leon.data.LyValueSet)
,
LyFormInterface
public short endValidate()
endValidate
in interface LyFormInterface
LyFormInterface
public void commit()
commit
in interface LyFormInterface
public void cancel()
cancel
in interface LyFormInterface
public void notifyFormResult(LyObject object, LyRelationFieldInfo relationField)
notifyFormResult
in interface LyFormResultInterface
object
- newly created object. The new value of the relation fieldInfo.relationField
- the relationpublic LySetBehaviorInterface getSetBehavior()
LyAreaController.getBehavior()
public void setEditable(boolean editable)
setEditable
in interface LyFormInterface
editable
- new editable status.public void setEnabled(boolean enabled)
setEnabled
in interface LyFormInterface
enabled
- new enabled status.public boolean isEditable()
public boolean setFastEditedField(LyFieldInfo fieldInfo)
fieldInfo
- the field info that must be edited in fast edition mode.
public LyInfoList<LyFieldInfo> getFields()
getFields
in class LyFormController
LyFormController.getFields()
public java.lang.Object getValue(LyFieldInfo fieldInfo)
fieldInfo
- the fieldInfo
public boolean setObject(LyObject object)
If changes have been made, this method asks the user for confirmation that changes on former object will be lost.
The the method updates all fields for the new object.
object
- new object being modified.
questionAnswer(boolean, java.lang.Object)
public void questionAnswer(boolean result, java.lang.Object clientData)
questionAnswer
in interface LyQuestionAnswerInterface
result
- true if the user has clicked on Yes or OkclientData
- data specified in the askQuestion methodLyQuestionAnswerInterface.questionAnswer(boolean, java.lang.Object)
,
setObject(leon.data.LyObject)
public boolean isDisplayed(LyFieldInfo fieldInfo)
isDisplayed
in class LyFormController
fieldInfo
- the fieldInfo we want to find
public boolean isConsult(LyFieldInfo fieldInfo)
fieldInfo
- the fieldInfo we want to find
public boolean isCreation()
public boolean isApplied()
public void clear(LyFieldInfo fieldInfo)
fieldInfo
- fieldInfo which is being clearedpublic void reset(LyFieldInfo fieldInfo)
fieldInfo
- fieldInfo which is being restoredpublic void update(LyFieldInfo fieldInfo, LyFieldInfo origin, boolean propagate)
fieldInfo
- the field which was modifiedorigin
- the field that propagates the modificationpropagate
- Indicates whether the change is notified (propagated) to other fields or
not.setFieldValue(leon.info.LyFieldInfo, leon.data.LyValue, boolean)
public void setOptional(LyFieldInfo fieldInfo, boolean optional)
fieldInfo
- the field which should be marked optionaloptional
- new fieldInfo status. (default is from the view description)public boolean isOptional(LyFieldInfo fieldInfo)
fieldInfo
- the specified field
public void setEditable(LyFieldInfo fieldInfo, boolean editable)
fieldInfo
- the field which should be marked editableeditable
- new fieldInfo status. (default is true or obtained from the view
description)public boolean isEditable(LyFieldInfo fieldInfo)
fieldInfo
- the specified field
public void setEnabled(LyFieldInfo fieldInfo, boolean enabled)
fieldInfo
- the field which should be marked enabledenabled
- new fieldInfo status. (default is true or obtained from the view
description)public boolean isEnabled(LyFieldInfo fieldInfo)
fieldInfo
- the specified field
public void setHidden(LyFieldInfo fieldInfo, boolean hidden)
setHidden
in class LyConsultController
fieldInfo
- the field which should be set hiddenhidden
- new fieldInfo visibility. (default is true)public boolean isHidden(LyFieldInfo fieldInfo)
isHidden
in class LyConsultController
fieldInfo
- the specified field
public void setLabel(LyFieldInfo fieldInfo, LyInfoLabel label, boolean labelSet)
setLabel
in class LyConsultController
fieldInfo
- the fieldInfolabel
- the new labellabelSet
- indicates if the label apply to set formpublic void setValid(LyFieldInfo fieldInfo, boolean valid)
fieldInfo
- the specified fieldvalid
- current validity statuspublic boolean isValid(LyFieldInfo fieldInfo)
fieldInfo
- the specified field
public void clearViewCache()
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.
clearViewCache
in class LyFormController
public void free(LyController controller)
free
in class LyFormController
controller
- controller instance which requested the freeing of this controller. If the
controller is the parent, this controller is freed with all its
sub-controllers (relationControllers) otherwise the method does nothing.LyAreaController.free()
public boolean objectChanged(LyWorkSpaceEvent event)
objectChanged
in interface LyWorkSpaceListener
objectChanged
in class LyFormController
event
- event of changing object
public short getState()
public LyUnit getUnit(LyFieldInfo fieldInfo)
fieldInfo
- fieldInfo associated to the requested unit relation
public void resetFieldInfoErrors(LyFieldInfo fieldInfo)
fieldInfo
- public LyContext getControllerContext()
getControllerContext
in interface LyControllerContextInterface
getControllerContext
in class LyConsultController
LyControllerContextInterface.getControllerContext()
public LyObject getModel()
public void setContextInternal()
public short control()
control
in interface LyFormInterface
public void contextEnded(LyContext context, LyContext brother)
contextEnded
in interface LyContextListener
context
- Context ended.brother
- Brother context that ended the given context.public void updateViewContent()
public boolean canFree(boolean showMessage)
canFree
in class LyAreaController
showMessage
- indicates if the controller can show an warning message or not
public boolean canClose(boolean showMessage)
canClose
in class LyMultiAreaController
showMessage
- indicates if the controller can show an warning message or not
public boolean checkIfModified()
checkIfModified
in interface LyFormInterface
public void setRelationParent(LyFormResultInterface client, LyRelationFieldInfo relation)
setRelationParent
in interface LyTransverseInterface
client
- the client for the resulting operationrelation
- the relation fieldInfo which is updated as the result of the current action
(usually dynamic popup creation)public boolean needUpdate()
public boolean update()
update
in class LyMultiAreaController
public void setObjectInternal(LyObject object)
object
- new object being created.public void addTempFilePath(java.lang.String path)
path
- the file path to add to the delete listpublic LyFormSave save(boolean full)
public boolean restore(LyFormSave formSave)
public LyFormSave getFormSave()
public void cancelChanges()
|
(c) January 2013 - W4 S.A. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |