Package org.jdesktop.application
Class SessionStorage.TableProperty
- java.lang.Object
-
- org.jdesktop.application.SessionStorage.TableProperty
-
- All Implemented Interfaces:
SessionStorage.Property
- Enclosing class:
- SessionStorage
public static class SessionStorage.TableProperty extends java.lang.Object implements SessionStorage.Property
AsessionStateproperty for JTableThis class defines how the session state for
JTablesissavedand andrestoredin terms of a property calledsessionState. We save and restore the width of each resizableTableColumn, if the number of columns haven't changed.TablePropertyis registered forJTable.classby default, so this class applies to JTable and any subclass of JTable. One can override the default with theputPropertymethod.
-
-
Constructor Summary
Constructors Constructor Description TableProperty()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ObjectgetSessionState(java.awt.Component c)voidsetSessionState(java.awt.Component c, java.lang.Object state)Restore the width of each resizableTableColumn, if the number of columns haven't changed.
-
-
-
Method Detail
-
getSessionState
public java.lang.Object getSessionState(java.awt.Component c)
Returns aTableStateobject forJTable cor null, if none of the JTable's columns areresizable. A width of -1 is used to markTableColumnsthat are not resizable.Throws an
IllegalArgumentExceptionifComponent cisn't a non-nullJTable.- Specified by:
getSessionStatein interfaceSessionStorage.Property- Parameters:
c- theJTablewhose columnWidths will be saved in aTableStateobject.- Returns:
- the
TableStateobject or null - See Also:
setSessionState(java.awt.Component, java.lang.Object),SessionStorage.TableState
-
setSessionState
public void setSessionState(java.awt.Component c, java.lang.Object state)Restore the width of each resizableTableColumn, if the number of columns haven't changed.Throws an
IllegalArgumentExceptionifcis not aJTableor ifstateis not an instance ofSessionStorage.TableState.- Specified by:
setSessionStatein interfaceSessionStorage.Property- Parameters:
c- the JTable whose column widths are to be restoredstate- theTableStateto be restored- See Also:
getSessionState(java.awt.Component),SessionStorage.TableState
-
-