Package com.dassault_systemes.catjdialog

   
Class CATTable

 
Class Hierarchy
java.lang.Object
  |
  +-com.dassault_systemes.catjdialog.CATCallbackSource
        |
        +-com.dassault_systemes.catjdialog.CATDialog
              |
              +-com.dassault_systemes.catjdialog.CATTable
Class Location

Framework : CATJDialog

Module : CATJDialog

Class Description

public class CATTable

The table graphical component.

Description:

This component presents data in a two-dimensional table format.
It has the following features: The table component should be feeded with presentation data by a data model (see CATKeyTableModel).

CATTable Properties:

CATTable Notifications:

   All Implemented Interfaces:
CATIMenuProvider
CATIMenuFirer
See Also:
CATKeyTableModel
Field Summary
int CELL_SELECTION_MODE
int LINE_SELECTION_MODE
int NO_SELECTION_MODE

Constructor Summary
CATTable(CATDialog iDialog, String iName)

Method Summary
void setKeyModel(CATKeyTableModel iModel)
void setModelURL(String iModelURL)
String getModelURL()
CATKeyTableModel getKeyModel()
void setLineGroup(int iGroup)
int getLineGroup()
void setMinWidth(int iMinWidth)
int getMinWidth()
int getFirstLine()
void setFirstLine(int iFirstLine)
int getHeight()
void setHeight(int iHeight)
boolean hasMenu()
CATMenuModel getMenu(Object iContext)
CATMenuModel getToolbar()
void setToolbar(CATMenuModel iToolbar)
int getSelectionMode()
void setSelectionMode(int iSelect)
void setMultipleSelection(boolean iMultiple)
boolean getMultipleSelection()
CATCellSelection getSelection()
void setSelection(CATCellSelection iSelection)
String[] getSelectedKeys()
void setSelectedKeys(String[] iSelection)
boolean isKeySelected(String iKey)
CATColumnSort[] getSortHistory()
CATColumnSort getLastSort()
String getFilter(int iColumn)
void resetFilters()
CATTable advEditorGetTable(CATDialog iFrom)
int advEditorGetColumn(CATDialog iFrom)
String advEditorGetCurFilterValue(CATDialog iFrom)
void advEditorSetFilterValue(CATDialog iFrom, String iFilter)
void sort(int iColumn, boolean iAscending)
CATNotification getCellSelectNotification()
CATNotification getRowSelectNotification()
CATCellActionNotification getCellActionNotification()
CATCellActionNotification getActionLinkNotification()
CATMenuNotification getMenuNotification()
CATMenuNotification getToolbarNotification()
CATNotification getColumnSortNotification()
CATCellChangedNotification getCellChangedNotification()


Field Detail

CELL_SELECTION_MODE

    int CELL_SELECTION_MODE
Selection Mode: Cell


LINE_SELECTION_MODE

    int LINE_SELECTION_MODE
Selection Mode: Row


NO_SELECTION_MODE

    int NO_SELECTION_MODE
Selection Mode: None


Constructor Detail

CATTable

    CATTable(CATDialog iDialog, String iName)

Creates a table with the specified parent and name.

Parameters:
iParent
The parent component.
iName
This table name. Here are some rules for this name:
  • It is set in the constructor, and cannot be changed afterwards.
  • The name must be unique for the parent (2 children with the same name are not allowed).
  • The name may not contain any ot the following characters: '.' (dot), ' ' (blank), '_' (underscore)

Method Detail

setKeyModel

    void setKeyModel(CATKeyTableModel iModel)

Sets the key table model (a null value unsets the table model).

The table model is in charge of feeding the table with presentation data.
When no table model is defined (the default case), the table is not displayed.

Parameters:
iModel
The key table model object (a null value unsets the table model).

setModelURL

    void setModelURL(String iModelURL)

Sets the key table model URL.

The expected format is: <model classname>@<arg1>,<arg2>,...
<model classname> must have a constructor with the following signature:
    void <Constructor>(CATDialog iDialog, String[] iArgs)

Note: This method allows to set the table key model inline in the XMLDlg file.
Example: <Table Name="mytable" ModelURL="com.mypackage.MyTableKeyModel@myarg"...

Parameters:
iModelURL
The key table model URL (a null value unsets the table model).

getModelURL

    String getModelURL()

Returns the key table model URL (if any).

Returns:
The key table model URL if any.

getKeyModel

    CATKeyTableModel getKeyModel()

Returns the key table model (may be null).

Returns:
The key table model if any.

setLineGroup

    void setLineGroup(int iGroup)

Sets the line groups size (to visually group a set of lines). Default is 1.

Parameters:
iGroup
The line groups size.

getLineGroup

    int getLineGroup()

Returns the line groups size (used to visually group a set of lines).

Returns:
The line groups size.

setMinWidth

    void setMinWidth(int iMinWidth)

Sets the table minimum width (in characters). Default min width is 12.

This is used to ensure a minimum width to the table component.

Parameters:
iMinWidth
The minimum width in characters.

getMinWidth

    int getMinWidth()

Returns the table minimum width (in characters).

Returns:
The minimum width in characters.

getFirstLine

    int getFirstLine()

Returns the first line to be displayed.

Returns:
The first displayed line number (starts at 0).

setFirstLine

    void setFirstLine(int iFirstLine)

Sets the first line to be displayed.

Parameters:
iFirstLine
The line number to display first.

getHeight

    int getHeight()

Returns the maximum number of lines to display.

The table component splits content data into slices, and provides previous/next buttons to navigate across data slices.
The user might override this value if the table allows customization (see CATKeyTableModel.getTablePrefsRepository())

Returns:
The maximum number of lines to display.

setHeight

    void setHeight(int iHeight)

Sets the maximum number of lines the table can display. Default is 12.

Parameters:
iHeight
The maximum number of lines the table can display.

hasMenu

    boolean hasMenu()

Determines whether this table has a contextual menu.

This checks that the table model is of type CATKeyTableModelCtxMenuEx

Returns:
true if this table has a menu, false otherwise.
See Also:
CATIMenuProvider#hasMenu()
CATKeyTableModelCtxMenuEx

getMenu

    CATMenuModel getMenu(Object iContext)

Returns the menu model defining the table contextual menu (may be null).

Invokes the menu from the table model (CATKeyTableModelCtxMenuEx.getContextualMenu())

Parameters:
iContext
The menu context object. With key table models, this is a CATCellSelection object.
See Also:
CATIMenuProvider#getMenu(Object)
CATKeyTableModelCtxMenuEx

getToolbar

    CATMenuModel getToolbar()

Returns the menu model defining the table toolbar content.

Returns:
The menu model defining the table toolbar content. A null value means "no toolbar".

setToolbar

    void setToolbar(CATMenuModel iToolbar)

Sets the menu model defining the table toolbar content.

Parameters:
iToolbar
The menu model defining the table toolbar content. A null value unsets the toolbar.

getSelectionMode

    int getSelectionMode()

Returns the selection mode (default is CELL_SELECTION_MODE).

Returns:
The selection mode.

setSelectionMode

    void setSelectionMode(int iSelect)

Sets the selection mode.

Note:

Parameters:
iSelect
The new selection mode (NO_SELECTION_MODE=0, CELL_SELECTION_MODE=1 or LINE_SELECTION_MODE=2).

setMultipleSelection

    void setMultipleSelection(boolean iMultiple)

Enables/disables multipe selection.

Parameters:
iMultiple
true to enable multiple selection, false to have only single selection.

getMultipleSelection

    boolean getMultipleSelection()

Determines whether multiple selection is allowed or not.

Returns:
true means multiple selection is enable, false means only single selection.

getSelection

    CATCellSelection getSelection()

Returns the current selected cell.

This method is reserved for CELL_SELECTION_MODE with single selection.

Returns:
The cell selection object that identifies the cell (may be null).

setSelection

    void setSelection(CATCellSelection iSelection)

Sets the current selected cell.

This method is reserved for CELL_SELECTION_MODE with single selection.

Parameters:
iSelection
The cell selection object that identifies the cell (a null value unsets selection).

getSelectedKeys

    String[] getSelectedKeys()

Returns the selected rows keys.

This method is reserved for LINE_SELECTION_MODE with multiple selection.

Returns:
The string array of selected row keys. A null value means "empty selection".

setSelectedKeys

    void setSelectedKeys(String[] iSelection)

Sets selected rows from their keys.

This method is reserved for LINE_SELECTION_MODE with multiple selection.

Parameters:
iSelection
A string array of row keys to select. A null value empties the selection.

isKeySelected

    boolean isKeySelected(String iKey)

Determines whether the row is selected or not (from its key).

This method is reserved for LINE_SELECTION_MODE (single and multiple selection)).

Parameters:
iKey
The row's key.
Returns:
true if the row is selected, false otherwise.

getSortHistory

    CATColumnSort[] getSortHistory()

Returns the sort history (may be null).

The first CATColumnSort object is the most recent sort request. The last one is the oldest.
The sort history may be null if no sort request was made by the user yet.

Returns:
An array giving the sort requests history from the user (may be null).

getLastSort

    CATColumnSort getLastSort()

Returns the most recent sort (if any).

Returns:
The most recent sort (may be null).

getFilter

    String getFilter(int iColumn)

Returns the filter string associated to the given column.

Parameters:
iColumn
The column's index.
Returns:
The column's filter value.

resetFilters

    void resetFilters()

Unsets all filter values.


advEditorGetTable

    CATTable advEditorGetTable(CATDialog iFrom)

This is a helper method that allows Advanced Filter Editors to retrieve the related CATTable component.

Parameters:
iFrom
Any component from the advanced editor.
Returns:
The table component whose the advanced editor is being editing a filter.

advEditorGetColumn

    int advEditorGetColumn(CATDialog iFrom)

This is a helper method that allows Advanced Filter Editors to retrieve the related table column.

Parameters:
iFrom
Any component from the advanced editor.
Returns:
The table column whose the advanced editor is being editing a filter.

advEditorGetCurFilterValue

    String advEditorGetCurFilterValue(CATDialog iFrom)

This is a helper method that allows Advanced Filter Editors to retrieve the filter value.

Parameters:
iFrom
Any component from the advanced editor.
Returns:
The column filter value that the advanced editor is being editing.

advEditorSetFilterValue

    void advEditorSetFilterValue(CATDialog iFrom, String iFilter)

This is a helper method that allows Advanced Filter Editors to set a new filter value when the user is done with edition.

Parameters:
iFrom
Any component from the advanced editor.
iFilter
The new filter value to set.

sort

    void sort(int iColumn, boolean iAscending)

Requests a sort on the specified column.

Appends the sort request into the sort history.

Parameters:
iColumn
The column's index.
iAscending
The sorting order.

getCellSelectNotification

    CATNotification getCellSelectNotification()

Returns the cell selection notification.

This notification is sent when one or more cells are selected (only in CELL_SELECTION_MODE).

Returns:
The cell selection notification.

getRowSelectNotification

    CATNotification getRowSelectNotification()

Returns the row selection notification.

This notification is sent when one or more rows are selected (only in LINE_SELECTION_MODE).

Returns:
The row selection notification.

getCellActionNotification

    CATCellActionNotification getCellActionNotification()

Returns the cell action notification.

This notification is sent when a cell is clicked in NO_SELECTION_MODE, or doubled-clicked in CELL_SELECTION_MODE or LINE_SELECTION_MODE.

Returns:
The cell action notification.

getActionLinkNotification

    CATCellActionNotification getActionLinkNotification()

Returns the action link notification.

This notification is sent when a cell that is of type CATKeyTableModel.tACTIONLINK is clicked.

Returns:
The action link notification.
See Also:
CATKeyTableModel#getType(String, int)

getMenuNotification

    CATMenuNotification getMenuNotification()

Returns the menu notification.

This notification is sent when a contextual menu command is triggered.

Returns:
The menu notification.
See Also:
CATIMenuProvider#getMenuNotification()

getToolbarNotification

    CATMenuNotification getToolbarNotification()

Returns the toolbar notification.

This notification is sent when an active toolbar button is pressed.

Returns:
The toolbar notification.

getColumnSortNotification

    CATNotification getColumnSortNotification()

Returns the column sort notification.

This notification is sent each time the user makes a sort request on a column.
The application should not require this notification since the last sort and sort history are always available as a table property (so the table model should always take care of them).

Returns:
The column sort notification.
See Also:
CATKeyTableModel#isColumnSortable(int)

getCellChangedNotification

    CATCellChangedNotification getCellChangedNotification()

Returns the cell changed notification.

This notification is sent when the user changes an editable cell content.

Returns:
The cell changed notification.
See Also:
CATKeyTableModel#getType(String, int)
CATKeyTableModel#setCell(String, int, String)


Copyright © 2000, Dassault Systèmes. All rights reserved