LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.control
Class LyDashboardController

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

public class LyDashboardController
extends LyMultiAreaController

This class implements a dashboard view, usually associated to a '_dashboard' action in the meta-model.

A Dashboard view is a 'toolbar' view which contains a set of other actions, or sub-dashboard views (popup dashboards).

The user may activate an action from the dashboard by a click on any button of this view. Further click on the same action may either re-open existing window or create a new one if former windows was freed :

See Also:
for additional information.

Additionally, the view supports image buttons, with or without labels and a small tooltip info on actions. Current implementation uses a LyDashboardBehaviorInterface (usually implemented by a LyDashboardBehavior) and uses a LyDashboardBuilder to create and set view content.

, LyDashboardBehavior, LyDashboardBehaviorInterface, LyDashboardBuilder

Field Summary
static java.lang.String __VERSION
          File version
static java.lang.String DEMAND_CLOSE_ALL
          Identifier for modifying filter.
static java.lang.String DEMAND_SEARCH
          Identifier for search tool.
static java.lang.String SEARCH_CLASS
          Identifier for search class.
static int SEARCH_LIMIT
          Search limit.
static java.lang.String SEARCH_VALUE
          Identifier for search value.
static java.lang.String TAB_ID_PREFIX
          Internal prefix for tab identifiers.
 
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
LyDashboardController(LySession session, LyController parent, LyAction action, LyClassInfo classInfo, LyObjectList objects)
          Constructor.
 
Method Summary
 void actionDemand(LyActionDemand demand)
          Invoked when an action occurs.
 void addViewController(java.lang.String id, LyViewController controller)
          Add a view controller to keep.
 void closeAllViews()
          Closes all the views displayed in the dashboard.
 void closeCurrentView(boolean closeTabs)
          Close view currently being displayed in the dashboard view (single view mode only).
 void free(LyController controller)
          Free this controller.
 LyInfoList<LyAction> getActions()
          Accessor to the list of actions shown in the view.
 java.lang.Class<?> getBehaviorInterface()
          Method that gives the interface that must be implemented by the behavior associated to this controller.
 LyAreaController getDisplayedAreaController()
          Accessor to the area controller displayed in the dashboard.
 java.lang.String getHelpFile()
          Gets help file associated with this controller.
 java.lang.String getImage()
          Gets image associated with this controller.
 LyInfoList<LyAction> getOpenedActions()
          Accessor to the list of actions opened in the dashboard.
 LyAction getSocialAction()
          Fetch the social action.
 LyArea getTargetArea(LyAction action)
          Gets the target area : the panel where the action will be shown.
 java.lang.String getTitle()
          Gets title associated with this controller.
 java.util.Hashtable<java.lang.String,LyViewController> getViewControllers()
          Return the list of view controllers opened from this controller.
 boolean isViewResizable()
          Indicates if the view for this dashboard controller is resizable.
 void reset(boolean full)
          Reset the entire view : everything is rebuilt.
 void selectionDemand(LySelectionDemand demand)
          Invoked when an selection notification is sent to this listener.
 void setAction(LyAction action)
          Change the main action for this controller.
 void setAction(LyAction action, boolean deleteOnClose)
          Change the main action for this controller.
 void setEnabled(LyAction action, boolean enable)
          Enables/Disables given objectInfo representation in the dashboard view.
 void setImage(LyAction action, java.lang.String image)
          Updates the action image representation in the controlled dashboard .
 void updateViewFromValues(LyDemand demand)
          Update the view of the controller with the specified values from the demand (internal use) .
 void updateWindowMenu()
          Updates the Window menu of the menu bar.
 boolean useSingleView()
          Indicates whether the actions opened from this dashboard must be opened in a new view or not.
 boolean useTabs()
          Indicates whether the actions opened from this dashboard must be opened in tabs.
 
Methods inherited from class leon.control.LyMultiAreaController
addAreaController, addAreaControllerStack, canClose, clearViewCache, getAreaController, getAreaController, getAreaControllersCount, getAreaControllerStack, getAreaControllerStackCount, getFinalAreaControllers, getLastModified, openSubAreaController, removeAreaController, removeAreaControllerStack, setContext, setContextClient, setIdle, setViewController, update
 
Methods inherited from class leon.control.LyAreaController
canFree, completeMenuBar, completeMessages, free, getAction, getAreaStackController, getBehavior, getBuilder, getClassInfo, getContent, getContext, getContextClient, getContextTitle, getDefaultAction, getEnvironment, getFastEditionAction, getImageTooltip, getInfoLabel, getInfoLabel, getKeyValue, getLabel, getMenuItemImage, getName, getParameter, getParameter, getParameterMarks, getParent, getParent, getParentAreaController, getRefreshTime, getSelection, getShortLabel, getTarget, 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, setBuilder, setBuilderClass, setLastModified, setName, setUserData, showError, showError, showWarning
 
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_CLOSE_ALL

public static final java.lang.String DEMAND_CLOSE_ALL
Identifier for modifying filter.


DEMAND_SEARCH

public static final java.lang.String DEMAND_SEARCH
Identifier for search tool.


TAB_ID_PREFIX

public static final java.lang.String TAB_ID_PREFIX
Internal prefix for tab identifiers.


SEARCH_CLASS

public static final java.lang.String SEARCH_CLASS
Identifier for search class.


SEARCH_VALUE

public static final java.lang.String SEARCH_VALUE
Identifier for search value.


SEARCH_LIMIT

public static int SEARCH_LIMIT
Search limit.

Constructor Detail

LyDashboardController

public LyDashboardController(LySession session,
                             LyController parent,
                             LyAction action,
                             LyClassInfo classInfo,
                             LyObjectList objects)
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. If an action is specified, the controller uses action parameters (action name, action specific XML view description ...)
classInfo - the associated classInfo
objects - This parameter is kept for compatibility and introspection (unused).
Method Detail

free

public void free(LyController controller)
Free this controller.

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

getTitle

public java.lang.String getTitle()
Gets title associated with this controller.

Overrides:
getTitle in class LyAreaController
Returns:
the title corresponding to the action.

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

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.

actionDemand

public void actionDemand(LyActionDemand demand)
Invoked when an action occurs. At this level, the implementation manages user interaction on tree nodes and actions buttons.

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

selectionDemand

public void selectionDemand(LySelectionDemand demand)
Invoked when an selection notification is sent to this listener.

This method is called by demandPerformed and may be overriden in subclasses.

Overrides:
selectionDemand in class LyController
Parameters:
demand - demand parameters sent by the view component.
See Also:
LyController.selectionDemand(leon.view.event.LySelectionDemand)

getTargetArea

public LyArea getTargetArea(LyAction action)
Gets the target area : the panel where the action will be shown.

Parameters:
action - Action that will be displayed in the target area.
Returns:
the target area for the given action.

setAction

public void setAction(LyAction action)
Change the main action for this controller.
Updates the action displayed in the dashboard view.

Parameters:
action - New main action.

setAction

public void setAction(LyAction action,
                      boolean deleteOnClose)
Change the main action for this controller.
Updates the action displayed in the dashboard view.

Overrides:
setAction in class LyMultiAreaController
Parameters:
action - New main action.
deleteOnClose - Delete controller when action is changed.

closeCurrentView

public void closeCurrentView(boolean closeTabs)
Close view currently being displayed in the dashboard view (single view mode only).

Parameters:
closeTabs - true to close all tabs

closeAllViews

public void closeAllViews()
Closes all the views displayed in the dashboard.


updateWindowMenu

public void updateWindowMenu()
Updates the Window menu of the menu bar.


useSingleView

public boolean useSingleView()
Indicates whether the actions opened from this dashboard must be opened in a new view or not.

Returns:
true if the actions are opened in the same view as the dashboard, false otherwise.

useTabs

public boolean useTabs()
Indicates whether the actions opened from this dashboard must be opened in tabs.
Used only if actions are opened in the same view as the dashboard.

Returns:
true if the actions are opened in tabs, false otherwise.

getDisplayedAreaController

public LyAreaController getDisplayedAreaController()
Accessor to the area controller displayed in the dashboard.

Returns:
the area controller displayed in the dashboard, or null if no area controller is displayed.

getOpenedActions

public LyInfoList<LyAction> getOpenedActions()
Accessor to the list of actions opened in the dashboard.

Returns:
the list of actions opened in the dashboard, or null if no action has been opened.

getActions

public LyInfoList<LyAction> getActions()
Accessor to the list of actions shown in the view.

Returns:
the list of actions

isViewResizable

public boolean isViewResizable()
Indicates if the view for this dashboard controller is resizable.

Overrides:
isViewResizable in class LyMultiAreaController
Returns:
false since dashboard views are not resizable.

getImage

public java.lang.String getImage()
Gets image associated with this controller. The image is the one associated to the action. Overriden to keep the size of the titleBar icon

Overrides:
getImage in class LyAreaController
Returns:
the image corresponding to the action.

addViewController

public void addViewController(java.lang.String id,
                              LyViewController controller)
Add a view controller to keep.

Parameters:
id - The action id.
controller - The view controller to keep.

getViewControllers

public java.util.Hashtable<java.lang.String,LyViewController> getViewControllers()
Return the list of view controllers opened from this controller.
Keys of the returned list are action identifiers and values are the view controllers themselves.

Returns:
the list of view controllers opened from this controller.

setImage

public void setImage(LyAction action,
                     java.lang.String image)
Updates the action image representation in the controlled dashboard . This method may be used to change the icon of an action in the view.

Parameters:
action - action to be modified in the dashboard
image - new image key or path.

setEnabled

public void setEnabled(LyAction action,
                       boolean enable)
Enables/Disables given objectInfo representation in the dashboard view.

Parameters:
action - action to be enabled/disabled in the dashboard
enable - new action status

getHelpFile

public java.lang.String getHelpFile()
Gets help file associated with this controller. If we are in single view mode, return the dashboard help file is no child controller is started. Otherwise, returns the child controller help file.

Overrides:
getHelpFile in class LyAreaController
Returns:
the help file corresponding to the action.

getSocialAction

public LyAction getSocialAction()
Fetch the social action. By default the action id is '_social' but this may be overridden with _findActionId on the action.

Returns:
the social action to open the widget

updateViewFromValues

public void updateViewFromValues(LyDemand demand)
Description copied from class: LyController
Update the view of the controller with the specified values from the demand (internal use) .

Overrides:
updateViewFromValues in class LyController
Parameters:
demand - demand parameters sent by the view component.

(c) January 2013 - W4 S.A.

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