org.springframework.richclient.widget.table
Interface TableWidget<T>

Show UML class diagram
All Superinterfaces:
Widget
All Known Implementing Classes:
GlazedListTableWidget

public interface TableWidget<T>
extends Widget

TableWidget describes the needed functionality for widgets that produce tables. The TableWidget manages a data-list of objects whose properties are shown in one or more different columns of the table. Some methods of TableWidget (remove, select) assume correct implementation of Object.equals(java.lang.Object) and Object.hashCode() for the data-list's objects.


Field Summary
static int NAVIGATE_FIRST
          Indices of the navigate-commands in the list getNavigationCommands().
static String NAVIGATE_FIRSTROW_CMDID
           
static int NAVIGATE_LAST
           
static String NAVIGATE_LASTROW_CMDID
          Command Id's for the navigation commands for the table getNavigationCommands().
static int NAVIGATE_NEXT
           
static String NAVIGATE_NEXTROW_CMDID
           
static int NAVIGATE_PREVIOUS
           
static String NAVIGATE_PREVIOUSROW_CMDID
           
static String SELECT_ALL_ID
          Id's for the selection commands.
static String SELECT_INVERSE_ID
           
static String SELECT_NONE_ID
           
 
Fields inherited from interface org.springframework.richclient.widget.Widget
EMPTY_WIDGET
 
Method Summary
 void addRowObject(T newObject)
          Local addition of a single object to the data-list of the table
 void addRows(Collection<T> rows)
          Local addition of a collection of objects to the data-list of the table
 void addSelection(T[] rows, Observer originatingObserver)
          Adds an array of objects to the current selection
 void addSelectionObserver(Observer observer)
          Registers a listener that will receive events on selection of an object in the table.
 void addTableModelListener(TableModelListener listener)
          Registers a listener for changes made to TableModel
 JComponent getButtonBar()
          Combination of the navigation button bar and the selection button bar
 JLabel getListSummaryLabel()
           
 JComponent getNavigationButtonBar()
          The navigation-commands as button bar
 AbstractCommand[] getNavigationCommands()
          Spring-RCP commands to navigate through the table
 List<T> getRows()
          Returns the current list of objects behind the table.
 JComponent getSelectButtonBar()
          Buttonbar with three buttons: select all, select none and select inverse
 Object[] getSelectedRows()
           
 JTable getTable()
          Returns the table, getComponent() does not need to return only table (a scrollpane can be returned too containing the table), as this method will enable you to get to the table.
 JTextField getTextFilterField()
           
 List<T> getVisibleRows()
          Returns the current list of objects visible in the table.
 boolean hasSelection()
           
 boolean isEmpty()
           
 int nrOfRows()
          Numbers of rows in the table
 void removeRowObject(T objectToRemove)
          Local removal of a single object to the data-list of the table
 void removeSelectionObserver(Observer observer)
          Removes a selection listener
 void removeTableModelListener(TableModelListener listener)
          Remove the given listener from the TableModel.
 void replaceRowObject(T oldObject, T newObject, Observer originatingObserver)
          Replaces an object in the table
 void replaceRows(Collection<T> oldObject, Collection<T> newObject)
          Replaces a collection of objects in the table.
 void selectRowObject(int index, Observer originatingObserver)
          Selects a row on the given index
 int selectRowObject(T toPointTo, Observer originatingObserver)
          Selects the row of a given object and notifies the registered selection observers.
 void setRows(Collection<T> newRows)
          Sets the rows to be shown in the table
 void unSelectAll()
          Deselects all rows
 void updateTable()
          Forces a re-read of the data-list for the table
 
Methods inherited from interface org.springframework.richclient.widget.Widget
canClose, getCommands, getComponent, isShowing, onAboutToHide, onAboutToShow
 

Field Detail

NAVIGATE_FIRST

static final int NAVIGATE_FIRST
Indices of the navigate-commands in the list getNavigationCommands().

See Also:
Constant Field Values

NAVIGATE_PREVIOUS

static final int NAVIGATE_PREVIOUS
See Also:
Constant Field Values

NAVIGATE_NEXT

static final int NAVIGATE_NEXT
See Also:
Constant Field Values

NAVIGATE_LAST

static final int NAVIGATE_LAST
See Also:
Constant Field Values

SELECT_ALL_ID

static final String SELECT_ALL_ID
Id's for the selection commands.

See Also:
Constant Field Values

SELECT_NONE_ID

static final String SELECT_NONE_ID
See Also:
Constant Field Values

SELECT_INVERSE_ID

static final String SELECT_INVERSE_ID
See Also:
Constant Field Values

NAVIGATE_LASTROW_CMDID

static final String NAVIGATE_LASTROW_CMDID
Command Id's for the navigation commands for the table getNavigationCommands().

See Also:
Constant Field Values

NAVIGATE_NEXTROW_CMDID

static final String NAVIGATE_NEXTROW_CMDID
See Also:
Constant Field Values

NAVIGATE_PREVIOUSROW_CMDID

static final String NAVIGATE_PREVIOUSROW_CMDID
See Also:
Constant Field Values

NAVIGATE_FIRSTROW_CMDID

static final String NAVIGATE_FIRSTROW_CMDID
See Also:
Constant Field Values
Method Detail

setRows

void setRows(Collection<T> newRows)
Sets the rows to be shown in the table

Parameters:
newRows - The list of row objects

getRows

List<T> getRows()
Returns the current list of objects behind the table. It does not take into account local filtering and/or sorting.

Returns:
List the list with objects
See Also:
getVisibleRows()

getVisibleRows

List<T> getVisibleRows()
Returns the current list of objects visible in the table. It takes into account local filtering and/or sorting.

Returns:
List the visible rows
See Also:
getRows()

nrOfRows

int nrOfRows()
Numbers of rows in the table

Returns:

isEmpty

boolean isEmpty()
Returns:
true if the data-list is empty

addRowObject

void addRowObject(T newObject)
Local addition of a single object to the data-list of the table

Parameters:
newObject - The object to add

addRows

void addRows(Collection<T> rows)
Local addition of a collection of objects to the data-list of the table

Parameters:
rows - The collection of objects to add

removeRowObject

void removeRowObject(T objectToRemove)
Local removal of a single object to the data-list of the table

Parameters:
objectToRemove - The object to remove

selectRowObject

int selectRowObject(T toPointTo,
                    Observer originatingObserver)
Selects the row of a given object and notifies the registered selection observers. The second argument allows 1 observer to be excluded from the notification (needed if the observer is the caller).

Parameters:
toPointTo - row-object that needs to be selected
originatingObserver - Optional observer that doesn't want to be notified of the selection
Returns:
int index of the object in the shown list
See Also:
addSelectionObserver(java.util.Observer)

selectRowObject

void selectRowObject(int index,
                     Observer originatingObserver)
Selects a row on the given index

Parameters:
index - index of the row that needs to be selected
originatingObserver - Optional observer that doesn't want to be notified of the selection

addSelection

void addSelection(T[] rows,
                  Observer originatingObserver)
Adds an array of objects to the current selection

Parameters:
rows - Array with row objects
originatingObserver - Optional observer that doesn't want to be notified of the selection

replaceRowObject

void replaceRowObject(T oldObject,
                      T newObject,
                      Observer originatingObserver)
Replaces an object in the table

Parameters:
oldObject - The object to be replaced
newObject - The replacing object
originatingObserver - Optional observer that doesn't want to be notified of the replacement

replaceRows

void replaceRows(Collection<T> oldObject,
                 Collection<T> newObject)
Replaces a collection of objects in the table.

Parameters:
oldObject - The collection of objects to be replaced
newObject - The replacing collection of objects

unSelectAll

void unSelectAll()
Deselects all rows


getSelectedRows

Object[] getSelectedRows()
Returns:
Array of objects that are currently selected

hasSelection

boolean hasSelection()
Returns:
true if there is an active selection

addSelectionObserver

void addSelectionObserver(Observer observer)
Registers a listener that will receive events on selection of an object in the table.

See Also:
selectRowObject(Object, Observer)

removeSelectionObserver

void removeSelectionObserver(Observer observer)
Removes a selection listener

Parameters:
observer -

addTableModelListener

void addTableModelListener(TableModelListener listener)
Registers a listener for changes made to TableModel

Parameters:
listener -

removeTableModelListener

void removeTableModelListener(TableModelListener listener)
Remove the given listener from the TableModel.

Parameters:
listener -

updateTable

void updateTable()
Forces a re-read of the data-list for the table


getNavigationCommands

AbstractCommand[] getNavigationCommands()
Spring-RCP commands to navigate through the table

See Also:
NAVIGATE_FIRST, NAVIGATE_PREVIOUS, NAVIGATE_NEXT, NAVIGATE_LAST

getNavigationButtonBar

JComponent getNavigationButtonBar()
The navigation-commands as button bar


getSelectButtonBar

JComponent getSelectButtonBar()
Buttonbar with three buttons: select all, select none and select inverse


getButtonBar

JComponent getButtonBar()
Combination of the navigation button bar and the selection button bar


getTable

JTable getTable()
Returns the table, getComponent() does not need to return only table (a scrollpane can be returned too containing the table), as this method will enable you to get to the table.

Returns:
The table
See Also:
Widget.getComponent()

getTextFilterField

JTextField getTextFilterField()
Returns:
A textfield that enables full-text filtering n the contents of the table or null if this feature is not supported

getListSummaryLabel

JLabel getListSummaryLabel()
Returns:
A label on which the index, the selected row count and the row count is shown


Copyright © 2004-2009 The Spring Framework. All Rights Reserved.