qflib 0.98.0

de.qfs.lib.config
Class JTableConfigWrapper

java.lang.Object
  |
  +--de.qfs.lib.config.ConfigWrapper
        |
        +--de.qfs.lib.config.JTableConfigWrapper
All Implemented Interfaces:
Configurable, java.util.EventListener, java.beans.PropertyChangeListener, javax.swing.event.TableColumnModelListener

public class JTableConfigWrapper
extends ConfigWrapper
implements javax.swing.event.TableColumnModelListener, java.beans.PropertyChangeListener

A ConfigWrapper for swing.JTable objects. The state saved includes the order of the columns as well as their preferred witdth.

Version:
$Revision: 1.10 $
Author:
Gregor Schmid

Field Summary
protected  javax.swing.JTable table
          The wrapped table.
 
Constructor Summary
JTableConfigWrapper()
          Create a new JTableConfigWrapper with the default name "Table".
 
Method Summary
 void columnAdded(javax.swing.event.TableColumnModelEvent e)
           
 void columnMarginChanged(javax.swing.event.ChangeEvent e)
           
 void columnMoved(javax.swing.event.TableColumnModelEvent e)
           
 void columnRemoved(javax.swing.event.TableColumnModelEvent e)
           
 void columnSelectionChanged(javax.swing.event.ListSelectionEvent e)
           
 java.util.Properties getConfigurableState()
          Get the Configurable's state.
 java.io.Serializable getState()
          Get the state of the Table.
 void propertyChange(java.beans.PropertyChangeEvent e)
           
 void registrationChanged(Configuration config, java.lang.String name, boolean registered, boolean valuesKept)
          This callback is used to notify the Configurable whenever it is registered with or unregistered from the Configuration, so it can decide whether to notify the Configuration when its state changes.
protected  void setClient(java.lang.Object client)
          Set the client object for the ConfigWrapper.
 void setConfigurableState(java.util.Properties state)
          Set the Configurable's state.
 void setState(java.lang.Object state)
          Set the state of the Table.
 
Methods inherited from class de.qfs.lib.config.ConfigWrapper
addPackage, getConfigurableName, makeWrapper, makeWrapper, setConfigurableName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

table

protected javax.swing.JTable table
The wrapped table.
Constructor Detail

JTableConfigWrapper

public JTableConfigWrapper()
Create a new JTableConfigWrapper with the default name "Table".
Method Detail

setClient

protected void setClient(java.lang.Object client)
Set the client object for the ConfigWrapper.
Overrides:
setClient in class ConfigWrapper
Parameters:
client - The client object to set.

getConfigurableState

public java.util.Properties getConfigurableState()
Get the Configurable's state.
Overrides:
getConfigurableState in class ConfigWrapper
Following copied from class: de.qfs.lib.config.ConfigWrapper
Returns:
An empty Properties object.

setConfigurableState

public void setConfigurableState(java.util.Properties state)
Set the Configurable's state.
Overrides:
setConfigurableState in class ConfigWrapper
Following copied from class: de.qfs.lib.config.ConfigWrapper
Parameters:
state - The state to set. Ignored.

getState

public java.io.Serializable getState()
Get the state of the Table.
Returns:
An Object array with two elements, an array of the ids of the columns and an array ot their preferred widths.

setState

public void setState(java.lang.Object state)
Set the state of the Table.
Parameters:
state - An Object array that should be of the form returned by getState.

registrationChanged

public void registrationChanged(Configuration config,
                                java.lang.String name,
                                boolean registered,
                                boolean valuesKept)
This callback is used to notify the Configurable whenever it is registered with or unregistered from the Configuration, so it can decide whether to notify the Configuration when its state changes.
Overrides:
registrationChanged in class ConfigWrapper
Parameters:
config - The affected Configuration.
name - The registration name of the Configurable which may be different from the Configurable's name.
registered - True if the Configurable was just registered, false if it was unregistered.
valuesKept - Whether the Configurable's values were kept, if it was just unregistered.

columnAdded

public void columnAdded(javax.swing.event.TableColumnModelEvent e)
Specified by:
columnAdded in interface javax.swing.event.TableColumnModelListener

columnRemoved

public void columnRemoved(javax.swing.event.TableColumnModelEvent e)
Specified by:
columnRemoved in interface javax.swing.event.TableColumnModelListener

columnMoved

public void columnMoved(javax.swing.event.TableColumnModelEvent e)
Specified by:
columnMoved in interface javax.swing.event.TableColumnModelListener

columnMarginChanged

public void columnMarginChanged(javax.swing.event.ChangeEvent e)
Specified by:
columnMarginChanged in interface javax.swing.event.TableColumnModelListener

columnSelectionChanged

public void columnSelectionChanged(javax.swing.event.ListSelectionEvent e)
Specified by:
columnSelectionChanged in interface javax.swing.event.TableColumnModelListener

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent e)
Specified by:
propertyChange in interface java.beans.PropertyChangeListener

qflib 0.98.0