LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.control
Class LyMultiAreaController

java.lang.Object
  extended by leon.control.LyController
      extended by leon.control.LyAreaController
          extended by leon.control.LyMultiAreaController
All Implemented Interfaces:
LyGetSessionInterface, LyContextInterface, LyGetActionInterface, LySelectFileListenerInterface, LyGuiListener, LyInfoListener, LyEvaluator, LyDemandListener
Direct Known Subclasses:
LyCompoundAreaController, LyDashboardController, LyFilterEditorController, LyFormController, LyTabAreaController

public abstract class LyMultiAreaController
extends LyAreaController

A compound area controller is associated to a compound action.

This controller is a view which gather two views controllers (subcontrollers) in the same 'area'.

The compoundAreaController provides the following services :


Field Summary
static java.lang.String __VERSION
          File Version
 
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
 
Constructor Summary
LyMultiAreaController(LySession session, LyController parent, LyAction action, LyObjectList context)
          Constructor.
 
Method Summary
 void actionDemand(LyActionDemand demand)
          Invoked when an action occurs.
 void addAreaController(LyAreaController areaController)
          Append a new sub-controllers at the children list This method should not be used directly, use action description instead (LyMultiAction).
 void addAreaControllerStack(LyAreaController areaController)
          Append a new sub-controllers at the stack list.
 boolean canClose(boolean showMessage)
          Check if the area controller may be closed.
 void clearViewCache()
          Clears all cached data for this controller (especially the view and the component).
 void free(LyController controller)
          Free this controller.
 LyAreaController getAreaController(int index)
          Accessor to the sub-controllers at the specified index.
 LyAreaController getAreaController(LyAction action)
          Accessor to the sub-controllers with the specified action.
 int getAreaControllersCount()
          Accessor to the number of sub-controllers.
 LyAreaController getAreaControllerStack(int index)
          Accessor to the sub-controllers in the stack at the specified index.
 int getAreaControllerStackCount()
          Accessor to the number of sub-controllers in the stack.
 java.util.Vector<LyController> getFinalAreaControllers()
          Accessor to all the sub-controllers that are not instances of LyMultiAreaController.
 long getLastModified()
          Accessor to the last modification date of this controller.
 boolean isViewResizable()
          Indicates if the view for this compound controller is resizable.
 void openSubAreaController(LyAreaController areaController, boolean open)
          Opens a sub-area controller and updates the state of the view.
 void removeAreaController(LyAreaController areaController)
          Remove a sub-controllers at the children list This method should not be used directly, use action description instead (LyMultiAction).
 void removeAreaControllerStack(LyAreaController areaController)
          Remove a sub-controllers at the stack list.
 void setAction(LyAction action, boolean deleteOnClose)
          Change the main action for this controller.
 boolean setContext(LyWorkSpace context)
          Set current controller context.
 void setContextClient(LyAreaController controller)
          Accessor to set another area controller which will receive contextual notification when something occur on this area controller.
 void setIdle(boolean idle)
          Sets idle mode on this controller.
 void setViewController(LyViewController viewController)
          Accessor to the view controller of the area.
 boolean update()
          This method is called by the view controller when this area is shown to update its content.
 
Methods inherited from class leon.control.LyAreaController
canFree, completeMenuBar, completeMessages, free, getAction, getAreaStackController, getBehavior, getBehaviorInterface, getBuilder, getClassInfo, getContent, getContext, getContextClient, getContextTitle, getDefaultAction, getEnvironment, getFastEditionAction, getHelpFile, getImage, getImageTooltip, getInfoLabel, getInfoLabel, getKeyValue, getLabel, getMenuItemImage, getName, getParameter, getParameter, getParameterMarks, getParent, getParent, getParentAreaController, getRefreshTime, getSelection, getShortLabel, getTarget, getTitle, getViewController, getViewController, hasMark, hasNotMark, hasViewController, hideView, infoEvent, initialize, isInitialized, isOutlined, menuDemand, reset, 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, getImage, getImageFromPrefix, getImageFromPrefix, getImageFromPrefix, getName, getObjectId, getSession, getUserData, getView, getViewManager, helpDemand, hideView, isFreed, isIdle, selectionDemand, setBuilder, setBuilderClass, setLastModified, setName, setUserData, showError, showError, showWarning, updateViewFromValues
 
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

LyMultiAreaController

public LyMultiAreaController(LySession session,
                             LyController parent,
                             LyAction action,
                             LyObjectList context)
Constructor.

Parameters:
session - current session associated to the controller. The controller automatically registers on the specified session.
parent - parent controller (or null for 'root' controller). Controller hierarchy indicates a child controller (for example a dialog created from a main view)
action - related action. The action should be an instance of LyMultiAction. If an action is specified, the controller uses action parameters (action name, action specific XML view description ...)
context - current context (may be null if the view is not contextual to a list of objects).
Method Detail

setContext

public boolean setContext(LyWorkSpace context)
Set current controller context. This method set the context of the sub AreaController Two possibilities: One of the subareas is a context for the other one, so this method set its context. Both Areas are "equal" so the context is set for both.

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

setContextClient

public void setContextClient(LyAreaController controller)
Accessor to set another area controller which will receive contextual notification when something occur on this area controller.

Method is overrident to take the internal sub-controller structure into account.

Overrides:
setContextClient in class LyAreaController
Parameters:
controller - the contextual controller, or null if no client defined

actionDemand

public void actionDemand(LyActionDemand demand)
Invoked when an action occurs. At this level, the implementation manages

Overrides:
actionDemand in class LyAreaController
Parameters:
demand - demand parameters sent by the view component.
See Also:
LyController.demandPerformed(leon.view.event.LyDemand)

getAreaControllersCount

public int getAreaControllersCount()
Accessor to the number of sub-controllers.

Returns:
the number of sub-controllers, which should be 2 or 0 if still empty.

getAreaController

public LyAreaController getAreaController(int index)
Accessor to the sub-controllers at the specified index.

Parameters:
index - specified index, from >=0 and < getAreaControllersCount()
Returns:
the reference to the specified controller, or throws an exception if the index is invalid.

getAreaControllerStackCount

public int getAreaControllerStackCount()
Accessor to the number of sub-controllers in the stack.

Returns:
the number of sub-controllers in the stack.

getAreaControllerStack

public LyAreaController getAreaControllerStack(int index)
Accessor to the sub-controllers in the stack at the specified index.

Parameters:
index - specified index, from >=0 and < getAreaControllerStackCount()
Returns:
the reference to the specified controller, or throws an exception if the index is invalid.

getAreaController

public LyAreaController getAreaController(LyAction action)
Accessor to the sub-controllers with the specified action.

Parameters:
action - specified action whose controller must be returned.
Returns:
the reference to the specified controller, or null if no controller was found for specified action.

addAreaController

public void addAreaController(LyAreaController areaController)
Append a new sub-controllers at the children list This method should not be used directly, use action description instead (LyMultiAction).

Parameters:
areaController - the new controller we want to add.

removeAreaController

public void removeAreaController(LyAreaController areaController)
Remove a sub-controllers at the children list This method should not be used directly, use action description instead (LyMultiAction).

Parameters:
areaController - the new controller we want to remove.

addAreaControllerStack

public void addAreaControllerStack(LyAreaController areaController)
Append a new sub-controllers at the stack list.

Parameters:
areaController - the new controller we want to add in the stack.

removeAreaControllerStack

public void removeAreaControllerStack(LyAreaController areaController)
Remove a sub-controllers at the stack list.

Parameters:
areaController - the new controller we want to remove from the stack.

setViewController

public void setViewController(LyViewController viewController)
Accessor to the view controller of the area. The view controller is a Frame / dialog which contains this area. This method is reserved for internal use and should not be used by the application. Current implementation overrides generic method to set the parent value on sub-controllers.

Overrides:
setViewController in class LyAreaController
Parameters:
viewController - the controller which manages the parent frame / dialog

setAction

public void setAction(LyAction action,
                      boolean deleteOnClose)
Change the main action for this controller.
Default implementation does nothing.

Parameters:
action - New main action.
deleteOnClose - Delete controller when action is changed.

openSubAreaController

public void openSubAreaController(LyAreaController areaController,
                                  boolean open)
Opens a sub-area controller and updates the state of the view.
Depending on the LY_OPEN_DIALOGS_IN_SAME_VIEW, this method :

Parameters:
areaController - areaController opened from current form controller.
open - indicates whether areaController opened from current form controller is opening or closing.

free

public void free(LyController controller)
Free this controller. Current implementation overrides generic method to free sub-controllers recursively

Overrides:
free in class LyAreaController
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:
LyAreaController.free()

canClose

public boolean canClose(boolean showMessage)
Check if the area controller may be closed. This method recursively check canClose on sub-controllers.

Overrides:
canClose in class LyAreaController
Parameters:
showMessage - indicates if the controller can show an warning message or not
Returns:
return the status of sub-controllers

getLastModified

public long getLastModified()
Accessor to the last modification date of this controller. The modification date is the latest modification date on sub-controllers

Overrides:
getLastModified in class LyAreaController
Returns:
the last modification date of sub-controllers (as described in java.util.Date.getTime())

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 LyAreaController

isViewResizable

public boolean isViewResizable()
Indicates if the view for this compound controller is resizable. View is resizable if at least one sub-view is resizable.

Overrides:
isViewResizable in class LyAreaController
Returns:
true if the view is resizable, false otherwise.

getFinalAreaControllers

public java.util.Vector<LyController> getFinalAreaControllers()
Accessor to all the sub-controllers that are not instances of LyMultiAreaController.

Returns:
A vector that contains all the sub-controllers.

update

public boolean update()
This method is called by the view controller when this area is shown to update its content. Default implementation calls update on each sub-controller.

Overrides:
update in class LyAreaController
Returns:
true if successfull

setIdle

public void setIdle(boolean idle)
Sets idle mode on this controller. Default implementation calls setIdle on each sub-controller.

Overrides:
setIdle in class LyAreaController
Parameters:
idle - the idle status

(c) January 2013 - W4 S.A.

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