|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface TableWidget<T>
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 |
---|
static final int NAVIGATE_FIRST
getNavigationCommands()
.
static final int NAVIGATE_PREVIOUS
static final int NAVIGATE_NEXT
static final int NAVIGATE_LAST
static final String SELECT_ALL_ID
static final String SELECT_NONE_ID
static final String SELECT_INVERSE_ID
static final String NAVIGATE_LASTROW_CMDID
getNavigationCommands()
.
static final String NAVIGATE_NEXTROW_CMDID
static final String NAVIGATE_PREVIOUSROW_CMDID
static final String NAVIGATE_FIRSTROW_CMDID
Method Detail |
---|
void setRows(Collection<T> newRows)
newRows
- The list of row objectsList<T> getRows()
getVisibleRows()
List<T> getVisibleRows()
getRows()
int nrOfRows()
boolean isEmpty()
void addRowObject(T newObject)
newObject
- The object to addvoid addRows(Collection<T> rows)
rows
- The collection of objects to addvoid removeRowObject(T objectToRemove)
objectToRemove
- The object to removeint selectRowObject(T toPointTo, Observer originatingObserver)
toPointTo
- row-object that needs to be selectedoriginatingObserver
- Optional observer that doesn't want to be notified of the
selection
addSelectionObserver(java.util.Observer)
void selectRowObject(int index, Observer originatingObserver)
index
- index of the row that needs to be selectedoriginatingObserver
- Optional observer that doesn't want to be notified of the
selectionvoid addSelection(T[] rows, Observer originatingObserver)
rows
- Array with row objectsoriginatingObserver
- Optional observer that doesn't want to be notified of the
selectionvoid replaceRowObject(T oldObject, T newObject, Observer originatingObserver)
oldObject
- The object to be replacednewObject
- The replacing objectoriginatingObserver
- Optional observer that doesn't want to be notified of the
replacementvoid replaceRows(Collection<T> oldObject, Collection<T> newObject)
oldObject
- The collection of objects to be replacednewObject
- The replacing collection of objectsvoid unSelectAll()
Object[] getSelectedRows()
boolean hasSelection()
void addSelectionObserver(Observer observer)
selectRowObject(Object, Observer)
void removeSelectionObserver(Observer observer)
observer
- void addTableModelListener(TableModelListener listener)
listener
- void removeTableModelListener(TableModelListener listener)
listener
- void updateTable()
AbstractCommand[] getNavigationCommands()
NAVIGATE_FIRST
,
NAVIGATE_PREVIOUS
,
NAVIGATE_NEXT
,
NAVIGATE_LAST
JComponent getNavigationButtonBar()
navigation-commands
as button bar
JComponent getSelectButtonBar()
JComponent getButtonBar()
JTable getTable()
Widget.getComponent()
JTextField getTextFilterField()
JLabel getListSummaryLabel()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |