LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.control
Class LyPanelController

java.lang.Object
  extended by leon.control.LyController
      extended by leon.control.LyAreaController
          extended by leon.control.LyPanelController
All Implemented Interfaces:
LyGetSessionInterface, LyContextInterface, LyGetActionInterface, LySelectFileListenerInterface, LyGuiListener, LyInfoListener, LyEvaluator, LyDemandListener, LyAnswerInterface, LyQuestionAnswerInterface
Direct Known Subclasses:
LyCanvasController, LyShowUrlController, LySimpleTableController, LyTreeBaseController

public abstract class LyPanelController
extends LyAreaController
implements LyQuestionAnswerInterface

This class implements the basics of a table controller. It is used to factorize code between all table controllers. It is associated with a builder (LySimpleTableBuilder) and a behavior that implements LySimpleTableBehaviorInterface. There is no default implementation of this behavior.

See Also:
LySimpleTableBuilder, LyTableBehaviorInterface, LyTableController, LyMultiPageTableController

Field Summary
static java.lang.String __VERSION
          File Version.
static java.lang.String DEMAND_DEFAULT_FOR_MOBILE_PREFERENCE
          Menu id : default preference for mobile view.
static java.lang.String DEMAND_DEFAULT_PREFERENCE
          Menu id : default preference.
static java.lang.String DEMAND_PREFERENCE_TARGET
          Menu id : preference target.
static java.lang.String DEMAND_SAVE_PREFERENCE
          Menu id : save preference.
static java.lang.String DEMAND_SELECT_ALL
          Menu id : Select all.
static java.lang.String DEMAND_SHARED_PREFERENCE
          Menu id : default preference.
static java.lang.String DEMAND_UNSELECT_ALL
          Menu id : Deselect all.
static java.lang.String EXTEND_SIMPLE_FILTER
          Menu id : Extend simple filter.
static java.lang.String EXTENDED_FILTER_NEW
          Menu id : Extended filter new.
static java.lang.String FAST_FILTER
          Menu id : Fast filter.
static java.lang.String FILTER_ACTIVE
          Menu id : Filter active.
static java.lang.String FILTER_SET
          Menu id : Filter set.
static java.lang.String PREFERENCE_TARGET_ACTION
          Preference target.
static java.lang.String PREFERENCE_TARGET_CLASS
          Preference target.
static java.lang.String SIMPLE_FILTER_NEW
          Menu id : 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
 
Constructor Summary
LyPanelController(LySession session, LyController parent, LyAction action, LyObjectList context)
          Constructor.
 
Method Summary
 void actionDemand(LyActionDemand demand)
          Invoked when an action occurs.
 void buildFilter(LyFilter currentFilter)
          Set or create a new Filter.
 void closeBorderPanel()
          Internal method for closing border panel.
 boolean enablesMultiSelection()
          Method that indicates if controlled panel enables multi-selection or not.
 void endFilter(LyController controller, java.lang.String actionDemand, LyFilter filter)
          The filter edition form is closed : notify registered listener.
 int findObject(LyFindController find, int from, boolean next)
          Find object in the table and select it.
 void free(LyController controller)
          Free this controller.
abstract  LyObjectList getContent()
          Get content of the table.
 LyFilter getFilter()
          Gets initial : indicates to the filter controller the default filter parameters.
 LyAreaController getFilterController()
          Accessor (internal use) to the internal filter controller displaying (if exists) the filter view of the panel.
 LyFilterEditorController getFilterEditorController()
          Accessor (internal use) to the internal filter editor controller displaying (if exists) the filter view of the panel.
abstract  LyPanel getPanelComponent()
          Accessor to the Table component.
 LyPreference getPreference()
          Gets current preference.
 long getRefreshTime()
          Accessor to the refresh time of this controller.
 LyObjectList getSelection()
          Selected objects.
 boolean isFilterActive()
          Indicates whether the filter is active.
 boolean isHorizontal()
          Method that indicates if controlled panel is horizontal.
 boolean objectAdded(LyWorkSpaceEvent event)
          Called when an object is added in the dynamic object list.
 boolean objectChanged(LyWorkSpaceEvent event)
          Called when an object has changed in the dynamic object list.
 boolean objectRemoved(LyWorkSpaceEvent event)
          Called when an object is removed from the dynamic object list.
 boolean objectStateChanged(LyAdvancedWorkSpaceEvent event)
          Called when an object state is changed.
 boolean objectUserEvent(LyAdvancedWorkSpaceEvent event)
          Called when an object user event occured.
 void questionAnswer(boolean result, java.lang.Object clientData)
          Answer to a askQuestion request.
 void reset(boolean full)
          Reset component.
 void selectAllObjects(boolean select)
          Select all objects in panel.
 void selectObject(LyObject object, boolean select)
          Select an object in the table.
 void setFilter(LyFilter newFilter)
          Apply the filter to the view This method sets the specified filter as the default filter then invokes activateFilter.
 void setIdle(boolean idle)
          Sets idle status of the table.
 void setPreference(LyPreference preference)
          Sets the preference for this controller.
 void setRefreshTime(long time)
          Sets the refresh time of this controller.
 void updatePreferencesMenu()
          Update the find menuitem status.
 boolean workSpaceEventsGrouped(java.util.ArrayList<LyWorkSpaceEvent> events)
          Called when grouped events are sent.
 
Methods inherited from class leon.control.LyAreaController
canClose, canFree, clearViewCache, completeMenuBar, completeMessages, free, getAction, getAreaStackController, getBehavior, getBehaviorInterface, getBuilder, getClassInfo, getContext, getContextClient, getContextTitle, getDefaultAction, getEnvironment, getFastEditionAction, getHelpFile, getImage, getImageTooltip, getInfoLabel, getInfoLabel, getKeyValue, getLabel, getLastModified, getMenuItemImage, getName, getParameter, getParameter, getParameterMarks, getParent, getParent, getParentAreaController, getShortLabel, getTarget, getTitle, getViewController, getViewController, hasMark, hasNotMark, hasViewController, hideView, infoEvent, initialize, isInitialized, isOutlined, isViewResizable, menuDemand, reset, selectFileDemand, setContext, setContext, setContextClient, setViewController, showView, showView, testParameter, toString, update, 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_SELECT_ALL

public static final java.lang.String DEMAND_SELECT_ALL
Menu id : Select all.


DEMAND_UNSELECT_ALL

public static final java.lang.String DEMAND_UNSELECT_ALL
Menu id : Deselect all.


DEMAND_SAVE_PREFERENCE

public static final java.lang.String DEMAND_SAVE_PREFERENCE
Menu id : save preference.


DEMAND_DEFAULT_PREFERENCE

public static final java.lang.String DEMAND_DEFAULT_PREFERENCE
Menu id : default preference.


DEMAND_DEFAULT_FOR_MOBILE_PREFERENCE

public static final java.lang.String DEMAND_DEFAULT_FOR_MOBILE_PREFERENCE
Menu id : default preference for mobile view.


DEMAND_SHARED_PREFERENCE

public static final java.lang.String DEMAND_SHARED_PREFERENCE
Menu id : default preference.


DEMAND_PREFERENCE_TARGET

public static final java.lang.String DEMAND_PREFERENCE_TARGET
Menu id : preference target.


PREFERENCE_TARGET_ACTION

public static final java.lang.String PREFERENCE_TARGET_ACTION
Preference target.


PREFERENCE_TARGET_CLASS

public static final java.lang.String PREFERENCE_TARGET_CLASS
Preference target.


FAST_FILTER

public static final java.lang.String FAST_FILTER
Menu id : Fast filter.


SIMPLE_FILTER_NEW

public static final java.lang.String SIMPLE_FILTER_NEW
Menu id : Filter new.


EXTENDED_FILTER_NEW

public static final java.lang.String EXTENDED_FILTER_NEW
Menu id : Extended filter new.


FILTER_SET

public static final java.lang.String FILTER_SET
Menu id : Filter set.


EXTEND_SIMPLE_FILTER

public static final java.lang.String EXTEND_SIMPLE_FILTER
Menu id : Extend simple filter.


FILTER_ACTIVE

public static final java.lang.String FILTER_ACTIVE
Menu id : Filter active.

Constructor Detail

LyPanelController

public LyPanelController(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. 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

free

public void free(LyController controller)
Free this controller.

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

reset

public void reset(boolean full)
Reset component.

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

actionDemand

public void actionDemand(LyActionDemand demand)
Invoked when an action occurs. (LyDemandListener interface) This method implements:

Overrides:
actionDemand in class LyAreaController
Parameters:
demand - action event created from the view. User interaction.
See Also:
LyController.demandPerformed(leon.view.event.LyDemand)

getContent

public abstract LyObjectList getContent()
Get content of the table.

Overrides:
getContent in class LyAreaController
Returns:
the content of the table

getPanelComponent

public abstract LyPanel getPanelComponent()
Accessor to the Table component.

Returns:
the panel component

getRefreshTime

public long getRefreshTime()
Accessor to the refresh time of this controller. Used by thin clients to know after a selection whether the controller view must be refreshed or not.

Overrides:
getRefreshTime in class LyAreaController
Returns:
A negative number if view must be refreshed or the refresh date.

setRefreshTime

public void setRefreshTime(long time)
Sets the refresh time of this controller.

Parameters:
time - the refres time in ms

setIdle

public void setIdle(boolean idle)
Sets idle status of the table.

Overrides:
setIdle in class LyAreaController
Parameters:
idle - a boolean indicating the idle mode

objectAdded

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

Parameters:
event - the workspace event
Returns:
true if the demand was take into account
See Also:
LyWorkSpaceListener.objectAdded(leon.data.LyWorkSpaceEvent)

objectRemoved

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

Parameters:
event - the workspace event
Returns:
true if the demand was take into account
See Also:
LyWorkSpaceListener.objectRemoved(leon.data.LyWorkSpaceEvent)

objectChanged

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

Parameters:
event - the workspace event
Returns:
true if the demand was take into account
See Also:
LyWorkSpaceListener.objectChanged(leon.data.LyWorkSpaceEvent)

objectStateChanged

public boolean objectStateChanged(LyAdvancedWorkSpaceEvent event)
Called when an object state is changed.

Parameters:
event - Event notifying object state change.
Returns:
True if the event is used by the listener, false otherwise.
See Also:
LyAdvancedWorkSpaceListener.objectStateChanged(leon.data.LyAdvancedWorkSpaceEvent)

objectUserEvent

public boolean objectUserEvent(LyAdvancedWorkSpaceEvent event)
Called when an object user event occured.

Parameters:
event - Event notifying object user event.
Returns:
True if the event is used by the listener, false otherwise.
See Also:
LyAdvancedWorkSpaceListener.objectUserEvent(leon.data.LyAdvancedWorkSpaceEvent)

workSpaceEventsGrouped

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

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)

enablesMultiSelection

public boolean enablesMultiSelection()
Method that indicates if controlled panel enables multi-selection or not.

Returns:
A boolean indicating if multi-selection is allowed or not.

isHorizontal

public boolean isHorizontal()
Method that indicates if controlled panel is horizontal.

Returns:
A boolean indicating if the panel component is horizontal.

selectAllObjects

public void selectAllObjects(boolean select)
Select all objects in panel.

Parameters:
select - new selection status

getSelection

public LyObjectList getSelection()
Selected objects. Highlighted in the table.

Overrides:
getSelection in class LyAreaController
Returns:
the list of selected items

findObject

public int findObject(LyFindController find,
                      int from,
                      boolean next)
Find object in the table and select it.

Parameters:
find - the find controller
from - index to start from (-1 : begin)
next - find commant is searching forward (next selection) or previous.
Returns:
the index of the found object

selectObject

public void selectObject(LyObject object,
                         boolean select)
Select an object in the table.

Parameters:
object - selected or unselected object
select - new selection status

buildFilter

public void buildFilter(LyFilter currentFilter)
Set or create a new Filter.

Parameters:
currentFilter - current filter or null if a new Filter

endFilter

public void endFilter(LyController controller,
                      java.lang.String actionDemand,
                      LyFilter filter)
The filter edition form is closed : notify registered listener.

Parameters:
controller - reference to the filter controller (filter form which is closing)
actionDemand - actionDemand on filter controller : id of the command such as LyFormController.DEMAND_VALIDATE, LyFormController.DEMAND_APPLY, LyFormController.DEMAND_CANCEL
filter - the filter that was created in the form

setFilter

public void setFilter(LyFilter newFilter)
Apply the filter to the view This method sets the specified filter as the default filter then invokes activateFilter.

Parameters:
newFilter - current filter
See Also:
activateFilter(boolean)

getFilter

public LyFilter getFilter()
Gets initial : indicates to the filter controller the default filter parameters.

Returns:
the initial filter or null if no filter is set

isFilterActive

public boolean isFilterActive()
Indicates whether the filter is active.

Returns:
true if a filter is active

setPreference

public void setPreference(LyPreference preference)
Sets the preference for this controller.

Overrides:
setPreference in class LyAreaController
Parameters:
preference - the preference to apply

getPreference

public LyPreference getPreference()
Gets current preference.

Returns:
the current preference

updatePreferencesMenu

public void updatePreferencesMenu()
Update the find menuitem status.


getFilterController

public LyAreaController getFilterController()
Accessor (internal use) to the internal filter controller displaying (if exists) the filter view of the panel.

Returns:
the filter controller

getFilterEditorController

public LyFilterEditorController getFilterEditorController()
Accessor (internal use) to the internal filter editor controller displaying (if exists) the filter view of the panel.

Returns:
the filter editor controller

closeBorderPanel

public void closeBorderPanel()
Internal method for closing border panel.


questionAnswer

public void questionAnswer(boolean result,
                           java.lang.Object clientData)
Answer to a askQuestion request.

Specified by:
questionAnswer in interface LyQuestionAnswerInterface
Parameters:
result - true if the user has clicked on Yes or Ok
client - data specified in the askQuestion method
See Also:
LyQuestionAnswerInterface

(c) January 2013 - W4 S.A.

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