org.springframework.richclient.widget.table.glazedlists
Class GlazedListTableWidget

Show UML class diagram
java.lang.Object
  extended by org.springframework.richclient.application.support.ApplicationServicesAccessor
      extended by org.springframework.richclient.widget.AbstractWidget
          extended by org.springframework.richclient.widget.table.glazedlists.GlazedListTableWidget
All Implemented Interfaces:
TableWidget, Widget

public final class GlazedListTableWidget
extends AbstractWidget
implements TableWidget


Field Summary
static org.jdesktop.swingx.decorator.HighlightPredicate HIGHLIGHTSELECTCOLUMN
           
 
Fields inherited from class org.springframework.richclient.widget.AbstractWidget
showing
 
Fields inherited from class org.springframework.richclient.application.support.ApplicationServicesAccessor
logger
 
Fields inherited from interface org.springframework.richclient.widget.table.TableWidget
NAVIGATE_FIRST, NAVIGATE_FIRSTROW_CMDID, NAVIGATE_LAST, NAVIGATE_LASTROW_CMDID, NAVIGATE_NEXT, NAVIGATE_NEXTROW_CMDID, NAVIGATE_PREVIOUS, NAVIGATE_PREVIOUSROW_CMDID, SELECT_ALL_ID, SELECT_INVERSE_ID, SELECT_NONE_ID
 
Fields inherited from interface org.springframework.richclient.widget.Widget
EMPTY_WIDGET
 
Constructor Summary
GlazedListTableWidget(Class dataType, List<? extends Object> rows, ca.odell.glazedlists.gui.TableFormat format, String[] filterProperties)
           
GlazedListTableWidget(Class dataType, List<? extends Object> rows, ca.odell.glazedlists.gui.TableFormat format, String[] filterProperties, Comparator comparator, boolean addHighlightSelectColumn)
           
GlazedListTableWidget(List<? extends Object> rows, TableDescription tableDesc)
           
GlazedListTableWidget(List<? extends Object> rows, TableDescription tableDesc, Comparator comparator)
           
 
Method Summary
 void addRowObject(Object newObject)
          Local addition of a single object to the data-list of the table
 void addRows(Collection rows)
          Local addition of a collection of objects to the data-list of the table
 void addSelection(Object[] 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
 void addUserSelectionListener(PropertyChangeListener listener)
           
 JComponent getButtonBar()
          Combination of the navigation button bar and the selection button bar
 JComponent getComponent()
           
 Set getDirtyRows()
           
 JLabel getListSummaryLabel()
           
 JComponent getNavigationButtonBar()
          The navigation-commands as button bar
 JComponent getNavigationButtonBar(com.jgoodies.forms.layout.Size size, Border border)
           
 CommandGroup getNavigationCommandGroup()
           
 AbstractCommand[] getNavigationCommands()
          Spring-RCP commands to navigate through the table
 List getRows()
          Returns the current list of objects behind the table.
 JComponent getSelectButtonBar()
          Buttonbar with three buttons: select all, select none and select inverse
 CommandGroup getSelectColumnCommandGroup()
           
 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 getVisibleRows()
          Returns the current list of objects visible in the table.
 boolean hasSelection()
           
 boolean isEmpty()
          
 int nrOfRows()
          Numbers of rows in the table
 void onAboutToShow()
          Hook method called before showing the component on screen.
 void removeRowObject(Object 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(Object oldObject, Object newObject, Observer originatingObserver)
          Replaces an object in the table
 void replaceRows(Collection oldObject, Collection newObject)
          Replaces a collection of objects in the table.
 void scrollToSelectedRow()
           
 void selectRowObject(int index, Observer originatingObserver)
          Selects a row on the given index
 int selectRowObject(Object toPointTo, Observer originatingObserver)
          Selects the row of a given object and notifies the registered selection observers.
 void setHighlighters(org.jdesktop.swingx.decorator.Highlighter... highlighters)
           
 void setRowHeightEnabled(boolean rowHeightEnabled)
          Enable the row height to diverge from the default height.
 void setRows(Collection 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 class org.springframework.richclient.widget.AbstractWidget
canClose, getCommands, isShowing, onAboutToHide
 
Methods inherited from class org.springframework.richclient.application.support.ApplicationServicesAccessor
getActiveWindow, getApplication, getApplicationContext, getApplicationName, getApplicationServices, getCommandConfigurer, getComponentFactory, getConversionService, getIconSource, getImageSource, getMessage, getMessage, getMessage, getMessage, getMessages, getMessageSource, getObjectConfigurer, getService
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.springframework.richclient.widget.Widget
canClose, getCommands, isShowing, onAboutToHide
 

Field Detail

HIGHLIGHTSELECTCOLUMN

public static final org.jdesktop.swingx.decorator.HighlightPredicate HIGHLIGHTSELECTCOLUMN
Constructor Detail

GlazedListTableWidget

public GlazedListTableWidget(List<? extends Object> rows,
                             TableDescription tableDesc)

GlazedListTableWidget

public GlazedListTableWidget(List<? extends Object> rows,
                             TableDescription tableDesc,
                             Comparator comparator)

GlazedListTableWidget

public GlazedListTableWidget(Class dataType,
                             List<? extends Object> rows,
                             ca.odell.glazedlists.gui.TableFormat format,
                             String[] filterProperties)

GlazedListTableWidget

public GlazedListTableWidget(Class dataType,
                             List<? extends Object> rows,
                             ca.odell.glazedlists.gui.TableFormat format,
                             String[] filterProperties,
                             Comparator comparator,
                             boolean addHighlightSelectColumn)
Method Detail

setRowHeightEnabled

public void setRowHeightEnabled(boolean rowHeightEnabled)
Enable the row height to diverge from the default height.

NOTE: this is experimental as there is a problem with glazedlists and jxtable. (see note on ExtendedJXTable above)


setHighlighters

public void setHighlighters(org.jdesktop.swingx.decorator.Highlighter... highlighters)

isEmpty

public boolean isEmpty()

Specified by:
isEmpty in interface TableWidget
Returns:
true if the data-list is empty

nrOfRows

public int nrOfRows()
Numbers of rows in the table

Specified by:
nrOfRows in interface TableWidget
Returns:

addUserSelectionListener

public void addUserSelectionListener(PropertyChangeListener listener)

setRows

public final void setRows(Collection newRows)
Description copied from interface: TableWidget
Sets the rows to be shown in the table

Specified by:
setRows in interface TableWidget
Parameters:
newRows - The list of row objects

getRows

public final List getRows()
Description copied from interface: TableWidget
Returns the current list of objects behind the table. It does not take into account local filtering and/or sorting.

Specified by:
getRows in interface TableWidget
Returns:
List the list with objects
See Also:
TableWidget.getVisibleRows()

getVisibleRows

public final List getVisibleRows()
Description copied from interface: TableWidget
Returns the current list of objects visible in the table. It takes into account local filtering and/or sorting.

Specified by:
getVisibleRows in interface TableWidget
Returns:
List the visible rows
See Also:
TableWidget.getRows()

addRowObject

public void addRowObject(Object newObject)
Description copied from interface: TableWidget
Local addition of a single object to the data-list of the table

Specified by:
addRowObject in interface TableWidget
Parameters:
newObject - The object to add

addRows

public void addRows(Collection rows)
Description copied from interface: TableWidget
Local addition of a collection of objects to the data-list of the table

Specified by:
addRows in interface TableWidget
Parameters:
rows - The collection of objects to add

removeRowObject

public void removeRowObject(Object objectToRemove)
Description copied from interface: TableWidget
Local removal of a single object to the data-list of the table

Specified by:
removeRowObject in interface TableWidget
Parameters:
objectToRemove - The object to remove

selectRowObject

public int selectRowObject(Object toPointTo,
                           Observer originatingObserver)
Description copied from interface: TableWidget
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).

Specified by:
selectRowObject in interface TableWidget
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:
TableWidget.addSelectionObserver(java.util.Observer)

selectRowObject

public void selectRowObject(int index,
                            Observer originatingObserver)
Description copied from interface: TableWidget
Selects a row on the given index

Specified by:
selectRowObject in interface TableWidget
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

public void addSelection(Object[] rows,
                         Observer originatingObserver)
Description copied from interface: TableWidget
Adds an array of objects to the current selection

Specified by:
addSelection in interface TableWidget
Parameters:
rows - Array with row objects
originatingObserver - Optional observer that doesn't want to be notified of the selection

hasSelection

public boolean hasSelection()
Specified by:
hasSelection in interface TableWidget
Returns:
true if there is an active selection

scrollToSelectedRow

public void scrollToSelectedRow()

replaceRowObject

public void replaceRowObject(Object oldObject,
                             Object newObject,
                             Observer originatingObserver)
Description copied from interface: TableWidget
Replaces an object in the table

Specified by:
replaceRowObject in interface TableWidget
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

public void replaceRows(Collection oldObject,
                        Collection newObject)
Description copied from interface: TableWidget
Replaces a collection of objects in the table.

Specified by:
replaceRows in interface TableWidget
Parameters:
oldObject - The collection of objects to be replaced
newObject - The replacing collection of objects

unSelectAll

public void unSelectAll()
Description copied from interface: TableWidget
Deselects all rows

Specified by:
unSelectAll in interface TableWidget

getSelectedRows

public Object[] getSelectedRows()
Specified by:
getSelectedRows in interface TableWidget
Returns:
Array of objects that are currently selected

getComponent

public JComponent getComponent()
Specified by:
getComponent in interface Widget
Returns:
A not null graphical component built using the parameters held in the widget instance.

getTable

public JTable getTable()
Description copied from interface: TableWidget
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.

Specified by:
getTable in interface TableWidget
Returns:
The table
See Also:
Widget.getComponent()

addSelectionObserver

public void addSelectionObserver(Observer observer)
Description copied from interface: TableWidget
Registers a listener that will receive events on selection of an object in the table.

Specified by:
addSelectionObserver in interface TableWidget
See Also:
TableWidget.selectRowObject(Object, Observer)

removeSelectionObserver

public void removeSelectionObserver(Observer observer)
Description copied from interface: TableWidget
Removes a selection listener

Specified by:
removeSelectionObserver in interface TableWidget

addTableModelListener

public void addTableModelListener(TableModelListener listener)
Description copied from interface: TableWidget
Registers a listener for changes made to TableModel

Specified by:
addTableModelListener in interface TableWidget

removeTableModelListener

public void removeTableModelListener(TableModelListener listener)
Description copied from interface: TableWidget
Remove the given listener from the TableModel.

Specified by:
removeTableModelListener in interface TableWidget

updateTable

public void updateTable()
Description copied from interface: TableWidget
Forces a re-read of the data-list for the table

Specified by:
updateTable in interface TableWidget

getTextFilterField

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

getNavigationCommands

public AbstractCommand[] getNavigationCommands()
Description copied from interface: TableWidget
Spring-RCP commands to navigate through the table

Specified by:
getNavigationCommands in interface TableWidget
See Also:
TableWidget.NAVIGATE_FIRST, TableWidget.NAVIGATE_PREVIOUS, TableWidget.NAVIGATE_NEXT, TableWidget.NAVIGATE_LAST

getNavigationButtonBar

public JComponent getNavigationButtonBar()
Description copied from interface: TableWidget
The navigation-commands as button bar

Specified by:
getNavigationButtonBar in interface TableWidget

getNavigationButtonBar

public JComponent getNavigationButtonBar(com.jgoodies.forms.layout.Size size,
                                         Border border)

getNavigationCommandGroup

public CommandGroup getNavigationCommandGroup()

getSelectColumnCommandGroup

public CommandGroup getSelectColumnCommandGroup()

getSelectButtonBar

public JComponent getSelectButtonBar()
Description copied from interface: TableWidget
Buttonbar with three buttons: select all, select none and select inverse

Specified by:
getSelectButtonBar in interface TableWidget

getButtonBar

public JComponent getButtonBar()
Description copied from interface: TableWidget
Combination of the navigation button bar and the selection button bar

Specified by:
getButtonBar in interface TableWidget

getListSummaryLabel

public JLabel getListSummaryLabel()
Specified by:
getListSummaryLabel in interface TableWidget
Returns:
A label on which the index, the selected row count and the row count is shown

onAboutToShow

public void onAboutToShow()
Description copied from class: AbstractWidget
Hook method called before showing the component on screen.

Specified by:
onAboutToShow in interface Widget
Overrides:
onAboutToShow in class AbstractWidget

getDirtyRows

public Set getDirtyRows()


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