ca.odell.glazedlists.swt
Class EventTableViewer

java.lang.Object
  extended by ca.odell.glazedlists.swt.EventTableViewer
All Implemented Interfaces:
ListEventListener, EventListener

public class EventTableViewer
extends Object
implements ListEventListener

A view helper that displays an EventList in an SWT table.

This class is not thread safe. It must be used exclusively with the SWT event handler thread.

Warning: This class is a a developer preview and subject to many bugs and API changes.

Author:
Jesse Wilson

Constructor Summary
EventTableViewer(EventList source, Table table, String[] propertyNames, String[] columnLabels)
          Creates a new viewer for the given Table that updates the table contents in response to changes on the specified EventList.
EventTableViewer(EventList source, Table table, TableFormat tableFormat)
          Creates a new viewer for the given Table that updates the table contents in response to changes on the specified EventList.
 
Method Summary
 void dispose()
          Releases the resources consumed by this EventTableViewer so that it may eventually be garbage collected.
 List getAllChecked()
          Gets all checked items.
 boolean getCheckedOnly()
          Get whether this is showing only checked elements.
 EventList getDeselected()
          Provides access to an EventList that contains items from the viewed Table that are not currently selected.
 EventList getSelected()
          Provides access to an EventList that contains items from the viewed Table that are currently selected.
 EventList getSourceList()
          Get the source of this EventTableViewer.
 Table getTable()
          Gets the Table that is being managed by this EventTableViewer.
 TableFormat getTableFormat()
          Gets the TableFormat.
 void invertSelection()
          Inverts the current selection.
 void listChanged(ListEvent listChanges)
          When the source list is changed, this forwards the change to the displayed Table.
 void setCheckedOnly(boolean checkedOnly)
          Set whether this shall show only checked elements.
 void setTableFormat(TableFormat tableFormat)
          Sets this Table to be formatted by a different TableFormat.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EventTableViewer

public EventTableViewer(EventList source,
                        Table table,
                        String[] propertyNames,
                        String[] columnLabels)
Creates a new viewer for the given Table that updates the table contents in response to changes on the specified EventList. The Table is formatted with an automatically generated TableFormat. It uses JavaBeans and Reflection to create a TableFormat as specified.


EventTableViewer

public EventTableViewer(EventList source,
                        Table table,
                        TableFormat tableFormat)
Creates a new viewer for the given Table that updates the table contents in response to changes on the specified EventList. The Table is formatted with the specified TableFormat.

Method Detail

getTableFormat

public TableFormat getTableFormat()
Gets the TableFormat.


getTable

public Table getTable()
Gets the Table that is being managed by this EventTableViewer.


setTableFormat

public void setTableFormat(TableFormat tableFormat)
Sets this Table to be formatted by a different TableFormat. This method is not yet implemented for SWT.


setCheckedOnly

public void setCheckedOnly(boolean checkedOnly)
Set whether this shall show only checked elements.


getCheckedOnly

public boolean getCheckedOnly()
Get whether this is showing only checked elements.


getAllChecked

public List getAllChecked()
Gets all checked items.


getSourceList

public EventList getSourceList()
Get the source of this EventTableViewer.


getDeselected

public EventList getDeselected()
Provides access to an EventList that contains items from the viewed Table that are not currently selected.


getSelected

public EventList getSelected()
Provides access to an EventList that contains items from the viewed Table that are currently selected.


listChanged

public void listChanged(ListEvent listChanges)
When the source list is changed, this forwards the change to the displayed Table.

Specified by:
listChanged in interface ListEventListener

invertSelection

public void invertSelection()
Inverts the current selection.


dispose

public void dispose()
Releases the resources consumed by this EventTableViewer so that it may eventually be garbage collected.

An EventTableViewer will be garbage collected without a call to dispose(), but not before its source EventList is garbage collected. By calling dispose(), you allow the EventTableViewer to be garbage collected before its source EventList. This is necessary for situations where an EventTableViewer is short-lived but its source EventList is long-lived.

Warning: It is an error to call any method on a EventTableViewer after it has been disposed.



Glazed Lists, Copyright © 2003-2006 publicobject.com, O'Dell Engineering.
Documentation build by jessewilson at 2006-05-23 22:33