LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.control.form
Class LyRelationTableController

java.lang.Object
  extended by leon.control.LyController
      extended by leon.control.LyAreaController
          extended by leon.control.LyPanelController
              extended by leon.control.LySimpleTableController
                  extended by leon.control.LyTableController
                      extended by leon.control.LyMultiPageTableController
                          extended by leon.control.LyEditTableController
                              extended by leon.control.form.LyRelationTableController
All Implemented Interfaces:
java.lang.Runnable, LyGetSessionInterface, LyContextInterface, LyControllerContextInterface, LyFastFilterEndInterface, LyFilterEndInterface, LyFindInterface, LyFormInterface, LyFormResultInterface, LyGetActionInterface, LySelectFileListenerInterface, LySortEndInterface, LyAdvancedWorkSpaceListener, LyGuiListener, LyWorkSpaceListener, LyGetClassInfoInterface, LyInfoListener, LyEvaluator, LyDemandListener, LyPrintListenerInterface, LyAnswerInterface, LyQuestionAnswerInterface, LySetPrintModeInterface

public class LyRelationTableController
extends LyEditTableController
implements LyFormInterface, LyFormResultInterface, LyControllerContextInterface

The function of this controller is to manage consultation and set of a relation of type COMPOSITION. This controller is always included in a form controller. The consultation and setting is done in a table.

See Also:
LyRelationFieldInfo, LyMultiCompositionFieldConsultController, LyMultiCompositionFieldSetController

Field Summary
static java.lang.String __VERSION
          File version
static java.lang.String DEMAND_MOVE_DOWN
          Demand id : Move selection down.
static java.lang.String DEMAND_MOVE_UP
          Demand id : Move selection up.
 
Fields inherited from class leon.control.LyEditTableController
DEMAND_ALT_ADD, DEMAND_ALT_DOWN, DEMAND_ALT_LEFT, DEMAND_ALT_RIGHT, DEMAND_ALT_UP, DEMAND_CANCEL_ROW, DEMAND_COPY_CELLS, DEMAND_PASTE_CELLS, DEMAND_RESTORE, DEMAND_VALIDATE_ROW, MAX_COLUMN_WIDTH, TOOLBAR_FOR_UNCHANGED_OBJECTS
 
Fields inherited from class leon.control.LyMultiPageTableController
IMPACT_OUTSIDE_OF_CURRENT_VIEW, SELECT_PAGE
 
Fields inherited from class leon.control.LyTableController
MAX_OBJECTS_COUNT_FOR_CONTEXT_FILTER
 
Fields inherited from class leon.control.LySimpleTableController
DEMAND_CHOOSE_COLUMNS, DEMAND_COPY_CELL_CONTENT, DEMAND_FIX_COLUMN, DEMAND_GROUP_BY, DEMAND_INVERT_STATUS_SORT, DEMAND_LIST_DISPLAY, DEMAND_NEXT_PAGE, DEMAND_PREVIOUS_PAGE, DEMAND_PRINT_TABLE, DEMAND_REVERSE, DEMAND_ROW_TOOL, DEMAND_SORT_BY, DEMAND_SORT_DEFAULT, DEMAND_SORT_EXTEND, DEMAND_SORT_REVERSE, DEMAND_SORT_WIZARD, DEMAND_STATUS_SORT, DEMAND_SUB_TOOL_ACTION, DEMAND_UNFIX_COLUMN, EMPTY_CELL, FOOTER_ROW_PREFIX, MESSAGE_OBJECTS_COUNT, SECTION_ROW_PREFIX
 
Fields inherited from class leon.control.LyPanelController
DEMAND_DEFAULT_FOR_MOBILE_PREFERENCE, DEMAND_DEFAULT_PREFERENCE, DEMAND_PREFERENCE_TARGET, DEMAND_SAVE_PREFERENCE, DEMAND_SELECT_ALL, DEMAND_SHARED_PREFERENCE, DEMAND_UNSELECT_ALL, EXTEND_SIMPLE_FILTER, EXTENDED_FILTER_NEW, FAST_FILTER, FILTER_ACTIVE, FILTER_SET, PREFERENCE_TARGET_ACTION, PREFERENCE_TARGET_CLASS, SIMPLE_FILTER_NEW
 
Fields inherited from class leon.control.LyAreaController
DEFAULT_MENU_ITEM_IMAGE_SIZE, DEMAND_APPLY, DEMAND_CANCEL, DEMAND_CLOSE, DEMAND_CREATE_CHART, DEMAND_DELETE_CHART, DEMAND_DELETE_OBJECTINFOS, DEMAND_DELETE_PREFERENCE, DEMAND_UPDATE_VIEW, DEMAND_VALIDATE
 
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
 
Method Summary
 void actionDemand(LyActionDemand demand)
          Internal use.
 void cancel()
          Internal use.
 boolean canChange(LyFieldInfo fieldInfo)
          Check if the fieldInfo can be edited
 boolean checkIfModified()
          Check if modified.
 void commit()
          Internal use.
 short control()
          Controls current edition.
 void dragDropDemand(LyDragDropDemand demand)
          Invoked when a Drag & Drop occurs.
 short endValidate()
          Internal use.
 void free(LyController controller)
          Free this controller.
 LyArrayFieldInfo getArray()
          Retunrs array controlled by this controller.
 LyContext getControllerContext()
          Gets the controller context.
 LyEnvironment getEnvironment()
          Accessor to the current Environment instance This method returns the environment of the current Action or, if the previous one is null, the parent form environment.
 LyValue getFieldValue(LyFieldInfo fieldInfo)
          Extract current value for the specified fieldInfo in the form.
 LyObjectList getNewObjects()
          Return the list of newly created objects.
 LyObjectList getOldObjects()
          Return the list of deleted objects.
 LyRelationFieldInfo getRelation()
          Retunrs relation controlled by this controller.
 LyObjectList getSelection()
          Gets selected objects.
 LyViewController getViewController()
          Overriden to always return parent view controller.
 boolean isConsult()
          Is this table in a form consult or not.
 boolean isIdle()
          Check idle status of the field controller.
 boolean isOrdered()
          Checks if this controller manages an ordered relation or not.
 void notifyFormResult(LyObject object, LyRelationFieldInfo relationField)
          Internal use.
 boolean objectAdded(LyWorkSpaceEvent event)
          Called when an object is added in the dynamic object list.
 boolean objectChanged(LyWorkSpaceEvent event)
          Called when an object is modified in the dynamic object list.
 boolean objectRemoved(LyWorkSpaceEvent event)
          Called when an object is removed from the dynamic object list.
 void reset(boolean full)
          Reset all the content of the view.
 boolean setContext(LyWorkSpace context)
          Set the current context for the controller.
 LyEditTableSetController setControllerFactory(LyObject object)
          Utility method (factory) to create setControllers related to objects being modified This method is overriden to mark the controller as local.
 void setLastModified(long time)
          Accessor to set the last modification date of this controller.
 void showError(LyObject object, LyError error)
          Show an error for the specified object.
 short startValidate()
          Internal use.
 boolean workSpaceEventsGrouped(java.util.ArrayList<LyWorkSpaceEvent> events)
          Called when grouped events are sent.
 
Methods inherited from class leon.control.LyEditTableController
buildRow, canBeEditable, clearViewCache, enableShowMessage, enableShowMessage, getContent, getDisplayListDataIndex, getFieldInfoDisplayList, getInternalCreateController, getModificationsColor, getSetController, getSetFieldMarks, getStatusAction, hasViewLimit, isAutoCommit, isDynamicEditionMode, isEditable, isEditable, isEnabled, loadPage, selectionDemand, setEditable, setEnabled, setFields, setFixedColumnWidth, setPage, setSetFieldMarks, startCellEdition, startCellEdition, updateRowObject, useEditTable, validate, validateChanges
 
Methods inherited from class leon.control.LyMultiPageTableController
getLastPage, getPage, isDisplayNextPreviousTools, isDisplayPagesNumber, isPaginated, selectRow, setClassFilter, setPrintMode, setSort
 
Methods inherited from class leon.control.LyTableController
completeMessages, print, selectObject, selectObjects
 
Methods inherited from class leon.control.LySimpleTableController
allowSortOnField, clearTranslatedStringMap, enablesMultiSelection, endFastFilter, endSort, findObject, fixColumn, getBehaviorInterface, getClassFilter, getClassInfo, getColsNumberListDisplay, getColumnSize, getComplexFields, getFastFilterFieldInfo, getFastFilterValue, getFieldMarks, getFields, getLimit, getPanelComponent, getRealFields, getSelection, getSort, getStatusFieldInfos, getTableComponent, getTableComponentFields, getTableComponentFields, hasDisplayListToggleButton, hasPrintMode, isDisplayList, isDisplayListShowFields, isFastFilterExtended, isFastFilterSet, isFopMode, isImageColumn, isStatusColumn, menuDemand, objectStateChanged, printList, questionAnswer, run, selectAllObjects, selectObject, setFieldMarks, setFopMode, setPreference, showObject, translate
 
Methods inherited from class leon.control.LyPanelController
buildFilter, closeBorderPanel, endFilter, getFilter, getFilterController, getFilterEditorController, getPreference, getRefreshTime, isFilterActive, isHorizontal, objectUserEvent, setFilter, setIdle, setRefreshTime, updatePreferencesMenu
 
Methods inherited from class leon.control.LyAreaController
canClose, canFree, completeMenuBar, free, getAction, getAreaStackController, getBehavior, getBuilder, getContext, getContextClient, getContextTitle, getDefaultAction, getFastEditionAction, getHelpFile, getImage, getImageTooltip, getInfoLabel, getInfoLabel, getKeyValue, getLabel, getLastModified, getMenuItemImage, getName, getParameter, getParameter, getParameterMarks, getParent, getParent, getParentAreaController, getShortLabel, getTarget, getTitle, getViewController, hasMark, hasNotMark, hasViewController, hideView, infoEvent, initialize, isInitialized, isOutlined, isViewResizable, reset, selectFileDemand, setContext, setContextClient, setViewController, showView, showView, testParameter, toString, update, updateTitleBar
 
Methods inherited from class leon.control.LyController
activateViewDemand, demandPerformed, getApplication, getClassInfo, getComponent, getId, getImage, getImage, getImage, getImage, getImageFromPrefix, getImageFromPrefix, getImageFromPrefix, getName, getObjectId, getSession, getUserData, getView, getViewManager, helpDemand, hideView, isFreed, setBuilder, setBuilderClass, setName, setUserData, showError, showWarning, updateViewFromValues
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface leon.control.LyFormInterface
setEditable, setEnabled
 
Methods inherited from interface leon.control.LyContextInterface
getContext
 
Methods inherited from interface leon.data.LyAdvancedWorkSpaceListener
objectUserEvent
 
Methods inherited from interface leon.control.LyFilterEndInterface
endFilter, getFilter
 
Methods inherited from interface leon.control.LyFastFilterEndInterface
getFilter
 

Field Detail

__VERSION

public static final java.lang.String __VERSION
File version

See Also:
Constant Field Values

DEMAND_MOVE_UP

public static final java.lang.String DEMAND_MOVE_UP
Demand id : Move selection up.


DEMAND_MOVE_DOWN

public static final java.lang.String DEMAND_MOVE_DOWN
Demand id : Move selection down.

Method Detail

setLastModified

public void setLastModified(long time)
Accessor to set the last modification date of this controller. The modification date is updated when anything in the view has changed. The value should be (new Date()).getTime()

Overrides:
setLastModified in class LyMultiPageTableController
Parameters:
time - the new modificaion time

free

public void free(LyController controller)
Free this controller.

Overrides:
free in class LyEditTableController
Parameters:
controller - parent controller
See Also:
LyAreaController.free()

getRelation

public final LyRelationFieldInfo getRelation()
Retunrs relation controlled by this controller.

Returns:
the relation field

getArray

public final LyArrayFieldInfo getArray()
Retunrs array controlled by this controller.

Returns:
the array field

isOrdered

public final boolean isOrdered()
Checks if this controller manages an ordered relation or not.

Returns:
True if the controlled relation is ordered, false otherwise.

setControllerFactory

public LyEditTableSetController setControllerFactory(LyObject object)
Utility method (factory) to create setControllers related to objects being modified This method is overriden to mark the controller as local.

Overrides:
setControllerFactory in class LyEditTableController
Parameters:
object - current object being modified
Returns:
current setController. If no set controller is currently related, a new one is created.

getViewController

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

Overrides:
getViewController in class LyAreaController
Returns:
the parent view controller

getEnvironment

public LyEnvironment getEnvironment()
Accessor to the current Environment instance This method returns the environment of the current Action or, if the previous one is null, the parent form environment.

Overrides:
getEnvironment in class LyAreaController
Returns:
current environment instance.

getNewObjects

public LyObjectList getNewObjects()
Return the list of newly created objects.

Returns:
the list of newly created objects

getOldObjects

public LyObjectList getOldObjects()
Return the list of deleted objects.

Returns:
the list of deleted objects

notifyFormResult

public void notifyFormResult(LyObject object,
                             LyRelationFieldInfo relationField)
Internal use. Method called when an object is created in the table. 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.
relationField - the relation (null in this case)

startValidate

public short startValidate()
Internal use. Called when the parent form is starting validation.

Specified by:
startValidate in interface LyFormInterface
Overrides:
startValidate in class LyEditTableController
Returns:
the status of start validate
See Also:
LyFormInterface

endValidate

public short endValidate()
Internal use. Called when the parent form is ending validation.

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

commit

public void commit()
Internal use. Called when modifications are committed.

Specified by:
commit in interface LyFormInterface

cancel

public void cancel()
Internal use. Called when the parent form is cancelled.

Specified by:
cancel in interface LyFormInterface

checkIfModified

public boolean checkIfModified()
Check if modified.

Specified by:
checkIfModified in interface LyFormInterface
Returns:
true if field was modified

getFieldValue

public LyValue getFieldValue(LyFieldInfo fieldInfo)
Extract current value for the specified fieldInfo in the form.

Specified by:
getFieldValue in interface LyFormInterface
Parameters:
fieldInfo - fieldInfo associated to the requested value
Returns:
current value, or null if not found or field is disabled.

setContext

public boolean setContext(LyWorkSpace context)
Set the current context for the controller. If the context is unchanged, this method just call reset(). If there is a new context, this method free the current one and set the new one.

Specified by:
setContext in interface LyContextInterface
Overrides:
setContext in class LyEditTableController
Parameters:
context - Current context, or null if no context is set for the view
Returns:
True if controlled view was resetted, false otherwise.
See Also:
LyContextInterface.getContext()

reset

public void reset(boolean full)
Reset all the content of the view. This method may be called several times.

Overrides:
reset in class LyEditTableController
Parameters:
full - Boolean indicating if a full reset (including reset of datas) is requiered or not (only reset graphical area).

actionDemand

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

Overrides:
actionDemand in class LyEditTableController
Parameters:
demand - Action event created from the view.
See Also:
LyController.demandPerformed(leon.view.event.LyDemand)

getSelection

public LyObjectList getSelection()
Gets selected objects. Highlighted in the table.

Overrides:
getSelection in class LySimpleTableController
Returns:
the selection

objectAdded

public boolean objectAdded(LyWorkSpaceEvent event)
Called when an object is added in the dynamic object list.

Specified by:
objectAdded in interface LyWorkSpaceListener
Overrides:
objectAdded in class LyEditTableController
Parameters:
event - LyWorkSpace event
Returns:
true if event is handled
See Also:
LyWorkSpaceListener.objectAdded(leon.data.LyWorkSpaceEvent)

objectChanged

public boolean objectChanged(LyWorkSpaceEvent event)
Called when an object is modified in the dynamic object list.

Specified by:
objectChanged in interface LyWorkSpaceListener
Overrides:
objectChanged in class LySimpleTableController
Parameters:
event - LyWorkSpace event
Returns:
true if event is handled
See Also:
LyWorkSpaceListener.objectAdded(leon.data.LyWorkSpaceEvent)

objectRemoved

public boolean objectRemoved(LyWorkSpaceEvent event)
Called when an object is removed from the dynamic object list.

Specified by:
objectRemoved in interface LyWorkSpaceListener
Overrides:
objectRemoved in class LyEditTableController
Parameters:
event - LyWorkSpace event
Returns:
true if event is handled
See Also:
LyWorkSpaceListener.objectRemoved(leon.data.LyWorkSpaceEvent)

workSpaceEventsGrouped

public boolean workSpaceEventsGrouped(java.util.ArrayList<LyWorkSpaceEvent> events)
Called when grouped events are sent.

Specified by:
workSpaceEventsGrouped in interface LyAdvancedWorkSpaceListener
Overrides:
workSpaceEventsGrouped in class LyPanelController
Parameters:
events - Sorted list of events.
Returns:
True if the events are used by the listener, false otherwise.
See Also:
LyAdvancedWorkSpaceListener.workSpaceEventsGrouped(java.util.ArrayList)

getControllerContext

public LyContext getControllerContext()
Gets the controller context.

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

canChange

public boolean canChange(LyFieldInfo fieldInfo)
Check if the fieldInfo can be edited

Parameters:
fieldInfo - the fieldInfo
Returns:
true if modification is valid

control

public short control()
Controls current edition.

Specified by:
control in interface LyFormInterface
Returns:
The error status.

isIdle

public boolean isIdle()
Check idle status of the field controller.

Specified by:
isIdle in interface LyGuiListener
Overrides:
isIdle in class LyController
Returns:
boolean indicating if the idle mode is on or off.

isConsult

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

Returns:
true if in consult mode

dragDropDemand

public void dragDropDemand(LyDragDropDemand demand)
Invoked when a Drag & Drop occurs. (LyDemandListener interface) This method handles: opening and closing line, moving an interval, action

Overrides:
dragDropDemand in class LySimpleTableController
Parameters:
demand - drag-drop demand

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 LyEditTableController
Parameters:
object - The object in error
error - The error o show
See Also:
LyController.showError(String)

(c) January 2013 - W4 S.A.

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