LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.control
Class LyTabAreaController

java.lang.Object
  extended by leon.control.LyController
      extended by leon.control.LyAreaController
          extended by leon.control.LyMultiAreaController
              extended by leon.control.LyTabAreaController
All Implemented Interfaces:
LyGetSessionInterface, LyContextInterface, LyControllerContextInterface, LyGetActionInterface, LySelectFileListenerInterface, LyGuiListener, LyInfoListener, LyEvaluator, LyDemandListener, LyAnswerInterface, LyQuestionAnswerInterface

public class LyTabAreaController
extends LyMultiAreaController
implements LyControllerContextInterface, LyQuestionAnswerInterface

A tab area controller is associated to a tab action.

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

The tabAreaController provides the following services :


Field Summary
static java.lang.String __VERSION
          File Version
static java.lang.String DEMAND_NEXT
          Demand code : Next step.
static java.lang.String DEMAND_PREVIOUS
          Demand code : Previous step.
static java.lang.String DEMAND_TERMINATE
          Demand code : Terminate wizard process.
 
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
LyTabAreaController(LySession session, LyController parent, LyAction action, LyClassInfo classInfo, 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 addTabAction(LyAreaController areaController)
          Adds a new action to this tab action.
 void cancel()
          Method called when the form is cancelled.
 boolean canClose(boolean showMessage)
          Check if the area controller may be closed.
 void closeAction(LyAction action)
          Closes an action registered on the tab controller.
 void closeAll()
          Closes all tabs.
 void commit()
          Method called when all modifications are committed.
 void free(LyController controller)
          Free this controller.
 LyAreaController getAreaController(LyAction action, boolean searchHidden)
          Accessor to the sub-controllers with the specified action.
 java.lang.Class<?> getBehaviorInterface()
          Method that gives the interface that must be implemented by the behavior associated to this controller.
 LyClassInfo getClassInfo()
          Get controller class info if any.
 LyContext getControllerContext()
          Gets the controller context.
 java.lang.String getHelpFile()
          Gets help file associated with this controller.
 LyAreaController getSelectedAreaController()
          Get the selected LyAreaController
 int getSelectedTab()
          Get the index of the selected tab
 LyObjectList getSelection()
          Return list of selected objects This method is overriden depending on the nature of the controller.
 LyEnvironment getWizardFormEnvironment()
          Returns the specific environment used for wizard form.
 boolean isWizard()
          Checks if the managed action is a wizard action.
 void questionAnswer(boolean result, java.lang.Object clientData)
          Answer to a askQuestion request.
 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 reset(boolean full)
          Reset the entire view : everything is rebuilt.
 void selectAction(LyAction action)
          Selects an action registered on the tab 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.
 boolean update()
          This method is called by the view controller when this area is shown to update its content.
 void updateCommands()
          Updates command bar for wizard mode.
 
Methods inherited from class leon.control.LyMultiAreaController
addAreaControllerStack, clearViewCache, getAreaController, getAreaController, getAreaControllersCount, getAreaControllerStack, getAreaControllerStackCount, getFinalAreaControllers, getLastModified, isViewResizable, openSubAreaController, removeAreaControllerStack, setAction, setIdle, setViewController
 
Methods inherited from class leon.control.LyAreaController
canFree, completeMenuBar, completeMessages, free, getAction, getAreaStackController, getBehavior, getBuilder, getContent, getContext, getContextClient, getContextTitle, getDefaultAction, getEnvironment, getFastEditionAction, getImage, getImageTooltip, getInfoLabel, getInfoLabel, getKeyValue, getLabel, getMenuItemImage, getName, getParameter, getParameter, getParameterMarks, getParent, getParent, getParentAreaController, getRefreshTime, getShortLabel, getTarget, getTitle, getViewController, getViewController, hasMark, hasNotMark, hasViewController, hideView, infoEvent, initialize, isInitialized, isOutlined, menuDemand, 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

DEMAND_PREVIOUS

public static final java.lang.String DEMAND_PREVIOUS
Demand code : Previous step.


DEMAND_NEXT

public static final java.lang.String DEMAND_NEXT
Demand code : Next step.


DEMAND_TERMINATE

public static final java.lang.String DEMAND_TERMINATE
Demand code : Terminate wizard process.

Constructor Detail

LyTabAreaController

public LyTabAreaController(LySession session,
                           LyController parent,
                           LyAction action,
                           LyClassInfo classInfo,
                           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 LyTabAction. If an action is specified, the controller uses action parameters (action name, action specific XML view description ...)
classInfo - classInfo : useless in this controller, should be null. Kept for compatibility.
context - current context (may be null if the view is not contextual to a list of objects).
Method Detail

getClassInfo

public LyClassInfo getClassInfo()
Get controller class info if any. This method is overriden if it makes sense to return a classInfo for this controller. Default returns null.

Overrides:
getClassInfo in class LyAreaController
Returns:
a classinfo if any or null.

actionDemand

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

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

addTabAction

public void addTabAction(LyAreaController areaController)
Adds a new action to this tab action.

Parameters:
areaController - the area controller managing the action that must be added.

selectAction

public void selectAction(LyAction action)
Selects an action registered on the tab controller.
Selects the tab containing the view of the action.

Parameters:
action - the action that must be selected.

closeAll

public void closeAll()
Closes all tabs.


closeAction

public void closeAction(LyAction action)
Closes an action registered on the tab controller.
Removes the tab containing the view of the action.

Parameters:
action - the action that must be closed.

getSelectedTab

public int getSelectedTab()
Get the index of the selected tab

Returns:
index of the selected tab

getSelectedAreaController

public LyAreaController getSelectedAreaController()
Get the selected LyAreaController

Returns:
the selected LyAreaController

getHelpFile

public java.lang.String getHelpFile()
Gets help file associated with this controller.

Overrides:
getHelpFile in class LyAreaController
Returns:
the help file corresponding to the action. If no help file is associated to the tab action, retrieve the help file associated to selected action in this tab controller.

getWizardFormEnvironment

public LyEnvironment getWizardFormEnvironment()
Returns the specific environment used for wizard form. This method builds this specific environment if it was not already created.

Returns:
the _wizardFormEnvironment attribute.

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 overriden to take the internal sub-controller structure into account.

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

reset

public void reset(boolean full)
Reset the entire view : everything is rebuilt.

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

update

public boolean update()
This method is called by the view controller when this area is shown to update its content. Default implementation updates selected tab.

Overrides:
update in class LyMultiAreaController
Returns:
true if update was successfull

updateCommands

public void updateCommands()
Updates command bar for wizard mode.


getBehaviorInterface

public java.lang.Class<?> getBehaviorInterface()
Method that gives the interface that must be implemented by the behavior associated to this controller.

Overrides:
getBehaviorInterface in class LyAreaController
Returns:
Class representing the behavior interface of this controller.

getControllerContext

public LyContext getControllerContext()
Gets the controller context.

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

commit

public void commit()
Method called when all modifications are committed.


cancel

public void cancel()
Method called when the form is cancelled.


free

public void free(LyController controller)
Free this controller. Overrides method from LyMultiAreaController :
If a specific wizard environment has been created, it is freed.

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

getSelection

public LyObjectList getSelection()
Return list of selected objects This method is overriden depending on the nature of the controller. Default returns null

Overrides:
getSelection in class LyAreaController
Returns:
the list of selected objects or null if the selection is empty.

isWizard

public boolean isWizard()
Checks if the managed action is a wizard action.

Returns:
True if the controlled action is a wizard action, false otherwise.

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 LyMultiAreaController
Parameters:
showMessage - indicates if the controller can show an warning message or not
Returns:
return the status of sub-controllers

questionAnswer

public void questionAnswer(boolean result,
                           java.lang.Object clientData)
Answer to a askQuestion request. Current implementation proceed the setObject method after user confirmation that changes may be lost.

Specified by:
questionAnswer in interface LyQuestionAnswerInterface
Parameters:
result - true if the user has clicked on Yes or Ok
clientData - data specified in the askQuestion method
See Also:
LyQuestionAnswerInterface.questionAnswer(boolean, java.lang.Object)

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).

Overrides:
addAreaController in class LyMultiAreaController
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).

Overrides:
removeAreaController in class LyMultiAreaController
Parameters:
areaController - the new controller we want to remove.

getAreaController

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

Parameters:
action - specified action whose controller must be returned.
searchHidden - search also in hidden tabs (kept for LY_FREE_ON_CLOSE)
Returns:
the reference to the specified controller, or null if no controller was found for specified action.

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 LyMultiAreaController
Parameters:
context - current context or null if none is specified
Returns:
true if successfull
See Also:
LyContextInterface.setContext(leon.data.LyWorkSpace)

(c) January 2013 - W4 S.A.

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