LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.control
Class LyMultiPageTableController

java.lang.Object
  extended by leon.control.LyController
      extended by leon.control.LyAreaController
          extended by leon.control.LyPanelController
              extended by leon.control.LySimpleTableController
                  extended by leon.control.LyTableController
                      extended by leon.control.LyMultiPageTableController
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:
LyEditTableController, LyImportTableController

public class LyMultiPageTableController
extends LyTableController

This table controller has the capability of showing data partially, using a page mechanism. This is only a rendering effect when creating the views, since the controller is 'aware' of the entire content of the table.

Actions (select, filter, sort ...) apply on the whole content of the view.

See Also:
LyTableController

Field Summary
static java.lang.String __VERSION
          File Version
static boolean IMPACT_OUTSIDE_OF_CURRENT_VIEW
          AUTO SCROLL if create or remove outside of view.
static java.lang.String SELECT_PAGE
          Select page string
 
Fields inherited from class leon.control.LyTableController
MAX_OBJECTS_COUNT_FOR_CONTEXT_FILTER
 
Fields inherited from class leon.control.LySimpleTableController
DEMAND_CHOOSE_COLUMNS, DEMAND_COPY_CELL_CONTENT, DEMAND_FIX_COLUMN, DEMAND_GROUP_BY, DEMAND_INVERT_STATUS_SORT, DEMAND_LIST_DISPLAY, DEMAND_NEXT_PAGE, DEMAND_PREVIOUS_PAGE, DEMAND_PRINT_TABLE, DEMAND_REVERSE, DEMAND_ROW_TOOL, DEMAND_SORT_BY, DEMAND_SORT_DEFAULT, DEMAND_SORT_EXTEND, DEMAND_SORT_REVERSE, DEMAND_SORT_WIZARD, DEMAND_STATUS_SORT, DEMAND_SUB_TOOL_ACTION, DEMAND_UNFIX_COLUMN, EMPTY_CELL, FOOTER_ROW_PREFIX, MESSAGE_OBJECTS_COUNT, SECTION_ROW_PREFIX
 
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
LyMultiPageTableController(LySession session, LyController parent, LyAction action, LyClassInfo classInfo, LyObjectList context)
          Constructor.
 
Method Summary
 void actionDemand(LyActionDemand demand)
          Invoked when an action occurs.
 int getLastPage()
          Accessor the number of the last available page.
 int getPage()
          Accessor the number (index) of the page being shown.
 boolean hasViewLimit()
          Indicates if the action has a view limit.
 boolean isDisplayNextPreviousTools()
          Indicates whether previous / next tools must be added to the top toolbar.
 boolean isDisplayPagesNumber()
          Indicates if pages number must be displayed in select bar.
 boolean isPaginated()
          Indicates if there is a pagination on this table controller.
 void loadPage(boolean next)
          Go to next or previous page.
 void reset(boolean full)
          Reset component.
 void selectionDemand(LySelectionDemand demand)
          Invoked when an action occurs.
 int selectRow(LyFieldInfo fieldInfo, java.lang.String pattern, int from, boolean next, boolean substring, boolean caseSensitive)
          Select a row in the table for given parameters.
 void setClassFilter(LyFilter filter, boolean reset)
          Accessor on internal classFilter : filter always applied on data shown in view.
 boolean setContext(LyWorkSpace context)
          Set the current context for the controller.
 void setLastModified(long time)
          Accessor to set the last modification date of this controller.
 void setPage(int page)
          Set current page being displayed If this page is greater than the lastPage value, the method will take the page 'modulo' getLastPage() value.
 void setPrintMode(boolean status)
          (De)Activate print mode.
 void setSort(LySort sort)
          Set current sort criteria on the view.
 
Methods inherited from class leon.control.LyTableController
completeMessages, print, selectObject, selectObjects
 
Methods inherited from class leon.control.LySimpleTableController
allowSortOnField, buildRow, clearTranslatedStringMap, clearViewCache, dragDropDemand, enablesMultiSelection, endFastFilter, endSort, findObject, fixColumn, free, getBehaviorInterface, getClassFilter, getClassInfo, getColsNumberListDisplay, getColumnSize, getComplexFields, getContent, getFastFilterFieldInfo, getFastFilterValue, getFieldMarks, getFields, getLimit, getPanelComponent, getRealFields, getSelection, getSelection, getSort, getStatusFieldInfos, getTableComponent, getTableComponentFields, getTableComponentFields, hasDisplayListToggleButton, hasPrintMode, isDisplayList, isDisplayListShowFields, isFastFilterExtended, isFastFilterSet, isFopMode, isImageColumn, isStatusColumn, menuDemand, objectAdded, objectChanged, objectRemoved, objectStateChanged, printList, questionAnswer, run, selectAllObjects, selectObject, setFieldMarks, setFields, setFopMode, setPreference, showObject, translate
 
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, 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, 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.control.LyContextInterface
getContext
 
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

IMPACT_OUTSIDE_OF_CURRENT_VIEW

public static boolean IMPACT_OUTSIDE_OF_CURRENT_VIEW
AUTO SCROLL if create or remove outside of view. Warning : many events may cause scrollings


SELECT_PAGE

public static final java.lang.String SELECT_PAGE
Select page string

Constructor Detail

LyMultiPageTableController

public LyMultiPageTableController(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 this controller
context - current context (may be null if the view is not contextual to a list of objects).
Method Detail

hasViewLimit

public boolean hasViewLimit()
Indicates if the action has a view limit.

Returns:
true if the action has a view limit, false otherwise

isPaginated

public boolean isPaginated()
Indicates if there is a pagination on this table controller.

Returns:
true if a pagination is used, false otherwise

isDisplayPagesNumber

public boolean isDisplayPagesNumber()
Indicates if pages number must be displayed in select bar.

Returns:
true if pages number must be displayed, false otherwise

isDisplayNextPreviousTools

public boolean isDisplayNextPreviousTools()
Indicates whether previous / next tools must be added to the top toolbar.

Overrides:
isDisplayNextPreviousTools in class LyTableController
Returns:
true if the _limit parameter is set on this table, false otherwise

actionDemand

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

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

selectionDemand

public void selectionDemand(LySelectionDemand demand)
Invoked when an action occurs.

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

selectRow

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

Overrides:
selectRow in class LySimpleTableController
Parameters:
fieldInfo - the fieldInfo to select
pattern - the search pattern
from - the start index for the search
next - true to find next row, false for previous
substring - true to find in substring
caseSensitive - true for case sensitive search
Returns:
the index of the selected row, -1 if none has been found

loadPage

public void loadPage(boolean next)
Go to next or previous page.

Parameters:
next - true if we go to next page.

getPage

public int getPage()
Accessor the number (index) of the page being shown.

Returns:
the current page index, the first page is assumed at index 0.

setPage

public void setPage(int page)
Set current page being displayed If this page is greater than the lastPage value, the method will take the page 'modulo' getLastPage() value. (Circular).

Parameters:
page - current page we want to show

getLastPage

public int getLastPage()
Accessor the number of the last available page.

Returns:
page count of pages, the first page is assumed at index 1.

setLastModified

public void setLastModified(long time)
Accessor to set the last modification date of this controller. The modification date is updated when anything in the view has changed. The value should be (new Date()).getTime()

Overrides:
setLastModified in class LyController
Parameters:
time - the new modification time

setContext

public boolean setContext(LyWorkSpace context)
Set the current context for the controller. If the context is unchanged, this method just call the parent method. If there is a new context, this method defines the new page selected in this table : the 1st page.

Specified by:
setContext in interface LyContextInterface
Overrides:
setContext in class LyAreaController
Parameters:
context - Current context, or null if no context is set for the view
Returns:
true if successfull
See Also:
LyContextInterface.getContext()

setSort

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

Overrides:
setSort in class LySimpleTableController
Parameters:
sort - new sort criteria

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.

Overrides:
setClassFilter in class LySimpleTableController
Parameters:
filter - current 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.

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
Overrides:
setPrintMode in class LySimpleTableController
Parameters:
status - true if printing is active, false otherwise.

reset

public void reset(boolean full)
Reset component.

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

(c) January 2013 - W4 S.A.

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