ca.odell.glazedlists.swing
Class JXTableSupport<E>

java.lang.Object
  extended by ca.odell.glazedlists.swing.JXTableSupport<E>

public class JXTableSupport<E>
extends Object

JXTableSupport integrates a JXTable with Glazed Lists by

Warning: This class must be mutated from the Swing Event Dispatch Thread. Failure to do so will result in an IllegalStateException thrown from any one of:

Author:
Holger Brands

Method Summary
 org.jdesktop.swingx.JXTable getTable()
           
 TableComparatorChooser<E> getTableComparatorChooser()
           
 TableFormat<? super E> getTableFormat()
           
 AdvancedTableModel<E> getTableModel()
           
 AdvancedListSelectionModel<E> getTableSelectionModel()
           
static
<E> JXTableSupport<E>
install(org.jdesktop.swingx.JXTable table, EventList<E> eventList, TableFormat<? super E> tableFormat, SortedList<E> sortedList, Object sortingStrategy)
          Installs the Glazed Lists integration on the given table.
 boolean isInstalled()
           
 void uninstall()
          Uninstalls the GlazedLists integration and restores the state of JXTable as it was before the installation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

install

public static <E> JXTableSupport<E> install(org.jdesktop.swingx.JXTable table,
                                            EventList<E> eventList,
                                            TableFormat<? super E> tableFormat,
                                            SortedList<E> sortedList,
                                            Object sortingStrategy)
Installs the Glazed Lists integration on the given table.

First, the current state of the table is determined to be able to restore this state when the integration is uninstalled again. Then this method installs

The effect of this is, that Glazed Lists takes full control of sorting (and filtering) functionality and disables JXTable's sorting support.

Type Parameters:
E - element type of EventList
Parameters:
table - the JXTable to integrate with
eventList - the EventList acting as data source for the table model, must be *at least* as high as the sortedList within the list pipeline. It's possible to layer further transforms *above* the SortedList and pass one of those in as the data source
tableFormat - the TableFormat to use
sortedList - the SortedList to use with the TableComparatorChooser
sortingStrategy - the SortingStrategy to use with the TableComparatorChooser
Returns:
the JXTableSupport instance to use for uninstallation of GLazed Lists integration
Throws:
IllegalStateException - if this method is called from any Thread other than the Swing Event Dispatch Thread
See Also:
TableComparatorChooser.install(javax.swing.JTable, SortedList, Object, TableFormat)

getTable

public org.jdesktop.swingx.JXTable getTable()
Returns:
the JXTable or null if JXTableSupport has already been uninstalled

getTableSelectionModel

public AdvancedListSelectionModel<E> getTableSelectionModel()
Returns:
the installed AdvancedListSelectionModel or null if already uninstalled

getTableModel

public AdvancedTableModel<E> getTableModel()
Returns:
the installed AdvancedTableModel or null if already uninstalled

getTableFormat

public TableFormat<? super E> getTableFormat()
Returns:
the installed TableFormat or null if already uninstalled

getTableComparatorChooser

public TableComparatorChooser<E> getTableComparatorChooser()
Returns:
the installed TableComparatorChooser or null if already uninstalled

uninstall

public void uninstall()
Uninstalls the GlazedLists integration and restores the state of JXTable as it was before the installation.

Throws:
IllegalStateException - if this method is called from any Thread other than the Swing Event Dispatch Thread

isInstalled

public boolean isInstalled()
Returns:
true if this JXTableSupport instance is currently installed and altering the behaviour of the JXTable; false if it has been uninstall()ed.


Glazed Lists, Copyright © 2003 publicobject.com, O'Dell Engineering.
Documentation build by hbrands at 2017-03-13 22:58