LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.app.behaviorinterface
Interface LyTableBehaviorInterface

All Superinterfaces:
LyActionBehaviorInterface, LyBehaviorInterface, LyPanelBehaviorInterface
All Known Subinterfaces:
LyEditTableBehaviorInterface, LyImportTableBehaviorInterface
All Known Implementing Classes:
LyEditTableBehavior, LyImportTableBehavior, LySocialBehavior, LyTableBehavior

public interface LyTableBehaviorInterface
extends LyPanelBehaviorInterface

This interface defines methods to implement in order to modify the default behavior of a table controller.

See Also:
LyTableController

Field Summary
static java.lang.String __VERSION
          File version
 
Method Summary
 LyComponent buildRowItem(LySimpleTableController tableController, LyObject object, LyFieldInfo fieldInfo)
          Current builder of a new row item in a row.
 void completeRow(LySimpleTableController tableController, LyRow row, LyObject object)
          Completes the given row that corresponds to spécified object.
 void dragFinished(LySimpleTableController tableController, int type)
          Method called at the end of a drag-and-drop.
 void dragStart(LySimpleTableController tableController, LyObject sourceObject)
          Method invoked at the beginning of the given object drag.
 void drop(LySimpleTableController tableController, LyObject targetObject, LyObject sourceObject)
          Method called when the given dragged object is dropped on the given dropped object.
 boolean enableGroupBy(LySimpleTableController tableController, LyFieldInfo fieldInfo)
          Enables groupBy feature on given field info.
 java.lang.String getCellLabel(LySimpleTableController tableController, LyObject object, LyFieldInfo fieldInfo)
          Deprecated. Use updateCell(LySimpleTableController, LyCell, LyObject, LyFieldInfo) instead.
 java.lang.String getCellLabel(LySimpleTableController tableController, LyObject object, LyFieldInfo fieldInfo, java.lang.Object value)
          Gets the cell label representing the value of the given field info for the given object.
 LyInfoList<LyFieldInfo> getChooseColumnsFieldInfos(LySimpleTableController controller)
          Gets the list of fieldinfos that may be displayed in the column chooser tool.
 double getColumnWidth(LySimpleTableController controller, LyFieldInfo fieldInfo)
          Gets the initial column width of a fieldInfo in a table.
 LyWorkSpace getContent(LyTableController tableController, LyWorkSpace context)
          Gets the content of the table corresponding of the given context.
 LySortCriterion getDefaultCriterion(LySimpleTableController tableController, LyFieldInfo fieldInfo)
          Return default criterion for a given field info.
 LyInfoList<LyFieldInfo> getDependsFieldInfos(LySimpleTableController tableController, LyAction action)
          Gets the list of fieldinfos that will be used to compute/display values for the table.
 LyFileFieldInfo getDisplayListFirstImage(LySimpleTableController tableController)
          Gives the image to display in first column when display in list.
 LyInfoList<LyFieldInfo> getFields(LySimpleTableController tableController, LyInfoList<LyFieldInfo> fields)
          Gets the list of fields to display in the table from the given list.
 java.lang.String getFooterLabel(LySimpleTableController tableController, LyFieldInfo fieldInfo, LyObjectList objects)
          Gets the footer label associated to the given field info for the given list of objects presented in the table.
 java.lang.String getGroupColor(LySimpleTableController tableController, LyObject object, LyFieldInfoValue value)
          Gets row color associated to the given group.
 java.lang.String getGroupLabel(LySimpleTableController tableController, LyObject object, LyFieldInfoValue value)
          Gets group name for given value on specified object.
 java.lang.String getHeaderLabel(LySimpleTableController controller, LyFieldInfo fieldInfo)
          Gets the header label representing the given field info.
 java.lang.String getHeaderTooltip(LySimpleTableController controller, LyFieldInfo fieldInfo)
          Gets the header tooltip associated to the given field info.
 java.lang.String getIndex(LySimpleTableController tableController, LyObject object)
          Gets index for object.
 java.lang.String getLabel(LySimpleTableController tableController, LyObject object)
          Gets label for object.
 LyInfoList<LyFieldInfo> getLoadedFieldInfos(LySimpleTableController controller)
          Gets the list of fieldinfos that must be loaded in the given table controller.
 java.lang.String getRowColor(LySimpleTableController tableController, LyObject object)
          Gets row color associated to the given object.
 java.lang.String getRowImage(LySimpleTableController tableController, LyObject object)
          Gets the row image of the given table object used on display list mode.
 java.lang.String getStatusImage(LySimpleTableController tableController, LyInfoList<LyFieldInfo> statusFields, LyObject object)
          Gets the status image of the given table object.
 java.lang.String getStatusTooltip(LySimpleTableController tableController, LyInfoList<LyFieldInfo> statusFields, LyObject object)
          Gets status image tooltip for the given object.
 void selectionChanged(LySimpleTableController controller)
          Method called when the selection has changed in the view.
 void updateCell(LySimpleTableController tableController, LyCell cell, LyObject object, LyFieldInfo fieldInfo)
          Updates the label of the given cell for the given object and fieldinfo.
 void updateRowItem(LySimpleTableController tableController, LyComponent component, LyObject object, LyFieldInfo fieldInfo)
          Updates the given component for the given object and fieldinfo.
 LySort validateSort(LySimpleTableController tableController, LySort sort)
          Method used to enable a sort.
 
Methods inherited from interface leon.app.behaviorinterface.LyPanelBehaviorInterface
completePopupMenu, getPopupMenuActions, needRefresh, validateFilter
 
Methods inherited from interface leon.app.behaviorinterface.LyActionBehaviorInterface
endAction, getClientContext, getContextTitle, getHelpFile, getImage, getImageTooltip, getKeyValue, getMenuItemImage, getTitle, reset, startAction
 
Methods inherited from interface leon.app.behaviorinterface.LyBehaviorInterface
free, handleDemand, init
 

Field Detail

__VERSION

static final java.lang.String __VERSION
File version

See Also:
Constant Field Values
Method Detail

getFields

LyInfoList<LyFieldInfo> getFields(LySimpleTableController tableController,
                                  LyInfoList<LyFieldInfo> fields)
Gets the list of fields to display in the table from the given list.

Parameters:
tableController - the table controller that requires the list
fields - a list of fields from where fields to display are taken
Returns:
The list of fields to display in the table.

getStatusImage

java.lang.String getStatusImage(LySimpleTableController tableController,
                                LyInfoList<LyFieldInfo> statusFields,
                                LyObject object)
Gets the status image of the given table object.

Parameters:
tableController - Table controller that requires the status image.
statusFields - List of field infos that have the status mark.
object - Object to which the status image is associated.
Returns:
Path to the image file or the name of an image resource if found, null otherwise.

getStatusTooltip

java.lang.String getStatusTooltip(LySimpleTableController tableController,
                                  LyInfoList<LyFieldInfo> statusFields,
                                  LyObject object)
Gets status image tooltip for the given object.
This method is called only if the getStatusImage(LySimpleTableController, LyInfoList, LyObject) method didn't return null.

Parameters:
tableController - Table controller that requires the status image.
statusFields - List of field infos that have the status mark.
object - Object to which the status image is associated.
Returns:
String containing the tooltip associated to the status image.

getRowColor

java.lang.String getRowColor(LySimpleTableController tableController,
                             LyObject object)
Gets row color associated to the given object.

Parameters:
tableController - Table controller that requires the row color.
object - Object for which a row color is required.
Returns:
Color name or the name of a color resource if any, null otherwise.

getRowImage

java.lang.String getRowImage(LySimpleTableController tableController,
                             LyObject object)
Gets the row image of the given table object used on display list mode.

Parameters:
tableController - Table controller that requires the row image.
object - Object to which the row image is associated.
Returns:
Path to the image file or the name of an image resource if found, null otherwise.

getHeaderLabel

java.lang.String getHeaderLabel(LySimpleTableController controller,
                                LyFieldInfo fieldInfo)
Gets the header label representing the given field info.

Parameters:
controller - Table controller that requires the header label.
fieldInfo - Field info for which a header label is required.
Returns:
Label that will be put in the table header for the given field info.

getHeaderTooltip

java.lang.String getHeaderTooltip(LySimpleTableController controller,
                                  LyFieldInfo fieldInfo)
Gets the header tooltip associated to the given field info.

Parameters:
controller - Table controller that requires the header tooltip.
fieldInfo - Field info for which a header tooltip is required.
Returns:
Label that will be put in the table header tooltip corresponding to the given field info.

getCellLabel

java.lang.String getCellLabel(LySimpleTableController tableController,
                              LyObject object,
                              LyFieldInfo fieldInfo)
Deprecated. Use updateCell(LySimpleTableController, LyCell, LyObject, LyFieldInfo) instead.

Gets the cell label representing the value of the given field info for the given object.

Parameters:
tableController - Table controller that requires the cell label.
object - Object from which the field info value is represented in the table cell.
fieldInfo - Field info for which a cell label is required.
Returns:
Label that will be put in the table cell for the given object and field info (may be null).
See Also:
updateCell(LySimpleTableController,LyCell,LyObject,LyFieldInfo)

getCellLabel

java.lang.String getCellLabel(LySimpleTableController tableController,
                              LyObject object,
                              LyFieldInfo fieldInfo,
                              java.lang.Object value)
Gets the cell label representing the value of the given field info for the given object.

Parameters:
tableController - Table controller that requires the cell label.
object - Object from which the field info value is represented in the table cell.
fieldInfo - Field info for which a cell label is required.
value - Value of the given field.
Returns:
Label that will be put in the table cell for the given object and field info (may be null).
See Also:
updateCell(LySimpleTableController,LyCell,LyObject,LyFieldInfo)

updateCell

void updateCell(LySimpleTableController tableController,
                LyCell cell,
                LyObject object,
                LyFieldInfo fieldInfo)
Updates the label of the given cell for the given object and fieldinfo.

Parameters:
tableController - the table controller that requires the cell label
cell - the cell to update
object - the object from which the field info value is represented in the table cell
fieldInfo - the field info for which a cell label is required

getFooterLabel

java.lang.String getFooterLabel(LySimpleTableController tableController,
                                LyFieldInfo fieldInfo,
                                LyObjectList objects)
Gets the footer label associated to the given field info for the given list of objects presented in the table.

Parameters:
tableController - Table controller that requires the footer label.
fieldInfo - Field info for which a footer label is required.
objects - List of objects for which a footer label is computed.
Returns:
Label that will be put in the table footer that is corresponding to the given field info for the given list of objects.
See Also:
LyFieldInfo.compute(LyObjectList)

selectionChanged

void selectionChanged(LySimpleTableController controller)
Method called when the selection has changed in the view.

Parameters:
controller - the current table controller

getContent

LyWorkSpace getContent(LyTableController tableController,
                       LyWorkSpace context)
Gets the content of the table corresponding of the given context.
The workspace must be dynamic for dynamic table updates.
If the returned workspace is null, the controller computes the content itself.

Parameters:
tableController - Table controller that requires the content.
context - Context for which the content is required.
Returns:
the table content.

getLoadedFieldInfos

LyInfoList<LyFieldInfo> getLoadedFieldInfos(LySimpleTableController controller)
Gets the list of fieldinfos that must be loaded in the given table controller.
The default implementation returns all fieldinfos with the status mark and all fieldinfos that are displayed in the table.

Parameters:
controller - Table controller that requires the list.
Returns:
The list of fields info to load.

getDependsFieldInfos

LyInfoList<LyFieldInfo> getDependsFieldInfos(LySimpleTableController tableController,
                                             LyAction action)
Gets the list of fieldinfos that will be used to compute/display values for the table.
The default implementation returns the list of loaded fields.

Parameters:
tableController - the associated table controller
action - the table action
Returns:
a list of fieldinfos

getChooseColumnsFieldInfos

LyInfoList<LyFieldInfo> getChooseColumnsFieldInfos(LySimpleTableController controller)
Gets the list of fieldinfos that may be displayed in the column chooser tool.

Parameters:
controller - Table controller that requires the list.
Returns:
the list of fields to display in the column chooser tool or null to let the controller build this list.

getColumnWidth

double getColumnWidth(LySimpleTableController controller,
                      LyFieldInfo fieldInfo)
Gets the initial column width of a fieldInfo in a table.
The default implementation returns the "_colWidth" parameter from the table action.

Parameters:
controller - Table controller that requires the list.
fieldInfo - fieldInfo associated to this column.
Returns:
the size (unit = number of characters or ratio of the full table width) of the column or -1 (default) to compute automatically.

dragStart

void dragStart(LySimpleTableController tableController,
               LyObject sourceObject)
Method invoked at the beginning of the given object drag.

Parameters:
tableController - Table controller that displays the table
sourceObject - dragged object

drop

void drop(LySimpleTableController tableController,
          LyObject targetObject,
          LyObject sourceObject)
Method called when the given dragged object is dropped on the given dropped object.

Parameters:
tableController - table controller that displays the table
targetObject - object on where the dragged object is dropped
sourceObject - the dragged object

dragFinished

void dragFinished(LySimpleTableController tableController,
                  int type)
Method called at the end of a drag-and-drop.

Parameters:
tableController - table controller that displays the tree
type - drag-and-drop type (org.eclipse.swt.dnd.DND#DROP_COPY or org.eclipse.swt.dnd.DND#DROP_MOVE)

validateSort

LySort validateSort(LySimpleTableController tableController,
                    LySort sort)
Method used to enable a sort.

Parameters:
tableController - Table controller that asks for the sort.
sort - The sort that is asked.
Returns:
The enabled sort.

enableGroupBy

boolean enableGroupBy(LySimpleTableController tableController,
                      LyFieldInfo fieldInfo)
Enables groupBy feature on given field info.

Parameters:
tableController - Table controller that calls the checking.
fieldInfo - Field info that is checked for groupBy feature.
Returns:
True if enabled, false otherwise.

getGroupLabel

java.lang.String getGroupLabel(LySimpleTableController tableController,
                               LyObject object,
                               LyFieldInfoValue value)
Gets group name for given value on specified object.

Parameters:
tableController - Table controller that requires the group value label.
object - Object for which the group is requested.
value - Field value for which the group is requested.
Returns:
The group label for given value.

getGroupColor

java.lang.String getGroupColor(LySimpleTableController tableController,
                               LyObject object,
                               LyFieldInfoValue value)
Gets row color associated to the given group.

Parameters:
tableController - Table controller that requires the row color.
object - an object displayed in a group
value - the LyFieldInfoValue used to compute the group color
Returns:
Color name or the name of a color resource if any, null otherwise.

buildRowItem

LyComponent buildRowItem(LySimpleTableController tableController,
                         LyObject object,
                         LyFieldInfo fieldInfo)
Current builder of a new row item in a row.

Parameters:
tableController - Table controller that requires the new row item.
object - object added in the contextual list, and which should set the content of row cells.
fieldInfo - field value shown in the cell content
Returns:
LyCell or LyFieldItem the new Cell description (XML description) or editable content to add in the LyRow component.

updateRowItem

void updateRowItem(LySimpleTableController tableController,
                   LyComponent component,
                   LyObject object,
                   LyFieldInfo fieldInfo)
Updates the given component for the given object and fieldinfo.

Parameters:
tableController - the table controller that requires the update
component - the component to update.
object - the object from which the field info value is represented in the table.
fieldInfo - the field info for which a component is updated.

completeRow

void completeRow(LySimpleTableController tableController,
                 LyRow row,
                 LyObject object)
Completes the given row that corresponds to spécified object.

Parameters:
tableController - the table controller that requires the completion.
row - the row to be completed.
object - the object that corresponds to the row.

getDisplayListFirstImage

LyFileFieldInfo getDisplayListFirstImage(LySimpleTableController tableController)
Gives the image to display in first column when display in list.

Parameters:
tableController - the table controller.
Returns:
a LyFileFieldInfo which contains the image else return null

getLabel

java.lang.String getLabel(LySimpleTableController tableController,
                          LyObject object)
Gets label for object.

Parameters:
tableController - the table controller.
object - Object for which the label is requested.
Returns:
The label for given object.

getIndex

java.lang.String getIndex(LySimpleTableController tableController,
                          LyObject object)
Gets index for object.

Parameters:
tableController - the table controller.
object - Object for which the index is requested.
Returns:
The index for given object.

getDefaultCriterion

LySortCriterion getDefaultCriterion(LySimpleTableController tableController,
                                    LyFieldInfo fieldInfo)
Return default criterion for a given field info. If no default sort is defined on the class, return null.

Parameters:
tableController - the table controller.
fieldInfo - the field info we want to get the criterion
Returns:
the default sort criterion for the given field info

(c) January 2013 - W4 S.A.

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