LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.control
Class LySimpleTableController

java.lang.Object
  extended by leon.control.LyController
      extended by leon.control.LyAreaController
          extended by leon.control.LyPanelController
              extended by leon.control.LySimpleTableController
All Implemented Interfaces:
java.lang.Runnable, LyGetSessionInterface, LyContextInterface, LyFastFilterEndInterface, LyFilterEndInterface, LyFindInterface, LyGetActionInterface, LySelectFileListenerInterface, LySortEndInterface, LyAdvancedWorkSpaceListener, LyGuiListener, LyWorkSpaceListener, LyGetClassInfoInterface, LyInfoListener, LyEvaluator, LyDemandListener, LyPrintListenerInterface, LyAnswerInterface, LyQuestionAnswerInterface, LySetPrintModeInterface
Direct Known Subclasses:
LyContextListController, LyTableController

public abstract class LySimpleTableController
extends LyPanelController
implements java.lang.Runnable, LyAdvancedWorkSpaceListener, LyPrintListenerInterface, LyFindInterface, LyFilterEndInterface, LyGetClassInfoInterface, LySortEndInterface, LyFastFilterEndInterface, LySetPrintModeInterface, 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_CHOOSE_COLUMNS
          Menu id : Choose columns.
static java.lang.String DEMAND_COPY_CELL_CONTENT
          Demand id : Copy cell content.
static java.lang.String DEMAND_FIX_COLUMN
          Menu id : Fix column.
static java.lang.String DEMAND_GROUP_BY
          Menu id : Group.
static java.lang.String DEMAND_INVERT_STATUS_SORT
          Menu id : Invert status sort.
static java.lang.String DEMAND_LIST_DISPLAY
          Display List
static java.lang.String DEMAND_NEXT_PAGE
          Menu id : Next page.
static java.lang.String DEMAND_PREVIOUS_PAGE
          Menu id : Previous page.
static java.lang.String DEMAND_PRINT_TABLE
          Menu id : Print list.
static java.lang.String DEMAND_REVERSE
          Menu id : Reverse list.
static java.lang.String DEMAND_ROW_TOOL
          Demand id : Row tool.
static java.lang.String DEMAND_SORT_BY
          Menu id : Simple Sort.
static java.lang.String DEMAND_SORT_DEFAULT
          Menu id : Default sort.
static java.lang.String DEMAND_SORT_EXTEND
          Menu id : Extended sort.
static java.lang.String DEMAND_SORT_REVERSE
          Menu id : Reverse sort.
static java.lang.String DEMAND_SORT_WIZARD
          Menu id : Sort Wizard.
static java.lang.String DEMAND_STATUS_SORT
          Menu id : Status sort.
static java.lang.String DEMAND_SUB_TOOL_ACTION
          Tool id : subtoolbar action.
static java.lang.String DEMAND_UNFIX_COLUMN
          Menu id : Unfix column.
static java.lang.String EMPTY_CELL
          Empty cell id.
static java.lang.String FOOTER_ROW_PREFIX
          Prefix used for footer row identifiers.
static java.lang.String MESSAGE_OBJECTS_COUNT
          Message id : Objects count.
static java.lang.String SECTION_ROW_PREFIX
          Prefix used for section row identifiers.
 
Fields inherited from class leon.control.LyPanelController
DEMAND_DEFAULT_FOR_MOBILE_PREFERENCE, DEMAND_DEFAULT_PREFERENCE, DEMAND_PREFERENCE_TARGET, DEMAND_SAVE_PREFERENCE, DEMAND_SELECT_ALL, DEMAND_SHARED_PREFERENCE, DEMAND_UNSELECT_ALL, EXTEND_SIMPLE_FILTER, EXTENDED_FILTER_NEW, FAST_FILTER, FILTER_ACTIVE, FILTER_SET, PREFERENCE_TARGET_ACTION, PREFERENCE_TARGET_CLASS, SIMPLE_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
LySimpleTableController(LySession session, LyController parent, LyAction action, LyClassInfo classInfo, LyObjectList context)
          Constructor.
 
Method Summary
 void actionDemand(LyActionDemand demand)
          Invoked when an action occurs.
 boolean allowSortOnField(LyFieldInfo fieldInfo)
          Indicates whether sort is allowed on multiple relations.
 LyRow buildRow(LyObject object, LyInfoList<LyFieldInfo> fields, LyInfoList<LyFieldInfo> statusFields)
          Current builder of a new row.
 void clearTranslatedStringMap()
          Clear the translated string map.
 void clearViewCache()
          Clears all cached data for this controller (especially the view and the component).
 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 dragDropDemand(LyDragDropDemand demand)
          Invoked when a Drag & Drop occurs.
 boolean enablesMultiSelection()
          Method that indicates if controlled panel enables multi-selection or not.
 void endFastFilter(LyController controller, java.lang.String actionDemand, java.lang.String filterValue, LyFilter filter, LyFieldInfo fieldInfo, boolean extend)
          The fast filter edition form is closed : notify registered listener.
 void endSort(LyController parent, java.lang.String actionDemand, LySort sort)
          The sort edition form is closed : notify registered listener.
 int findObject(LyFindController find, int from, boolean next)
          Find object in the table and select it.
 void fixColumn(int column)
          Freeze or unFreeze a column.
 void free(LyController controller)
          Free this controller.
 java.lang.Class<?> getBehaviorInterface()
          Method that gives the interface that must be implemented by the behavior associated to this controller.
 LyFilter getClassFilter()
          Accessor on internal classFilter : filter always applied on data shown in view.
 LyClassInfo getClassInfo()
          Class info : content description.
 int getColsNumberListDisplay()
          Return the number of columns in display list. 1 column for status, 1 for first image field, 1 for field name, 1 for field value, 1 for each footer field.
 double getColumnSize(LyFieldInfo fieldInfo)
          Get the colum size for a fieldInfo.
 LyInfoList<LyFieldInfo> getComplexFields()
          Get complex fields.
 LyObjectList getContent()
          Get content of the table.
 LyFieldInfo getFastFilterFieldInfo()
          Gets initial fast filter field info : indicates to the fast filter controller the default filter field info.
 java.lang.String getFastFilterValue()
          Gets initial fast filter value : indicates to the fast filter controller the default filter value.
 java.util.BitSet getFieldMarks()
          Access to field marks used to build the controlled view.
 LyInfoList<LyFieldInfo> getFields()
          Gets the list of fields being displayed in the columns of the table The default implementation uses the specified fieldsMarks or if specified the lists of fields given by the setFields method.
 int getLimit()
          Gets limit parameter for pagination.
 LyPanel getPanelComponent()
          Accessor to panel component.
 LyInfoList<LyFieldInfo> getRealFields()
          Gets the list of real fields being displayed in the columns of the table The default implementation returns the list of fields given by the getFields method.
 LyObjectList getSelection()
          Gets list of selected objects.
 LyObjectList getSelection(boolean sorted)
          Gets list of selected objects.
 LySort getSort()
          Gets current sort.
 LyInfoList<LyFieldInfo> getStatusFieldInfos()
          Returns the list of field infos that represent the object status for this table.
 LyTable getTableComponent()
          Accessor to the Table component.
 LyInfoList<LyFieldInfo> getTableComponentFields()
          Return the list of fields displayed in the table component.
 LyInfoList<LyFieldInfo> getTableComponentFields(boolean classFieldsOnly)
          Return the list of fields displayed in the table component.
 boolean hasDisplayListToggleButton()
          Checks if we have to add toggle button.
 boolean hasPrintMode()
          Checks if print mode is activated.
 boolean isDisplayList()
          Says if table is in display list or not.
 boolean isDisplayListShowFields()
          Says if we have to show fields in display list.
 boolean isFastFilterExtended()
          Indicates if fast filter creation is an extension of current filter.
 boolean isFastFilterSet()
          Indicates if a fast filter is set.
 boolean isFopMode()
          Checks if fop mode is activated.
 boolean isImageColumn(LyInfoList<LyFieldInfo> fields)
          Check if there is an image to display first in list display.
 boolean isStatusColumn(LyInfoList<LyFieldInfo> statusFields)
          check if the status column exists.
 void menuDemand(LyMenuDemand demand)
          Invoked when an menu item notification is sent to this listener.
 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.
 void print(int page)
          Implementation of LyPrintListenerInterface.
 void printList()
          Print the content of the list Run it asynchronous.
 void questionAnswer(boolean result, java.lang.Object clientData)
          Answer to a askQuestion request.
 void reset(boolean full)
          Reset component.
 void run()
          Starting printList request.
 void selectAllObjects(boolean select)
          Select all objects in panel.
 void selectionDemand(LySelectionDemand demand)
          Invoked when a selection occurs.
 void selectObject(LyObject object, boolean select)
          Select an object in the table.
 void selectObject(LyObject object, boolean select, boolean updateView, boolean showSelected)
          Select an object in the table.
 void selectObjects(LyObjectList objects, boolean select)
          Select all given objects in the table.
 int selectRow(LyFieldInfo fieldInfo, java.lang.String pattern, int from, boolean next, boolean substring, boolean caseSensitive)
          Select object in the panel for given parameters.
 void setClassFilter(LyFilter filter, boolean reset)
          Accessor on internal classFilter : filter always applied on data shown in view.
 void setFieldMarks(java.util.BitSet fieldMarks)
          Set field marks used to build the controlled view.
 void setFields(LyInfoList<LyFieldInfo> fields)
          Sets the displayed fields for this controller.
 void setFopMode(boolean status)
          Set the fop mode to the given status
 void setPreference(LyPreference preference)
          Sets the preference for this controller.
 void setPrintMode(boolean status)
          (De)Activate print mode.
 void setSort(LySort sort)
          Set current sort criteria on the view.
 void showObject(LyObject object)
          Scrolls list to make the given object visible.
 java.lang.String translate(java.lang.String key)
          Translate the given key to a displayable string.
 
Methods inherited from class leon.control.LyPanelController
buildFilter, closeBorderPanel, endFilter, getFilter, getFilterController, getFilterEditorController, getPreference, getRefreshTime, isFilterActive, isHorizontal, objectUserEvent, setFilter, setIdle, setRefreshTime, updatePreferencesMenu, workSpaceEventsGrouped
 
Methods inherited from class leon.control.LyAreaController
canClose, canFree, completeMenuBar, free, getAction, getAreaStackController, getBehavior, getBuilder, 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, reset, selectFileDemand, setContext, setContext, setContextClient, setViewController, showView, showView, testParameter, toString, update, updateTitleBar
 
Methods inherited from class leon.control.LyController
activateViewDemand, demandPerformed, 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, updateViewFromValues
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface leon.data.LyAdvancedWorkSpaceListener
objectUserEvent, workSpaceEventsGrouped
 
Methods inherited from interface leon.control.LyFilterEndInterface
endFilter, getFilter
 
Methods inherited from interface leon.control.LyFastFilterEndInterface
getFilter
 

Field Detail

__VERSION

public static final java.lang.String __VERSION
File Version

See Also:
Constant Field Values

DEMAND_PREVIOUS_PAGE

public static final java.lang.String DEMAND_PREVIOUS_PAGE
Menu id : Previous page.


DEMAND_NEXT_PAGE

public static final java.lang.String DEMAND_NEXT_PAGE
Menu id : Next page.


DEMAND_FIX_COLUMN

public static final java.lang.String DEMAND_FIX_COLUMN
Menu id : Fix column.


DEMAND_UNFIX_COLUMN

public static final java.lang.String DEMAND_UNFIX_COLUMN
Menu id : Unfix column.


DEMAND_REVERSE

public static final java.lang.String DEMAND_REVERSE
Menu id : Reverse list.


DEMAND_SORT_BY

public static final java.lang.String DEMAND_SORT_BY
Menu id : Simple Sort.


DEMAND_SORT_EXTEND

public static final java.lang.String DEMAND_SORT_EXTEND
Menu id : Extended sort.


DEMAND_SORT_REVERSE

public static final java.lang.String DEMAND_SORT_REVERSE
Menu id : Reverse sort.


DEMAND_SORT_DEFAULT

public static final java.lang.String DEMAND_SORT_DEFAULT
Menu id : Default sort.


DEMAND_STATUS_SORT

public static final java.lang.String DEMAND_STATUS_SORT
Menu id : Status sort.


DEMAND_INVERT_STATUS_SORT

public static final java.lang.String DEMAND_INVERT_STATUS_SORT
Menu id : Invert status sort.


DEMAND_GROUP_BY

public static final java.lang.String DEMAND_GROUP_BY
Menu id : Group.


MESSAGE_OBJECTS_COUNT

public static final java.lang.String MESSAGE_OBJECTS_COUNT
Message id : Objects count.


DEMAND_PRINT_TABLE

public static final java.lang.String DEMAND_PRINT_TABLE
Menu id : Print list.


DEMAND_SUB_TOOL_ACTION

public static final java.lang.String DEMAND_SUB_TOOL_ACTION
Tool id : subtoolbar action.


DEMAND_CHOOSE_COLUMNS

public static final java.lang.String DEMAND_CHOOSE_COLUMNS
Menu id : Choose columns.


DEMAND_SORT_WIZARD

public static final java.lang.String DEMAND_SORT_WIZARD
Menu id : Sort Wizard.


DEMAND_ROW_TOOL

public static final java.lang.String DEMAND_ROW_TOOL
Demand id : Row tool.


DEMAND_COPY_CELL_CONTENT

public static final java.lang.String DEMAND_COPY_CELL_CONTENT
Demand id : Copy cell content.


SECTION_ROW_PREFIX

public static final java.lang.String SECTION_ROW_PREFIX
Prefix used for section row identifiers.


FOOTER_ROW_PREFIX

public static final java.lang.String FOOTER_ROW_PREFIX
Prefix used for footer row identifiers.


EMPTY_CELL

public static final java.lang.String EMPTY_CELL
Empty cell id.


DEMAND_LIST_DISPLAY

public static final java.lang.String DEMAND_LIST_DISPLAY
Display List

Constructor Detail

LySimpleTableController

public LySimpleTableController(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. If an action is specified, the controller uses action parameters (action name, action specific XML view description ...)
classInfo - class info for objects displayed in the list.
context - current context (may be null if the view is not contextual to a list of objects).
Method Detail

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.

setFieldMarks

public void setFieldMarks(java.util.BitSet fieldMarks)
Set field marks used to build the controlled view.

Parameters:
fieldMarks - marks to set

getFieldMarks

public java.util.BitSet getFieldMarks()
Access to field marks used to build the controlled view.

Returns:
the field marks

reset

public void reset(boolean full)
Reset component.

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

free

public void free(LyController controller)
Free this controller.

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

clearViewCache

public void clearViewCache()
Clears all cached data for this controller (especially the view and the component). Updated to clear workspace and avoid events treatments.

Overrides:
clearViewCache in class LyAreaController

selectionDemand

public void selectionDemand(LySelectionDemand demand)
Invoked when a selection occurs. This method handles: select all, unselect all and objects by objects selection

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

actionDemand

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

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

dragDropDemand

public void dragDropDemand(LyDragDropDemand demand)
Invoked when a Drag & Drop occurs. (LyDemandListener interface) This method handles: opening and closing line, moving an interval, action

Overrides:
dragDropDemand in class LyController
Parameters:
demand - drag-drop demand

menuDemand

public void menuDemand(LyMenuDemand demand)
Invoked when an menu item notification is sent to this listener.

This method overriden to create a popup menu : buildPopupMenu.

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

isStatusColumn

public boolean isStatusColumn(LyInfoList<LyFieldInfo> statusFields)
check if the status column exists.

Parameters:
statusFields - (optional) list of status fields
Returns:
true if there is a status column

isImageColumn

public boolean isImageColumn(LyInfoList<LyFieldInfo> fields)
Check if there is an image to display first in list display.

Parameters:
fields - Fields
Returns:
True if there is an image field

getStatusFieldInfos

public LyInfoList<LyFieldInfo> getStatusFieldInfos()
Returns the list of field infos that represent the object status for this table.

Returns:
a list of field infos or null if no field is used for object status.

allowSortOnField

public boolean allowSortOnField(LyFieldInfo fieldInfo)
Indicates whether sort is allowed on multiple relations.


setSort

public void setSort(LySort sort)
Set current sort criteria on the view.

Parameters:
sort - new sort criteria

getColumnSize

public double getColumnSize(LyFieldInfo fieldInfo)
Get the colum size for a fieldInfo.

Parameters:
fieldInfo - a fieldInfo
Returns:
a positive double for a fixed sized a negative one otherwise

selectObject

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

Overrides:
selectObject in class LyPanelController
Parameters:
object - selected or unselected object
select - new selection status

selectObject

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

Parameters:
object - selected or unselected object
select - new selection status
updateView - indicates if we must update the views
showSelected - indicates wether the view should scroll to the new selection

selectAllObjects

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

Overrides:
selectAllObjects in class LyPanelController
Parameters:
select - new selection status

selectObjects

public void selectObjects(LyObjectList objects,
                          boolean select)
Select all given objects in the table.

Parameters:
objects - Objects to select/deselect
select - new selection status

showObject

public void showObject(LyObject object)
Scrolls list to make the given object visible.

Parameters:
object - Object to be shown. If object is null, the first row is shown.

getFastFilterValue

public java.lang.String getFastFilterValue()
Gets initial fast filter value : indicates to the fast filter controller the default filter value.

Specified by:
getFastFilterValue in interface LyFastFilterEndInterface
Returns:
the initial fast filter value

getFastFilterFieldInfo

public LyFieldInfo getFastFilterFieldInfo()
Gets initial fast filter field info : indicates to the fast filter controller the default filter field info.

Specified by:
getFastFilterFieldInfo in interface LyFastFilterEndInterface
Returns:
the initial fast filter field info or null if no filter is set

isFastFilterExtended

public boolean isFastFilterExtended()
Indicates if fast filter creation is an extension of current filter.

Specified by:
isFastFilterExtended in interface LyFastFilterEndInterface
Returns:
true if fast filter creation is an extension of current filter, false otherwise

isFastFilterSet

public boolean isFastFilterSet()
Indicates if a fast filter is set.

Specified by:
isFastFilterSet in interface LyFastFilterEndInterface
Returns:
true if a fast filter is set, false otherwise

fixColumn

public void fixColumn(int column)
Freeze or unFreeze a column.

Parameters:
column - column index to fix

findObject

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

Specified by:
findObject in interface LyFindInterface
Overrides:
findObject in class LyPanelController
Parameters:
find - the find controller
from - index to start from (-1 : begin)
next - find command is searching forward (next selection) or previous.
Returns:
index of the found object

selectRow

public int selectRow(LyFieldInfo fieldInfo,
                     java.lang.String pattern,
                     int from,
                     boolean next,
                     boolean substring,
                     boolean caseSensitive)
Select object in the panel for given parameters.

Parameters:
fieldInfo - the fieldinfo
pattern - the pattern to select
from - the start index
next - indicates the direction of the search
substring - indicates if we look at substring
caseSensitive - indicates if the search is case sensitive
Returns:
the index of the selected row, -1 if none has been found

getClassInfo

public LyClassInfo getClassInfo()
Class info : content description. (application class)

Specified by:
getClassInfo in interface LyGetClassInfoInterface
Overrides:
getClassInfo in class LyAreaController
Returns:
the classInfo being shown in this table

getContent

public LyObjectList getContent()
Get content of the table.

Specified by:
getContent in class LyPanelController
Returns:
the list of objects being displayed

getSelection

public LyObjectList getSelection()
Gets list of selected objects.

Overrides:
getSelection in class LyPanelController
Returns:
the list of objects currently selected or null if no object is selected

getSelection

public LyObjectList getSelection(boolean sorted)
Gets list of selected objects.

Parameters:
sorted - True if selection list is given with current table sort, false if selection order is desired.
Returns:
the list of objects currently selected or null if no object is selected

getSort

public LySort getSort()
Gets current sort.

Specified by:
getSort in interface LySortEndInterface
Returns:
the initial sort or null if no sort is set

getTableComponent

public LyTable getTableComponent()
Accessor to the Table component.

Returns:
the table component

getPanelComponent

public LyPanel getPanelComponent()
Accessor to panel component.

Specified by:
getPanelComponent in class LyPanelController
Returns:
the panel component
See Also:
getTableComponent()

getTableComponentFields

public LyInfoList<LyFieldInfo> getTableComponentFields()
Return the list of fields displayed in the table component. This list may be different from the real field info list since graphical component may allow the end-user to change the order of the headers (in Swing viewer for example).

Returns:
the list of fields displayed in the table component or null if no specific order has been returned by the table component.

getTableComponentFields

public LyInfoList<LyFieldInfo> getTableComponentFields(boolean classFieldsOnly)
Return the list of fields displayed in the table component. This list may be different from the real field info list since graphical component may allow the end-user to change the order of the headers (in Swing viewer for example).

Parameters:
classFieldsOnly - indicates whether only fields of current class info must be returned.
Returns:
the list of fields displayed in the table component or null if no specific order has been returned by the table component.

objectAdded

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

Specified by:
objectAdded in interface LyWorkSpaceListener
Overrides:
objectAdded in class LyPanelController
Parameters:
event - the workspace event
Returns:
true if the event was handled
See Also:
LyWorkSpaceListener.objectAdded(leon.data.LyWorkSpaceEvent)

objectRemoved

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

Specified by:
objectRemoved in interface LyWorkSpaceListener
Overrides:
objectRemoved in class LyPanelController
Parameters:
event - the workspace event
Returns:
true if the event was handled
See Also:
LyWorkSpaceListener.objectRemoved(leon.data.LyWorkSpaceEvent)

objectChanged

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

Specified by:
objectChanged in interface LyWorkSpaceListener
Overrides:
objectChanged in class LyPanelController
Parameters:
event - the workspace event
Returns:
true if the event was handled
See Also:
LyWorkSpaceListener.objectChanged(leon.data.LyWorkSpaceEvent)

objectStateChanged

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

Specified by:
objectStateChanged in interface LyAdvancedWorkSpaceListener
Overrides:
objectStateChanged in class LyPanelController
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)

buildRow

public LyRow buildRow(LyObject object,
                      LyInfoList<LyFieldInfo> fields,
                      LyInfoList<LyFieldInfo> statusFields)
Current builder of a new row.

Parameters:
object - object added in the contextual list, and which should set the content of row cells.
fields - list of fields which should be seen.
statusFields - list of fields which may set the status icon.
Returns:
LyRow the new Row description (XML description) which is added in the LyTable component.
See Also:
insertRow(leon.data.LyObject, int, boolean)

isDisplayList

public boolean isDisplayList()
Says if table is in display list or not.

Returns:
true if display list

isDisplayListShowFields

public boolean isDisplayListShowFields()
Says if we have to show fields in display list.

Returns:
true if fields must be show

getComplexFields

public LyInfoList<LyFieldInfo> getComplexFields()
Get complex fields.

Returns:
list of complex fields.

completeMessages

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

Overrides:
completeMessages in class LyAreaController
Parameters:
messages - the messages to update
level - the level
See Also:
LyAreaBuilder.completeMessages(leon.view.LyMessages, int)

getFields

public LyInfoList<LyFieldInfo> getFields()
Gets the list of fields being displayed in the columns of the table The default implementation uses the specified fieldsMarks or if specified the lists of fields given by the setFields method.

Returns:
the list of fields being displayed
See Also:
setFields(LyInfoList)

getRealFields

public LyInfoList<LyFieldInfo> getRealFields()
Gets the list of real fields being displayed in the columns of the table The default implementation returns the list of fields given by the getFields method.

Returns:
the list of real fields being displayed
See Also:
getFields()

translate

public final java.lang.String translate(java.lang.String key)
Translate the given key to a displayable string. This method is provided for optimization.

Parameters:
key - the string to translate
Returns:
the translated string if it could be found, the key parameter otherwise

clearTranslatedStringMap

public final void clearTranslatedStringMap()
Clear the translated string map.


endFastFilter

public void endFastFilter(LyController controller,
                          java.lang.String actionDemand,
                          java.lang.String filterValue,
                          LyFilter filter,
                          LyFieldInfo fieldInfo,
                          boolean extend)
The fast filter edition form is closed : notify registered listener.

Specified by:
endFastFilter in interface LyFastFilterEndInterface
Parameters:
controller - reference to the fast filter controller (filter form which is closing)
actionDemand - actionDemand on filter controller : id of the command such as LyFormController.DEMAND_VALIDATE, LyFormController.DEMAND_CANCEL
filterValue - the filter value that was typed in the form
filter - the filter that was created in the form
fieldInfo - the fast filter field info
extend - indicates if fast filter creation is an extension of current filter.

endSort

public void endSort(LyController parent,
                    java.lang.String actionDemand,
                    LySort sort)
The sort edition form is closed : notify registered listener.

Specified by:
endSort in interface LySortEndInterface
Parameters:
parent - reference to the sort controller (sort form which is closing)
actionDemand - actionDemand on sort controller : id of the command such as LyFormController.DEMAND_VALIDATE, LyFormController.DEMAND_APPLY, LyFormController.DEMAND_CANCEL
sort - the sort that was created in the form

printList

public void printList()
Print the content of the list Run it asynchronous.


run

public void run()
Starting printList request.

Specified by:
run in interface java.lang.Runnable

print

public void print(int page)
Implementation of LyPrintListenerInterface.

Specified by:
print in interface LyPrintListenerInterface
Parameters:
page - the page to print

getClassFilter

public LyFilter getClassFilter()
Accessor on internal classFilter : filter always applied on data shown in view. The class filter applies wether a user filter is set or not. This is a low level filter always set on data. This value is usually set in the table action by the '_classFilter' parameter. Default is null.

Returns:
current classFilter value, or null if no filter is set (default).

setClassFilter

public void setClassFilter(LyFilter filter,
                           boolean reset)
Accessor on internal classFilter : filter always applied on data shown in view. The class filter applies wether a user filter is set or not. This is a low level filter always set on data. This value is usually set in the table action by the '_classFilter' parameter.

Parameters:
filter - classFilter value, or null if no filter is set (default).
reset - indicates wheter the content is immediately calculated and view is refreshed. This parameter should be true to recalculate content. This is useless only if the content is explicitely reset by the application, using setContext for instance.

setFields

public void setFields(LyInfoList<LyFieldInfo> fields)
Sets the displayed fields for this controller.

Parameters:
fields - List of fields to display in the table. If null, return to default list of fields.

enablesMultiSelection

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

Overrides:
enablesMultiSelection in class LyPanelController
Returns:
A boolean indicating if multi-selection is allowed or not.

setPreference

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

Overrides:
setPreference in class LyPanelController
Parameters:
preference - the preference to set

getLimit

public int getLimit()
Gets limit parameter for pagination.

Returns:
-1 means no limit, a positive value indicates the number of objects per page.

setPrintMode

public void setPrintMode(boolean status)
(De)Activate print mode. This method is invoked with true before printing the to false at the end of the print task. The view/controller may need to change the content at that time.

Specified by:
setPrintMode in interface LySetPrintModeInterface
Parameters:
status - true if printing is active, false otherwise.

hasPrintMode

public final boolean hasPrintMode()
Checks if print mode is activated.

Returns:
True if print mode is on, false otherwise.

setFopMode

public final void setFopMode(boolean status)
Set the fop mode to the given status

Parameters:
status - the new fop status

isFopMode

public final boolean isFopMode()
Checks if fop mode is activated.

Returns:
True if fop mode is on, false otherwise.

hasDisplayListToggleButton

public final boolean hasDisplayListToggleButton()
Checks if we have to add toggle button.

Returns:
True if toggle button, false otherwise.

questionAnswer

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

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

getColsNumberListDisplay

public int getColsNumberListDisplay()
Return the number of columns in display list. 1 column for status, 1 for first image field, 1 for field name, 1 for field value, 1 for each footer field.

Returns:
Int number of columns

(c) January 2013 - W4 S.A.

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