|
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
public abstract class LyAreaController
An area controller is an abstract class used for factoring elementary view behavior. This class is specialized into LyFormController, LyTableController, LyMapController for example. An areaController is associated to an action and may have a context for the creation of the view. (contextual views).
The area controller offer primitive to manage the content of of the view : menubar, titleBar, messageBar.
It provides description of current action, context, associated classes. The implementation of all these primitive is usually overriden in subclasses.
Field Summary | |
---|---|
static java.lang.String |
__VERSION
File version |
static int |
DEFAULT_MENU_ITEM_IMAGE_SIZE
Default size of image in menu items. |
static java.lang.String |
DEMAND_APPLY
Interaction code on the command bar button : Apply inputs. |
static java.lang.String |
DEMAND_CANCEL
Cancel inputs. |
static java.lang.String |
DEMAND_CLOSE
Closing area. |
static java.lang.String |
DEMAND_CREATE_CHART
Creation of a new chart. |
static java.lang.String |
DEMAND_DELETE_CHART
Deletion of charts. |
static java.lang.String |
DEMAND_DELETE_OBJECTINFOS
Menu id : delete object info. |
static java.lang.String |
DEMAND_DELETE_PREFERENCE
Menu id : delete preference. |
static java.lang.String |
DEMAND_UPDATE_VIEW
Update view demand. |
static java.lang.String |
DEMAND_VALIDATE
Interaction code on the command bar button : Validate inputs. |
Fields inherited from class leon.control.LyController |
---|
_nbControllers, _nextId, CONTROLLER_ID_SEP, DEFAULT_IMAGE_FORMAT, DEMAND_HELP, ID_SEP |
Constructor Summary | |
---|---|
LyAreaController(LySession session,
LyController parent,
LyAction action,
LyObjectList context)
Constructor. |
Method Summary | |
---|---|
void |
actionDemand(LyActionDemand demand)
Invoked when an action occurs. |
boolean |
canClose(boolean showMessage)
Check if the area controller may be closed. |
boolean |
canFree(boolean showMessage)
Check if the area controller may be freed. |
void |
clearViewCache()
Clears all cached data for this controller (especially the view and the component). |
void |
completeMenuBar(LyMenuBar menuBar,
int level)
This method is invoked to enable the the area to complete the menuBar of the view and add its own menu items. |
void |
completeMessages(LyMessages messages,
int level)
This method is invoked to enable the the area(s) to complete the message bar of the view and add its own message items. |
void |
free()
Free this controller. |
void |
free(LyController controller)
Free this controller on request of the specified controller. |
LyAction |
getAction()
Accessor to the action associated to this controller. |
LyMultiAreaController |
getAreaStackController()
Accessor to the multi-area controller managing this area controller (for dialog actions only in LY_OPEN_DIALOGS_IN_SAME_VIEW mode). |
LyBehaviorInterface |
getBehavior()
Accessor to controller behavior A behavior is associated to a controller to let the developper specify application logic in the behavior. |
java.lang.Class<?> |
getBehaviorInterface()
Method that gives the interface that must be implemented by the behavior associated to this controller. |
LyBuilder |
getBuilder()
Accessor to the internal builder. |
LyClassInfo |
getClassInfo()
Get controller class info if any. |
LyObjectList |
getContent()
Return list of objects presented in the area This method is overriden depending on the nature of the controller. |
LyWorkSpace |
getContext()
Get current controller context. |
LyAreaController |
getContextClient()
Accessor to the context client area controller which will receive contextual notification when something occurs on this area controller. |
java.lang.String |
getContextTitle()
Gets context title associated with this controller. |
LyAction |
getDefaultAction(LyObject object)
Retrieve the default action for an object. |
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 session environment. |
LyAction |
getFastEditionAction(LyObject object,
LyFieldInfo fieldInfo)
Finds the best suited action for fast edition of given field for a given object. |
java.lang.String |
getHelpFile()
Gets help file associated with this controller. |
java.lang.String |
getImage()
Gets image associated with this controller. |
java.lang.String |
getImageTooltip()
Gets image tooltip associated with this controller. |
LyInfoLabel |
getInfoLabel(LyClassInfo classInfo,
LyInfoLabel.Type type)
Gets info label of the given type for specified class info. |
LyInfoLabel |
getInfoLabel(LyFieldInfo fieldInfo,
LyInfoLabel.Type type)
Gets info label of the given type for specified field info. |
java.lang.Object |
getKeyValue(java.lang.String key)
Retrieves a value from a registered key. |
java.lang.String |
getLabel(LyObject object,
LyFieldInfo fieldInfo,
java.lang.Object fieldValue)
Gets label of an object, for specified field info and value. |
long |
getLastModified()
Accessor to the last modification date of this controller. |
java.lang.String |
getMenuItemImage(LyAction action)
Gets menu item image associated with this controller. |
java.lang.String |
getName(LyObject object)
Gets name of an object in the context of the given area controller. |
java.lang.Object |
getParameter(java.lang.String name)
Gets value corresponding to the given parameter name. |
java.lang.Object |
getParameter(java.lang.String name,
boolean unknown_value)
Gets value corresponding to the given parameter. |
java.util.BitSet |
getParameterMarks(java.lang.String name,
LyBitSet.Type type)
Gets value corresponding to the given parameter mark. |
LyController |
getParent()
Accessor to the reference to the parent controller. |
LyController |
getParent(boolean buildView)
Accessor to the reference to the parent controller. |
LyAreaController |
getParentAreaController()
Accessor to the first parent area controller of this controller. |
long |
getRefreshTime()
Accessor to the refresh time of this controller. |
LyObjectList |
getSelection()
Return list of selected objects This method is overriden depending on the nature of the controller. |
java.lang.String |
getShortLabel(LyObject object,
LyFieldInfo fieldInfo,
java.lang.Object fieldValue)
Gets short label of an object, for specified field info and value. |
java.lang.String |
getTarget()
Accessor for the action target specified when calling showView. |
java.lang.String |
getTitle()
Gets title associated with this controller. |
LyViewController |
getViewController()
Accessor to the view controller of the area. |
LyViewController |
getViewController(boolean isDialog)
Accessor to the view controller of the area. |
boolean |
hasMark(LyFieldInfo fieldInfo,
int mark)
Checks if a mark is set for the given fieldInfo in the context of the controlled action. |
boolean |
hasNotMark(LyFieldInfo fieldInfo,
int mark)
Checks if a mark is unset for the given fieldInfo in the context of the controlled action. |
boolean |
hasViewController()
Check if the controller has a viewController. |
void |
hideView(boolean free)
Hide the view. |
void |
infoEvent(java.lang.String prefix)
Invoked when an action occurs on an info object (deletion or creation). |
void |
initialize()
Initializes this area controller. |
boolean |
isInitialized()
Checks if this controller was initialized or not. |
boolean |
isOutlined()
Indicates if the view for this area acts on the outline view. |
boolean |
isViewResizable()
Indicates if the view for this area controller is resizable. |
void |
menuDemand(LyMenuDemand demand)
Invoked when an menu item notification is sent to this listener. |
void |
reset()
Perform a full reset (reset of datas and reset of graphical area). |
void |
reset(boolean full)
Reset all the content of the view. |
void |
selectFileDemand(LySelectFileController controller,
LyDemand demand)
Invoked when the user validates the input content. |
boolean |
setContext(LyObjectList context)
Set the context for the controller. |
boolean |
setContext(LyWorkSpace context)
Set the current context for the controller. |
void |
setContextClient(LyAreaController controller)
Set accessor to the context client area controller which will receive contextual notification when something occur on this area controller. |
void |
setIdle(boolean idle)
Sets idle status of the table. |
void |
setPreference(LyPreference preference)
Sets the preference for this controller. |
void |
setViewController(LyViewController viewController)
Accessor to the view controller of the area. |
void |
showView()
Make the view visible to the user. |
void |
showView(java.lang.String target)
Make the view visible to the user. |
boolean |
testParameter(java.lang.String name)
Tests if the given parameter has "true" as value. |
java.lang.String |
toString()
Get this controller as a string. |
boolean |
update()
This method is called by the view controller when this area is shown to update its content. |
LyTitleBar |
updateTitleBar(java.lang.String image,
java.lang.String title,
java.lang.String contextTitle)
Update the title bar content (if any titlebar is associated with this area). |
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 |
---|
public static final java.lang.String __VERSION
public static final java.lang.String DEMAND_CLOSE
public static final java.lang.String DEMAND_APPLY
public static final java.lang.String DEMAND_CANCEL
public static final java.lang.String DEMAND_VALIDATE
public static final java.lang.String DEMAND_DELETE_PREFERENCE
public static final java.lang.String DEMAND_DELETE_OBJECTINFOS
public static final java.lang.String DEMAND_CREATE_CHART
public static final java.lang.String DEMAND_DELETE_CHART
public static final java.lang.String DEMAND_UPDATE_VIEW
public static final int DEFAULT_MENU_ITEM_IMAGE_SIZE
Constructor Detail |
---|
public LyAreaController(LySession session, LyController parent, LyAction action, LyObjectList context)
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 ...)context
- current context (may be null if the view is not contextual to a list of
objects).Method Detail |
---|
public LyBuilder getBuilder()
getBuilder
in class LyController
public void initialize()
public boolean isInitialized()
public void clearViewCache()
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.
clearViewCache
in class LyController
public void reset()
reset(boolean)
public void reset(boolean full)
full
- Boolean indicating if a full reset (including reset of datas) is requiered or not
(only reset graphical area).public boolean update()
public LyTitleBar updateTitleBar(java.lang.String image, java.lang.String title, java.lang.String contextTitle)
image
- the image on the left side of the titlebar. If no image is given, try to
get the image from the controller.title
- the string displayed on the left label of the titlebar. May be either a
text message, or a String key found in the dictionary
(StringXXX.properties) files. if to title is given, try to get a title
from the behavior (@see LyActionBehavior#getTitle).contextTitle
- the string displayed on the right side of the titlebar. May be either a
text message, or a String key found in the dictionary
(StringXXX.properties) files. If no string is given, try to construct
one from the current context (if any).
public void completeMenuBar(LyMenuBar menuBar, int level)
menuBar
- the menuBar structurelevel
- : level of current Controller. one of the LEVEL_XXX contants in
LyViewControllerLyViewController
public void completeMessages(LyMessages messages, int level)
messages
- the message bar structurelevel
- : level of current Controller. one of the LEVEL_XXX contants. in
LyViewControllerLyViewController
public LyAction getFastEditionAction(LyObject object, LyFieldInfo fieldInfo)
object
- the object to editfieldInfo
- field info to be edited
public LyAction getDefaultAction(LyObject object)
object
- object of the action.
public boolean canFree(boolean showMessage)
showMessage
- indicates if the controller can show an warning message or not
public boolean canClose(boolean showMessage)
showMessage
- indicates if the controller can show an warning message or not
public void free()
The parent will then invoke free(LyController controller) Method is set final, since propagation in subclasses must use free(LyController controller)
free
in class LyController
free(LyController)
public void free(LyController controller)
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.free()
public void actionDemand(LyActionDemand demand)
actionDemand
in class LyController
demand
- demand parameters sent by the view component.LyController.demandPerformed(leon.view.event.LyDemand)
public void menuDemand(LyMenuDemand demand)
This method is called by demandPerformed and may be overriden in subclasses.
Default implementation manages menud demands on titlebars (XML dumps, snapshots).
menuDemand
in class LyController
demand
- demand parameters sent by the view component.LyController.demandPerformed(leon.view.event.LyDemand)
public LyAction getAction()
getAction
in interface LyGetActionInterface
public java.lang.String getTarget()
public LyWorkSpace getContext()
getContext
in interface LyContextInterface
LyContextInterface.getContext()
public final boolean setContext(LyObjectList context)
context
- Current context, or null if no context is set for the view
LyContextInterface.setContext(leon.data.LyWorkSpace)
,
setContext(LyWorkSpace)
public boolean setContext(LyWorkSpace context)
setContext
in interface LyContextInterface
context
- Current context, or null if no context is set for the view
LyContextInterface.getContext()
public LyAreaController getContextClient()
Used for contextual views and compound actions.
public void setContextClient(LyAreaController controller)
Used for contextual views and compound actions.
controller
- the contextual controller, or null if no client definedpublic java.lang.Object getParameter(java.lang.String name)
name
- Parameter name.
LyAction.getParameter(java.lang.String)
,
getParameter(String, boolean)
public java.lang.Object getParameter(java.lang.String name, boolean unknown_value)
name
- Parameter name.unknown_value
- Boolean indicating if an exception is raised if this parameter
doesn't exist on the controller action.
java.lang.IllegalStateException
- If no parameters are registered on this action (never
thrown if allowUnkownValue is on).
java.lang.IllegalArgumentException
- If the action doesn't have a parameter with the given
name. (never thrown if allowUnkownValue is on).public boolean testParameter(java.lang.String name)
name
- Parameter name.
java.lang.IllegalArgumentException
- If the action doesn't have a parameter with the given
name. (never thrown if allowUnkownValue is on).public java.util.BitSet getParameterMarks(java.lang.String name, LyBitSet.Type type)
name
- the name of the parametertype
- the type of expected bitset (for validation) Possible values are :
LyBitSet.Type.A_MARKS, TYPE_F_MARKS, TYPE_C_MARKS...
public LyClassInfo getClassInfo()
public java.lang.String getTitle()
public java.lang.String getContextTitle()
public java.lang.String getImage()
public java.lang.String getImageTooltip()
public java.lang.String getMenuItemImage(LyAction action)
action
- The action for which the image is needed.
public java.lang.String getHelpFile()
public LyObjectList getContent()
public LyObjectList getSelection()
public LyController getParent(boolean buildView)
buildView
- true if the view must be build or not
public LyController getParent()
getParent
in class LyController
public LyAreaController getParentAreaController()
public LyMultiAreaController getAreaStackController()
public LyViewController getViewController()
If no container is set, a new Frame controller is created for this area. Method never return null, but several calls on this method will return the same reference.
The default controller is a Frame controller, not a dialog : getViewController(false)
getViewController
in class LyController
public LyViewController getViewController(boolean isDialog)
If no container is set, a new Frame controller is created for this area. Method never return null, but several calls on this method will return the same reference.
isDialog
- indicates wether the window is Dialog or Frame
public void setViewController(LyViewController viewController)
viewController
- the controller which manages the parent frame / dialogpublic long getRefreshTime()
public boolean isViewResizable()
public boolean isOutlined()
public java.lang.Class<?> getBehaviorInterface()
getBehaviorInterface
in class LyController
public LyBehaviorInterface getBehavior()
getBehavior
in class LyController
public LyEnvironment getEnvironment()
getEnvironment
in class LyController
public long getLastModified()
getLastModified
in class LyController
public void setPreference(LyPreference preference)
preference
- the preference to applupublic void infoEvent(java.lang.String prefix)
infoEvent
in interface LyInfoListener
prefix
- a file prefixpublic java.lang.String toString()
toString
in class LyController
LyController.getName()
public void setIdle(boolean idle)
setIdle
in class LyController
idle
- a boolean indicating the idle modepublic java.lang.String getName(LyObject object)
object
- Object for which its name is required.
public java.lang.String getLabel(LyObject object, LyFieldInfo fieldInfo, java.lang.Object fieldValue)
object
- Object for which a label is required.fieldInfo
- field info.fieldValue
- value of the field.
public java.lang.String getShortLabel(LyObject object, LyFieldInfo fieldInfo, java.lang.Object fieldValue)
object
- Object for which a short label is required.fieldInfo
- field info.fieldValue
- value of the field.
public LyInfoLabel getInfoLabel(LyFieldInfo fieldInfo, LyInfoLabel.Type type)
fieldInfo
- the fieldinfotype
- the type of label
public LyInfoLabel getInfoLabel(LyClassInfo classInfo, LyInfoLabel.Type type)
classInfo
- a classinfotype
- the type of label
public void showView()
showView
in class LyController
public void showView(java.lang.String target)
target
- the name of the target where the view must be shownpublic void hideView(boolean free)
This method should consider that the page is closed and should disappear.
hideView
in class LyController
free
- Indicates if only HIDDEN, not FREED (true).public boolean hasViewController()
hasViewController
in class LyController
public void selectFileDemand(LySelectFileController controller, LyDemand demand)
selectFileDemand
in interface LySelectFileListenerInterface
controller
- the current LySelectFileController instancedemand
- demand parameters sent by the view component.public boolean hasMark(LyFieldInfo fieldInfo, int mark)
fieldInfo
- Field to be checked.mark
- Mark to be checked.
public boolean hasNotMark(LyFieldInfo fieldInfo, int mark)
fieldInfo
- Field to be checked.mark
- Mark to be checked.
public java.lang.Object getKeyValue(java.lang.String key)
getKeyValue
in interface LyEvaluator
getKeyValue
in class LyController
key
- The key that must be used.
|
(c) January 2013 - W4 S.A. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |