|
|
|||||
| Package com.dassault_systemes.catjdialog |
Class CATKeyTableModel
|
| Class Hierarchy |
java.lang.Object
|
+-com.dassault_systemes.catjdialog.CATCallbackSource
|
+-com.dassault_systemes.catjdialog.CATKeyTableModel
| Class Location |
| Class Description |
public abstract class CATKeyTableModel
The key table model is the interface used to feed a table component with content.
This design allows JDialog to request presentation data only when rendering the tree or table component to the Graphical User Interface (GUI), and to forget it right after that.
Example: a Table with a CATKeyTableModel and a controller listening to cell selection notifications
All Implemented Interfaces: CATRequestListener
| Field Summary |
| public static final int | ALIGN_CENTER
Column alignment: center |
| public static final int | ALIGN_LEFT
Column alignment: left |
| public static final int | ALIGN_RIGHT
Column alignment: right |
| public static final int | LINKTARGET_CURRENTFRAME
Link Target: opens the link in the current frame |
| public static final int | LINKTARGET_NAMEDFRAME
Link Target: opens the link in a window with a named specified by getLinkTargetFrame() |
| public static final int | LINKTARGET_NEWWINDOW
Link Target: opens the link in a new window |
| public static final int | LINKTARGET_PARENTFRAME
Link Target: opens the link in the parent frame |
| public static final int | LINKTARGET_TOPFRAME
Link Target: opens the link in the top frame |
| public static final int | STATE3_CHECKED
tCHECK3STATE cell state: checked |
| public static final int | STATE3_UNCHECKED
tCHECK3STATE cell state: unchecked |
| public static final int | STATE3_UNDEFINED
tCHECK3STATE cell state: undefined |
| public static final int | tACTIONLINK
cell type: is an action link (that is an internal link) |
| public static final int | tCHECK
cell type: has a checkbox |
| public static final int | tCHECK3STATE
cell type: has a 3 states checkbox |
| public static final int | tEDITABLE
cell type: is editable |
| public static final int | tIMAGE
cell type: has an image |
| public static final int | tLINK
cell type: is an external link (web link to an outer URL) |
| public static final int | tRADIO
cell type: has a radio-button |
| public static final int | TRUNCATE_CELL_POPUP_POLICY
Cell Truncate Policy: truncate cell (add '...') and show full cell text into a popup |
| public static final int | TRUNCATE_ROW_POPUP_POLICY
Cell Truncate Policy: truncate cell (add '...') and show full row text into a popup |
| public static final int | TRUNCATE_USER_POLICY
Cell Truncate Policy: use user preference |
| public static final int | tSTRING
cell type: simple text |
| public static final int | WRAP_POLICY
Cell Truncate Policy: wrap cell text if wider than defined |
| Constructor Summary |
| CATKeyTableModel()
|
| Method Summary |
| public int | get3State(String iKey, int iColumn)
Returns the state of the specified 3 state checkbox cell (default state is STATE3_UNCHECKED). |
| public String | getAdvancedFilterEditor(int iColumn)
Returns the Advanced filter editor for the given column. |
| public abstract String | getCell(String iKey, int iColumn)
Returns the text label of the specified cell. |
| public int | getCellTruncatePolicy(CATTable iTable)
Returns the cell truncate policy to apply to the specified table. |
| public int | getColumnAlignment(int iColumn)
Returns the alignment type for the specified column (default is ALIGN_LEFT). |
| public abstract int | getColumnCount()
Returns the number of columns the table should display. |
| public abstract String | getColumnTitle(int iColumn)
Returns a column title. |
| public int | getColumnWidth(int iColumn)
Returns the column width (in characters). |
| public boolean | getEnable(String iKey, int iColumn)
Determines whether the specified cell is enabled or not (default is true). |
| public String | getImage(String iKey, int iColumn)
Returns the image URL of the specified cell (default is null). |
| public String | getImageTooltip(String iKey, int iColumn)
Return the image tooltip of the specified cell (default is null). |
| public abstract int | getKeyCount()
Returns the total number of keys (each key is displayed in a table row). |
| public abstract void | getKeys(int iOffset, String[] oKeys)
To get a bunch of keys starting from an offset. |
| public int | getLevel(String iKey, int iColumn)
Returns the text level of the specified cell (default level is 0). |
| public String | getLink(String iKey, int iColumn)
Returns the web link URL of the specified cell (default is null). |
| public int | getLinkTarget(String iKey, int iCol)
Returns the link target window of the specified cell (default is LINKTARGET_CURRENTFRAME). |
| public String | getLinkTargetFrame(String iKey, int iCol)
Returns the link target window name of the specified cell (default is LINKTARGET_CURRENTFRAME). |
| public boolean | getState(String iKey, int iColumn)
Returns the check/radio state of the specified cell (default state is false). |
| public String | getTablePrefsRepository(CATTable iTable)
Returns the repository name for the table preferences (default is null). |
| public String | getTooltip(String iKey, int iColumn)
Returns the tooltip of the image of the specified cell (default is null). |
| public int | getType(String iKey, int iColumn)
Returns the type of the specified cell. |
| public void | giveDisplayedColumns(CATTable iTable, int[] iColumns)
Performance optimization call. |
| public boolean | isColumnFilterable(int iColumn)
Determines whether if this column is filterable or not. |
| public boolean | isColumnSortable(int iColumn)
Determines whether the specified column is sortable or not. |
| public boolean | isListExportable()
Determines whether the table content should be exportable (to an Excel spreadsheet). |
| public void | refreshContent()
Call this method to request a refresh of the display because the content of the list has changed. |
| public void | setCell(String iKey, int iCol, String iText)
Warns the table model that the specified cell was edited. |
| Field Detail |
public static final int ALIGN_CENTER
Column alignment: center
public static final int ALIGN_LEFT
Column alignment: left
public static final int ALIGN_RIGHT
Column alignment: right
public static final int LINKTARGET_CURRENTFRAME
Link Target: opens the link in the current frame
public static final int LINKTARGET_NAMEDFRAME
Link Target: opens the link in a window with a named specified by getLinkTargetFrame()
public static final int LINKTARGET_NEWWINDOW
Link Target: opens the link in a new window
public static final int LINKTARGET_PARENTFRAME
Link Target: opens the link in the parent frame
public static final int LINKTARGET_TOPFRAME
Link Target: opens the link in the top frame
public static final int STATE3_CHECKED
tCHECK3STATE cell state: checked
public static final int STATE3_UNCHECKED
tCHECK3STATE cell state: unchecked
public static final int STATE3_UNDEFINED
tCHECK3STATE cell state: undefined
public static final int tACTIONLINK
cell type: is an action link (that is an internal link)
public static final int tCHECK
cell type: has a checkbox
public static final int tCHECK3STATE
cell type: has a 3 states checkbox
public static final int tEDITABLE
cell type: is editable
public static final int tIMAGE
cell type: has an image
public static final int tLINK
cell type: is an external link (web link to an outer URL)
public static final int tRADIO
cell type: has a radio-button
public static final int TRUNCATE_CELL_POPUP_POLICY
Cell Truncate Policy: truncate cell (add '...') and show full cell text into a popup
public static final int TRUNCATE_ROW_POPUP_POLICY
Cell Truncate Policy: truncate cell (add '...') and show full row text into a popup
public static final int TRUNCATE_USER_POLICY
Cell Truncate Policy: use user preference
public static final int tSTRING
cell type: simple text
public static final int WRAP_POLICY
Cell Truncate Policy: wrap cell text if wider than defined
| Constructor Detail |
CATKeyTableModel()
| Method Detail |
public int get3State(String iKey, int iColumn)
Returns the state of the specified 3 state checkbox cell (default state is STATE3_UNCHECKED).
This method is called for tCHECK3STATE cell types.
iKeyiColumn
public String getAdvancedFilterEditor(int iColumn)
Returns the Advanced filter editor for the given column.
This method only applies to filterable columns. It returns the advanced editor command name (may be null). A null value unsets the advanced editor (filter is only editable through a basic textfield). A non-null value shows an "advanced filter" button that launches the given JDialog command when pressed.
iColumn
public abstract String getCell(String iKey, int iColumn)
Returns the text label of the specified cell.
This method is called for every cell type.
iKeyiColumn
public int getCellTruncatePolicy(CATTable iTable)
Returns the cell truncate policy to apply to the specified table. Default value is TRUNCATE_USER_POLICY.
This setting has an effect only in non-null sized columns.
iTable
public int getColumnAlignment(int iColumn)
Returns the alignment type for the specified column (default is ALIGN_LEFT).
This parameter aligns text in the column.
iColumn
public abstract int getColumnCount()
Returns the number of columns the table should display.
public abstract String getColumnTitle(int iColumn)
Returns a column title.
iColumn
public int getColumnWidth(int iColumn)
Returns the column width (in characters).
A negative value means a fixed width column,
A null value means unconstained column width
A positive value means minimum column width, assuming it will spread on extra space (divided evenly among all positive width columns).
Default value is 0 (unconstained column width).
Every non-null value will cause wide cells to be "truncated". The truncate behavior is defined by getCellTruncatePolicy().
iColumn
public boolean getEnable(String iKey, int iColumn)
Determines whether the specified cell is enabled or not (default is true).
This method is called for tCHECK, tRADIO, tLINK and tACTIONLINK cell types.
iKeyiColumn
public String getImage(String iKey, int iColumn)
Returns the image URL of the specified cell (default is null).
This method is called for tIMAGE cell types.
iKeyiColumnresources/graphic directory of the runtime view, or an absolute URL to the image.
public String getImageTooltip(String iKey, int iColumn)
Return the image tooltip of the specified cell (default is null).
This method is called for tIMAGE cell types.
iKeyiColumn
public abstract int getKeyCount()
Returns the total number of keys (each key is displayed in a table row).
public abstract void getKeys(int iOffset, String[] oKeys)
To get a bunch of keys starting from an offset.
The table component only displays a slice of data. This method retreives only a slice.
iOffsetoKeys
public int getLevel(String iKey, int iColumn)
Returns the text level of the specified cell (default level is 0).
This method is called for every cell type.
iKeyiColumn
public String getLink(String iKey, int iColumn)
Returns the web link URL of the specified cell (default is null).
This method is called for tLINK cell types.
iKeyiColumn
public int getLinkTarget(String iKey, int iCol)
Returns the link target window of the specified cell (default is LINKTARGET_CURRENTFRAME).
This method is called for tLINK cell types, and defines the link target window.
iKeyiColumn
public String getLinkTargetFrame(String iKey, int iCol)
Returns the link target window name of the specified cell (default is LINKTARGET_CURRENTFRAME).
This method is called for tLINK cell types, that declared a link target LINKTARGET_NAMEDFRAME.
iKeyiColumn
public boolean getState(String iKey, int iColumn)
Returns the check/radio state of the specified cell (default state is false).
This method is called for tCHECK and tRADIO cell types.
iKeyiColumn
public String getTablePrefsRepository(CATTable iTable)
Returns the repository name for the table preferences (default is null).
When returning a non-null repository name for the table activates a "preferences" link
that gives access to customization: reordering, showing/hiding columns and modifying their width.
Possible formats for preferences repository names are:
iTable
public String getTooltip(String iKey, int iColumn)
Returns the tooltip of the image of the specified cell (default is null).
This method is called for tIMAGE cell types.
iKeyiColumn
public int getType(String iKey, int iColumn)
Returns the type of the specified cell. Default is tSTRING (simple text cell).
iKeyiColumn
public void giveDisplayedColumns(CATTable iTable, int[] iColumns)
Performance optimization call.
This method is called once per request before rendering the table.
It passes to the model the displayed columns, so that the database query may be optimized.
This method is called before getKeys().
iTableiColumns
public boolean isColumnFilterable(int iColumn)
Determines whether if this column is filterable or not.
Defining a column as filterable will display a filter button in the column title, and will have the table component manage the filter requests from the user.
iColumntrue if the column is filterable, false otherwise.
public boolean isColumnSortable(int iColumn)
Determines whether the specified column is sortable or not. Default is false (not sortable).
Defining a column as sortale will display sort button in the column title, and will have the table component manage the sort requests from the user.
iColumntrue if the column is sortable, false otherwise.
public boolean isListExportable()
Determines whether the table content should be exportable (to an Excel spreadsheet). Default is false.
Override this method to add an "export" link in the table that will automatically manage the export to a spreadsheet file.
true if this table should an "export" link; false otherwise.
public void refreshContent()
Call this method to request a refresh of the display because the content of the list has changed.
public void setCell(String iKey, int iCol, String iText)
Warns the table model that the specified cell was edited.
This method is called for tEDITABLE cell types, when the user edits its value.
Override this method to handle cell editions at the table model level.
Overwise you can handle it though the CATTable 'CellChanged' Notification.
iKeyiColumniText