|
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
leon.control.LyCreateController
public class LyCreateController
This class describes the controller associated to a creation form.
This class implements a 'read-write' LyFormController and specializes methods from its parent.
This form controller may have an object as a model (in that case the action is a creation ('clone') keeping some current values of the model. (Creation by copy).
Usually the creation form is not associated with any object but specified a LyClassInfo parameter : the object will be created in this application class.
Services supported by the LyCreateController :
LyClassBehavior
,
LyConsultController
,
LySetBuilder
,
LyCreateBuilder
,
LyCreateBehaviorInterface
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 | |
---|---|
LyCreateController(LySession session,
LyController parent,
LyAction action,
LyClassInfo classInfo,
LyObjectList objects)
Constructor. |
Method Summary | |
---|---|
boolean |
checkIfModified()
Check if the form content has been modified and if the object need to be created. |
void |
commit()
Method called when all modifications are committed. |
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 |
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. |
LyObject |
getLastCreatedObject()
Last Object (if any) that was created by this controller. |
LyObject |
getModel()
Accessor to the model for a clone operation. |
LyObjectList |
getObjectList()
Accessor to the list of objects associated with this form. |
LyController |
getParent()
Accessor to the reference to the parent controller. |
boolean |
isCreateIfModified()
The creation is requested only if at least one field has been modified. |
boolean |
isCreation()
Returns a boolean indicating if the action is or not a creation. |
boolean |
objectRemoved(LyWorkSpaceEvent event)
Called when an object is removed from the dynamic object list. |
void |
resetFieldInfoErrors(LyFieldInfo fieldInfo)
Reset fieldInfo errors on _object for fieldInfo. |
void |
resetFromObject(LyObject object,
boolean freeOldValue,
boolean createNewValue)
Sets the form content from the specified object : all field controllers and form fields take the specified value. |
boolean |
setContext(LyWorkSpace context)
Set current controller context. |
void |
setCreateIfModified(boolean b)
The creation is requested only if at least one field has been modified. |
boolean |
setObject(LyObject object)
Sets current model for the creation. |
void |
showError(LyObject object,
LyError error)
Show an error for the specified object. |
short |
startValidate()
Start validation of the form. |
void |
subFormsCommit()
Commit sub-forms. |
void |
updateObject(LyValueSet oldValues)
Called when current object has changed . |
short |
validate(boolean free)
The form is closing and we check the values typed in by the user. |
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 |
Field Detail |
---|
public static final java.lang.String __VERSION
Constructor Detail |
---|
public LyCreateController(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 not used (introspection mechanisms).objects
- model used as the base of the creation form. Only the first object in the
list is considered. (creation by copy)Method Detail |
---|
public java.lang.Class<?> getBehaviorInterface()
getBehaviorInterface
in class LySetController
public void free(LyController controller)
free
in class LySetController
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 LyController getParent()
getParent
in class LyAreaController
public boolean setObject(LyObject object)
Reset default values of the form.
setObject
in class LySetController
object
- new object being modified.
LySetController.questionAnswer(boolean, java.lang.Object)
public void updateObject(LyValueSet oldValues)
updateObject
in class LySetController
oldValues
- set of former values, or null if not specified.public short startValidate()
When closing the validate method is following these steps :
startValidate
in interface LyFormInterface
startValidate
in class LySetController
LyClassBehavior.addExtraValues(leon.control.LySetController, leon.data.LyValueSet)
,
LyClassBehavior.controlNewValues(leon.control.LySetController, leon.data.LyValueSet)
public short endValidate()
endValidate
in interface LyFormInterface
endValidate
in class LySetController
LyFormInterface
public boolean checkIfModified()
checkIfModified
in interface LyFormInterface
checkIfModified
in class LySetController
public void commit()
commit
in interface LyFormInterface
commit
in class LySetController
public void subFormsCommit()
subFormsCommit
in class LySetController
public boolean isCreation()
isCreation
in class LySetController
public LyObjectList getObjectList()
getObjectList
in class LyFormController
public boolean isCreateIfModified()
public void setCreateIfModified(boolean b)
b
- new statuspublic boolean setContext(LyWorkSpace context)
setContext
in interface LyContextInterface
setContext
in class LyFormController
context
- context or null if none is specified
LyContextInterface.getContext()
public LyObject getModel()
getModel
in class LySetController
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 :
validate
in class LySetController
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)
public boolean objectRemoved(LyWorkSpaceEvent event)
objectRemoved
in interface LyWorkSpaceListener
objectRemoved
in class LyFormController
event
- event of removing object
public void showError(LyObject object, LyError error)
showError
in class LySetController
object
- The object in errorerror
- The error to showLyController.showError(String)
public void resetFieldInfoErrors(LyFieldInfo fieldInfo)
resetFieldInfoErrors
in class LySetController
fieldInfo
- public short control()
control
in interface LyFormInterface
control
in class LySetController
public void contextEnded(LyContext context, LyContext brother)
contextEnded
in interface LyContextListener
contextEnded
in class LySetController
context
- Context ended.brother
- Brother context that ended the given context.public void resetFromObject(LyObject object, boolean freeOldValue, boolean createNewValue)
resetFromObject
in class LyFormController
object
- new object used to reset the view content. If the param is null, a
clone of the object is created.freeOldValue
- indicates if the old value should be freed (deleted) when it is an
objectcreateNewValue
- indicates if a new empty value should created when object is null and
when the value is an objectpublic LyObject getLastCreatedObject()
|
(c) January 2013 - W4 S.A. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |