at.spardat.xma.mdl.table
Interface ITableWMClient

All Superinterfaces:
ISelectable, ITableWM, IWModelClient
All Known Implementing Classes:
TableWMClient

public interface ITableWMClient
extends ITableWM, IWModelClient

Programmers interface to an direct table widget model at the client.


Field Summary
static int S_NON_SORTABLE
          Indicates that non of the table rows may be sorted.
 
Fields inherited from interface at.spardat.xma.mdl.table.ITableWM
S_LAST, S_MULTI_SELECT, S_ONE_WAY
 
Method Summary
 XMATableColumn getColumn(int i)
          Returns the column at the provided zero based index.
 at.spardat.enterprise.fmt.IFmt getFormatter(int columnIndex)
          Returns the formatter set for the column at index columnIndex or null if none has been set.
 int getSortingColumn()
          Returns the index of the column sorting the table or -1 if the table is not sorted by any column.
 boolean hasSortIndicator()
          Shows if this table shows a sort indicator at the sorting column's header.
 boolean isSortable(int columnIndex)
          Returns true if the column at index columnIndex may be sorted.
 boolean isSortingColumnAscending()
          Shows if the sorted column sorts ascending (1 click) or descening(2 clicks).
 boolean isVisible(int columnIndex)
          Returns the visibility state of a particular column.
 void selectByUIIndex(int index)
          Selects the row at a provided index in the UI-control (SWT-table) associated with this widget-model.
 void setFormatter(int columnIndex, at.spardat.enterprise.fmt.IFmt formatter)
          Sets the formatter to use for column at index columnIndex.
 void setSortable(int columnIndex, boolean what)
          Sets the property if the column at index columnIndex may be sorted by the user or not.
 void setSortIndicator(boolean showSortIndicator)
          If this method is set to true than a sort indicator (a small up or down arrow) is shown at the column's header, which sorts the table.
 void sort(int columnIndex)
          Sorts the table contents on the UI using a particular column as sort order column.
 void sortNatural()
          Displays the rows in their natural order, i.e., as inserted in the table model.
 
Methods inherited from interface at.spardat.xma.mdl.table.ITableWM
clear, containsKey, getColumnCount, getRow, getRow, indexOf, isOneWay, removeRow, removeRow, selectByModelIndex, size
 
Methods inherited from interface at.spardat.xma.mdl.ISelectable
deselect, deselectAll, getSelected, getSelection, getSelectionCount, isMultiSelect, isSelected, isStrict, select
 
Methods inherited from interface at.spardat.xma.mdl.IWModelClient
getUIDelegate, isEditable, isEnabled, setEditable, setEnabled
 

Field Detail

S_NON_SORTABLE

public static final int S_NON_SORTABLE
Indicates that non of the table rows may be sorted. The default is that all rows may be sorted.

See Also:
Constant Field Values
Method Detail

setFormatter

public void setFormatter(int columnIndex,
                         at.spardat.enterprise.fmt.IFmt formatter)
Sets the formatter to use for column at index columnIndex.

Parameters:
columnIndex - the zero based index of the column
formatter - the IFmt object determining the string layout of a column cell.
Throws:
java.lang.ArrayIndexOutOfBoundsException - if columnIndex not valid.

setSortable

public void setSortable(int columnIndex,
                        boolean what)
Sets the property if the column at index columnIndex may be sorted by the user or not. If this method is not called for a particular column, the value defaults to true.

Parameters:
columnIndex - the zero based index of the column
what - false if sorting of the column should be supressed, true otherwise.

isSortable

public boolean isSortable(int columnIndex)
Returns true if the column at index columnIndex may be sorted.


sort

public void sort(int columnIndex)
Sorts the table contents on the UI using a particular column as sort order column. Note that this method does not sort the widget model. The model stays completely unchanged. It merely changes the permutation of rows on the UI. If you are working with zero based indexes on the table model, this indexes may no longer correspond with the rows rank you see in the UI table. E.g., selecting the first row in the table model will not select the first row in the UI table.

The table won't be sorted if any of the following is true:


sortNatural

public void sortNatural()
Displays the rows in their natural order, i.e., as inserted in the table model. This method does not change the order in the model, just on the UI. It makes sure that the UI displays the rows in the same order as given by the model.

This method may be used to undo an earlier call to sort. Besides that, the user might have changed the sort order by klicking on the table headers.


getFormatter

public at.spardat.enterprise.fmt.IFmt getFormatter(int columnIndex)
Returns the formatter set for the column at index columnIndex or null if none has been set.


isVisible

public boolean isVisible(int columnIndex)
Returns the visibility state of a particular column.

Parameters:
columnIndex - zero based index of the column
Returns:
true if visible, false otherwise

getColumn

public XMATableColumn getColumn(int i)
Returns the column at the provided zero based index.

Parameters:
i - zero based index indentifying a column
Returns:
a TableColumn object describing the column
Throws:
ArrayIndexOutOfBounds - if i greater equal getColumnCount or less than zero.

selectByUIIndex

public void selectByUIIndex(int index)
Selects the row at a provided index in the UI-control (SWT-table) associated with this widget-model. If index is less than zero or greater or equal to size(), this method does nothing.

Note that the UI must be constructed in order for this method to work.


getSortingColumn

public int getSortingColumn()
Returns the index of the column sorting the table or -1 if the table is not sorted by any column.

Returns:
The index of the column starting with 0 or -1 if no sort was done.
Since:
version_number

isSortingColumnAscending

public boolean isSortingColumnAscending()
Shows if the sorted column sorts ascending (1 click) or descening(2 clicks). If the sorted column index is -1, then a call to this method makes no sense.

Returns:
true - ascending / false - descending
Since:
version_number

hasSortIndicator

public boolean hasSortIndicator()
Shows if this table shows a sort indicator at the sorting column's header.


setSortIndicator

public void setSortIndicator(boolean showSortIndicator)
If this method is set to true than a sort indicator (a small up or down arrow) is shown at the column's header, which sorts the table.

Parameters:
showSortIndicator - true - show a sort indicator at the sorting column's header / false - no sort indicator is shown