org.jcreme.swing.table.columnmodel.state
Class EditableTableColumnModelMemento

java.lang.Object
  extended byorg.jcreme.state.BaseMemento
      extended byorg.jcreme.swing.state.BaseUIMemento
          extended byorg.jcreme.swing.table.columnmodel.state.EditableTableColumnModelMemento
All Implemented Interfaces:
Memento

public class EditableTableColumnModelMemento
extends BaseUIMemento

This Memento enables to persist the state of an EditableTableColumnModel.

Version:
$Revision: 1.2 $
Author:
$Author: dbregeon $

Field Summary
static java.lang.String HIDDEN_COLUMNS_COUNT_PREFERENCE
           
static java.lang.String MEMENTO_CLASS_PREFERENCE
           
static java.lang.String VISIBLE_COLUMNS_COUNT_PREFERENCE
           
 
Fields inherited from class org.jcreme.swing.state.BaseUIMemento
BLUE_PREFERENCE, GREEN_PREFERENCE, HEIGHT_PREFERENCE, RED_PREFERENCE, WIDTH_PREFERENCE, X_PREFERENCE, Y_PREFERENCE
 
Fields inherited from class org.jcreme.state.BaseMemento
STORED_OBJECT_TYPE_PREFERENCE, SUB_MEMENTO_CONTENTS_PREFERENCE, SUB_MEMENTO_TYPE_PREFERENCE
 
Constructor Summary
EditableTableColumnModelMemento()
           
 
Method Summary
protected  void filterColumns(EditableTableColumnModel newModel, javax.swing.table.TableColumnModel oldModel)
          Ensure that the models are synched up.
protected  Memento getColumnMemento(javax.swing.table.TableColumn c)
           
 void load(java.util.prefs.Preferences preferences)
          This method enables to restore a Memento from Preferences.
protected  Memento loadTableColumnMemento(java.util.prefs.Preferences node)
           
 void store(java.util.prefs.Preferences preferences)
          This method enables to store the Memento into Preferences.
protected  void storeTableColumnMemento(Memento memento, java.util.prefs.Preferences node)
           
 void updateMemento(java.lang.Object o)
          Updates the contents of the Memento from values in o.
 void updateObject(java.lang.Object o)
          Updates the Object o with values stored in this Memento.
 
Methods inherited from class org.jcreme.swing.state.BaseUIMemento
loadColor, loadDimension, loadPoint, storeColor, storeDimension, storePoint
 
Methods inherited from class org.jcreme.state.BaseMemento
buildObject, getObjectType, loadSubMemento, storeSubMemento
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VISIBLE_COLUMNS_COUNT_PREFERENCE

public static final java.lang.String VISIBLE_COLUMNS_COUNT_PREFERENCE
See Also:
Constant Field Values

HIDDEN_COLUMNS_COUNT_PREFERENCE

public static final java.lang.String HIDDEN_COLUMNS_COUNT_PREFERENCE
See Also:
Constant Field Values

MEMENTO_CLASS_PREFERENCE

public static final java.lang.String MEMENTO_CLASS_PREFERENCE
See Also:
Constant Field Values
Constructor Detail

EditableTableColumnModelMemento

public EditableTableColumnModelMemento()
Method Detail

store

public void store(java.util.prefs.Preferences preferences)
           throws MementoException
Description copied from interface: Memento
This method enables to store the Memento into Preferences.

Parameters:
preferences - the Preferences node where the Memento should be stored.
Throws:
MementoException - if an error occured while storing the memento contents in the preferences.
See Also:
Memento.store(java.util.prefs.Preferences)

load

public void load(java.util.prefs.Preferences preferences)
          throws MementoException
Description copied from interface: Memento
This method enables to restore a Memento from Preferences.

Parameters:
preferences - the Preferences node from which the Memento should be loaded.
Throws:
MementoException - if an error occured while loading the memento contents from the preferences.
See Also:
Memento.load(java.util.prefs.Preferences)

updateObject

public void updateObject(java.lang.Object o)
                  throws java.lang.IllegalArgumentException,
                         MementoException
Description copied from interface: Memento
Updates the Object o with values stored in this Memento.

Parameters:
o - the Object to update.
Throws:
MementoException - if an error occured while updating the object.
java.lang.IllegalArgumentException - if this Memento can not handle o.

updateMemento

public void updateMemento(java.lang.Object o)
                   throws java.lang.IllegalArgumentException,
                          MementoException
Description copied from interface: Memento
Updates the contents of the Memento from values in o.

Parameters:
o - the Object to remember.
Throws:
MementoException - if an error occured while updating the memento contents.
java.lang.IllegalArgumentException - if this Memento can not handle o.

getColumnMemento

protected Memento getColumnMemento(javax.swing.table.TableColumn c)
                            throws MementoException
Throws:
MementoException

storeTableColumnMemento

protected void storeTableColumnMemento(Memento memento,
                                       java.util.prefs.Preferences node)
                                throws MementoException
Throws:
MementoException

loadTableColumnMemento

protected Memento loadTableColumnMemento(java.util.prefs.Preferences node)
                                  throws MementoException
Throws:
MementoException

filterColumns

protected void filterColumns(EditableTableColumnModel newModel,
                             javax.swing.table.TableColumnModel oldModel)
Ensure that the models are synched up.

Parameters:
newModel - the model restored (to sync).
oldModel - the model newly created for the table (reference for sync).


Copyright 2006 null. All Rights Reserved.