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
public static final int CELL_SELECTION_MODE
Selection Mode: Cell
public static final int LINE_SELECTION_MODE
Selection Mode: Row
public static final int NO_SELECTION_MODE
Selection Mode: None

Constructor Summary
CATTable(CATDialog iDialog, String iName)
Creates a table with the specified parent and name.

Method Summary
public static int advEditorGetColumn(CATDialog iFrom)
This is a helper method that allows Advanced Filter Editors to retrieve the related table column.
public static String advEditorGetCurFilterValue(CATDialog iFrom)
This is a helper method that allows Advanced Filter Editors to retrieve the filter value.
public static CATTable advEditorGetTable(CATDialog iFrom)
This is a helper method that allows Advanced Filter Editors to retrieve the related CATTable component.
public static 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.
public CATCellActionNotification getActionLinkNotification()
Returns the action link notification.
public CATCellActionNotification getCellActionNotification()
Returns the cell action notification.
public CATCellChangedNotification getCellChangedNotification()
Returns the cell changed notification.
public CATNotification getCellSelectNotification()
Returns the cell selection notification.
public CATNotification getColumnSortNotification()
Returns the column sort notification.
public String getFilter(int iColumn)
Returns the filter string associated to the given column.
public int getFirstLine()
Returns the first line to be displayed.
public int getHeight()
Returns the maximum number of lines to display.
public CATKeyTableModel getKeyModel()
Returns the key table model (may be null).
public CATColumnSort getLastSort()
Returns the most recent sort (if any).
public int getLineGroup()
Returns the line groups size (used to visually group a set of lines).
public CATMenuModel getMenu(Object iContext)
Returns the menu model defining the table contextual menu (may be null).
public CATMenuNotification getMenuNotification()
Returns the menu notification.
public int getMinWidth()
Returns the table minimum width (in characters).
public String getModelURL()
Returns the key table model URL (if any).
public boolean getMultipleSelection()
Determines whether multiple selection is allowed or not.
public CATNotification getRowSelectNotification()
Returns the row selection notification.
public String[] getSelectedKeys()
Returns the selected rows keys.
public CATCellSelection getSelection()
Returns the current selected cell.
public int getSelectionMode()
Returns the selection mode (default is CELL_SELECTION_MODE).
public CATColumnSort[] getSortHistory()
Returns the sort history (may be null).
public CATMenuModel getToolbar()
Returns the menu model defining the table toolbar content.
public CATMenuNotification getToolbarNotification()
Returns the toolbar notification.
public boolean hasMenu()
Determines whether this table has a contextual menu.
public boolean isKeySelected(String iKey)
Determines whether the row is selected or not (from its key).
public void resetFilters()
Unsets all filter values.
public void setFirstLine(int iFirstLine)
Sets the first line to be displayed.
public void setHeight(int iHeight)
Sets the maximum number of lines the table can display.
public void setKeyModel(CATKeyTableModel iModel)
Sets the key table model (a null value unsets the table model).
public void setLineGroup(int iGroup)
Sets the line groups size (to visually group a set of lines).
public void setMinWidth(int iMinWidth)
Sets the table minimum width (in characters).
public void setModelURL(String iModelURL)
Sets the key table model URL.
public void setMultipleSelection(boolean iMultiple)
Enables/disables multipe selection.
public void setSelectedKeys(String[] iSelection)
Sets selected rows from their keys.
public void setSelection(CATCellSelection iSelection)
Sets the current selected cell.
public void setSelectionMode(int iSelect)
Sets the selection mode.
public void setToolbar(CATMenuModel iToolbar)
Sets the menu model defining the table toolbar content.
public void sort(int iColumn, boolean iAscending)
Requests a sort on the specified column.


Field Detail

CELL_SELECTION_MODE

    public static final int CELL_SELECTION_MODE
Selection Mode: Cell


LINE_SELECTION_MODE

    public static final int LINE_SELECTION_MODE
Selection Mode: Row


NO_SELECTION_MODE

    public static final 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

advEditorGetColumn

    public static 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.
Return:
The table column whose the advanced editor is being editing a filter.

advEditorGetCurFilterValue

    public static 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.
Return:
The column filter value that the advanced editor is being editing.

advEditorGetTable

    public static 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.
Return:
The table component whose the advanced editor is being editing a filter.

advEditorSetFilterValue

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

getActionLinkNotification

    public CATCellActionNotification getActionLinkNotification()

Returns the action link notification.

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

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

getCellActionNotification

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

Return:
The cell action notification.

getCellChangedNotification

    public CATCellChangedNotification getCellChangedNotification()

Returns the cell changed notification.

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

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

getCellSelectNotification

    public CATNotification getCellSelectNotification()

Returns the cell selection notification.

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

Return:
The cell selection notification.

getColumnSortNotification

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

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

getFilter

    public String getFilter(int iColumn)

Returns the filter string associated to the given column.

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

getFirstLine

    public int getFirstLine()

Returns the first line to be displayed.

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

getHeight

    public 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())

Return:
The maximum number of lines to display.

getKeyModel

    public CATKeyTableModel getKeyModel()

Returns the key table model (may be null).

Return:
The key table model if any.

getLastSort

    public CATColumnSort getLastSort()

Returns the most recent sort (if any).

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

getLineGroup

    public int getLineGroup()

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

Return:
The line groups size.

getMenu

    public 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

getMenuNotification

    public CATMenuNotification getMenuNotification()

Returns the menu notification.

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

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

getMinWidth

    public int getMinWidth()

Returns the table minimum width (in characters).

Return:
The minimum width in characters.

getModelURL

    public String getModelURL()

Returns the key table model URL (if any).

Return:
The key table model URL if any.

getMultipleSelection

    public boolean getMultipleSelection()

Determines whether multiple selection is allowed or not.

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

getRowSelectNotification

    public CATNotification getRowSelectNotification()

Returns the row selection notification.

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

Return:
The row selection notification.

getSelectedKeys

    public String[] getSelectedKeys()

Returns the selected rows keys.

This method is reserved for LINE_SELECTION_MODE with multiple selection.

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

getSelection

    public CATCellSelection getSelection()

Returns the current selected cell.

This method is reserved for CELL_SELECTION_MODE with single selection.

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

getSelectionMode

    public int getSelectionMode()

Returns the selection mode (default is CELL_SELECTION_MODE).

Return:
The selection mode.

getSortHistory

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

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

getToolbar

    public CATMenuModel getToolbar()

Returns the menu model defining the table toolbar content.

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

getToolbarNotification

    public CATMenuNotification getToolbarNotification()

Returns the toolbar notification.

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

Return:
The toolbar notification.

hasMenu

    public boolean hasMenu()

Determines whether this table has a contextual menu.

This checks that the table model is of type CATKeyTableModelCtxMenuEx

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

isKeySelected

    public 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.
Return:
true if the row is selected, false otherwise.

resetFilters

    public void resetFilters()

Unsets all filter values.


setFirstLine

    public void setFirstLine(int iFirstLine)

Sets the first line to be displayed.

Parameters:
iFirstLine
The line number to display first.

setHeight

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

setKeyModel

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

setLineGroup

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

setMinWidth

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

setModelURL

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

setMultipleSelection

    public void setMultipleSelection(boolean iMultiple)

Enables/disables multipe selection.

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

setSelectedKeys

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

setSelection

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

setSelectionMode

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

setToolbar

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

sort

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


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