org.springframework.richclient.progress
Class ListStatusBarUpdater

java.lang.Object
  extended by org.springframework.richclient.table.ListSelectionListenerSupport
      extended by org.springframework.richclient.progress.ListStatusBarUpdater
All Implemented Interfaces:
EventListener, ListSelectionListener

public abstract class ListStatusBarUpdater
extends ListSelectionListenerSupport
implements ListSelectionListener

ListSelectionListenerSupport implementation that updates the statusbar of the application. The getSelectedObjectName must return the string representation of the selected object.
Usage:

 JTable table = ...
 
 ListStatusBarUpdater updater = new ListStatusBarUpdater(getStatusBar()) {
     protected String getSelectedObjectName() {
         // return the selected Object's name
     }
 };
 
 table.getSelectionModel().addListSelectionListener(updater);
 

Author:
peter.de.bruycker

Constructor Summary
ListStatusBarUpdater(StatusBar statusBar)
          Constructs a new TableStatusBarUpdater instance.
 
Method Summary
protected abstract  String getSelectedObjectName()
          Returns the string representation of the selected object.
 StatusBar getStatusBar()
          Method getStatusBar.
protected  void onMultiSelection(int[] indexes)
          Called when multiple rows are selected.
protected  void onNoSelection()
          Called when nothing gets selected.
protected  void onSingleSelection(int index)
          Called when the user selects a single row.
 
Methods inherited from class org.springframework.richclient.table.ListSelectionListenerSupport
getItemsSelected, valueChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.swing.event.ListSelectionListener
valueChanged
 

Constructor Detail

ListStatusBarUpdater

public ListStatusBarUpdater(StatusBar statusBar)
Constructs a new TableStatusBarUpdater instance.

Parameters:
table - the table
statusBar - the status bar
Method Detail

getSelectedObjectName

protected abstract String getSelectedObjectName()
Returns the string representation of the selected object.

Returns:
the string representation

getStatusBar

public StatusBar getStatusBar()
Method getStatusBar.

Returns:
the status bar

onSingleSelection

protected void onSingleSelection(int index)
Description copied from class: ListSelectionListenerSupport
Called when the user selects a single row. Override this method to handle single selection

Overrides:
onSingleSelection in class ListSelectionListenerSupport
Parameters:
index - the selected row
See Also:
org.springframework.richclient.table.TableSelectionListenerSupport#onSingleSelection(int)

onMultiSelection

protected void onMultiSelection(int[] indexes)
Description copied from class: ListSelectionListenerSupport
Called when multiple rows are selected. Override this method to handle multiple selection

Overrides:
onMultiSelection in class ListSelectionListenerSupport
Parameters:
indexes - the selected indexes
See Also:
org.springframework.richclient.table.TableSelectionListenerSupport#onMultiSelection(int[])

onNoSelection

protected void onNoSelection()
Description copied from class: ListSelectionListenerSupport
Called when nothing gets selected. Override this method to handle empty selection

Overrides:
onNoSelection in class ListSelectionListenerSupport
See Also:
org.springframework.richclient.table.TableSelectionListenerSupport#onNoSelection()


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