org.xnap.gui.table
Class TablePreferencesHandler

java.lang.Object
  extended by org.xnap.gui.table.TablePreferencesHandler
All Implemented Interfaces:
java.beans.PropertyChangeListener, java.util.EventListener, TableHeaderListener

public class TablePreferencesHandler
extends java.lang.Object
implements java.beans.PropertyChangeListener, TableHeaderListener

Takes care of the table preferences.


Nested Class Summary
protected  class TablePreferencesHandler.ColumnListener
           
 
Constructor Summary
TablePreferencesHandler(TablePreferencesProvider prefs, java.lang.String table, ColumnModel model, javax.swing.table.TableColumnModel tcm)
           
 
Method Summary
 void columnWidthChanged()
          Saves the width of all columns.
 Column getColumnByKey(java.lang.String key)
           
 TablePreferencesProvider getPreferencesSupport()
           
 java.lang.String getTable()
          Returns the preferences key.
 void propertyChange(java.beans.PropertyChangeEvent e)
           
 void restore()
          Restores the table width and sort order.
 void setVisible(java.lang.String[] visibleKeysArray)
           
 void sortedColumnChanged()
          Saves the sorted column.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TablePreferencesHandler

public TablePreferencesHandler(TablePreferencesProvider prefs,
                               java.lang.String table,
                               ColumnModel model,
                               javax.swing.table.TableColumnModel tcm)
Method Detail

getPreferencesSupport

public TablePreferencesProvider getPreferencesSupport()

getColumnByKey

public Column getColumnByKey(java.lang.String key)

getTable

public java.lang.String getTable()
Returns the preferences key.


propertyChange

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

restore

public void restore()
Restores the table width and sort order.


setVisible

public void setVisible(java.lang.String[] visibleKeysArray)

sortedColumnChanged

public void sortedColumnChanged()
Saves the sorted column.

Writes 0, if no column was ever sorted; index + 1, if the column was sorted ascending; -index - 1, if the column was sorted descending ;).

Specified by:
sortedColumnChanged in interface TableHeaderListener

columnWidthChanged

public void columnWidthChanged()
Saves the width of all columns.

Specified by:
columnWidthChanged in interface TableHeaderListener


Copyright © 2001-2005 XNap Team. All Rights Reserved.