ca.odell.glazedlists.swt
Class EventListViewer

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

public class EventListViewer
extends Object
implements ListEventListener

A view helper that displays an EventList in a List.

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:
Kevin Maltby

Constructor Summary
EventListViewer(EventList source, List list)
          Creates a new List that displays and responds to changes in source.
EventListViewer(EventList source, List list, ILabelProvider labelProvider)
          Creates a new List that displays and responds to changes in source.
 
Method Summary
 void dispose()
          Releases the resources consumed by this EventListViewer so that it may eventually be garbage collected.
 EventList getDeselected()
          Provides access to an EventList that contains items from the viewed Table that are not currently selected.
 ILabelProvider getLabelProvider()
          Gets the List's ILabelProvider.
 List getList()
          Gets the List being managed by this EventListViewer.
 EventList getSelected()
          Provides access to an EventList that contains items from the viewed Table that are currently selected.
 void invertSelection()
          Inverts the current selection.
 void listChanged(ListEvent listChanges)
          When the source list is changed, this forwards the change to the displayed List.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EventListViewer

public EventListViewer(EventList source,
                       List list)
Creates a new List that displays and responds to changes in source. List elements will simply be displayed as the result of calling toString() on the contents of the source list.


EventListViewer

public EventListViewer(EventList source,
                       List list,
                       ILabelProvider labelProvider)
Creates a new List that displays and responds to changes in source. List elements are formatted using the provided ILabelProvider.

Method Detail

getLabelProvider

public ILabelProvider getLabelProvider()
Gets the List's ILabelProvider.


getList

public List getList()
Gets the List being managed by this EventListViewer.


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 List.

Specified by:
listChanged in interface ListEventListener

invertSelection

public void invertSelection()
Inverts the current selection.


dispose

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

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

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



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