Package org.jdesktop.application
Class SessionStorage.TabbedPaneProperty
- java.lang.Object
-
- org.jdesktop.application.SessionStorage.TabbedPaneProperty
-
- All Implemented Interfaces:
SessionStorage.Property
- Enclosing class:
- SessionStorage
public static class SessionStorage.TabbedPaneProperty extends java.lang.Object implements SessionStorage.Property
AsessionStateproperty for JTabbedPane.This class defines how the session state for
JTabbedPanesissavedand andrestoredin terms of a property calledsessionState. The JTabbedPane'sselectedIndexis saved and restored if the number of tabs (tabCount) hasn't changed.TabbedPanePropertyis registered forJTabbedPane.classby default, so this class applies to JTabbedPane and any subclass of JTabbedPane. One can override the default with theputPropertymethod.
-
-
Constructor Summary
Constructors Constructor Description TabbedPaneProperty()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ObjectgetSessionState(java.awt.Component c)Returns aTabbedPaneStateobject forJTabbedPane c.voidsetSessionState(java.awt.Component c, java.lang.Object state)Restore theJTabbedPane'sselectedIndexproperty if the number oftabshas not changed.
-
-
-
Method Detail
-
getSessionState
public java.lang.Object getSessionState(java.awt.Component c)
Returns aTabbedPaneStateobject forJTabbedPane c.Throws an
IllegalArgumentExceptionifComponent cisn't a non-nullJTabbedPane.- Specified by:
getSessionStatein interfaceSessionStorage.Property- Parameters:
c- theJTabbedPanewhose selectedIndex will recoreded in aTabbedPaneStateobject.- Returns:
- the
TabbedPaneStateobject - See Also:
setSessionState(java.awt.Component, java.lang.Object),SessionStorage.TabbedPaneState
-
setSessionState
public void setSessionState(java.awt.Component c, java.lang.Object state)Restore theJTabbedPane'sselectedIndexproperty if the number oftabshas not changed.Throws an
IllegalArgumentExceptionifcis not aJTabbedPaneor ifstateis non-null but not an instance ofSessionStorage.TabbedPaneState.- Specified by:
setSessionStatein interfaceSessionStorage.Property- Parameters:
c- the JTabbedPane whose state is to be restoredstate- theTabbedPaneStateto be restored- See Also:
getSessionState(java.awt.Component),SessionStorage.TabbedPaneState
-
-