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
AsessionState
property for JTabbedPane.This class defines how the session state for
JTabbedPanes
issaved
and andrestored
in terms of a property calledsessionState
. The JTabbedPane'sselectedIndex
is saved and restored if the number of tabs (tabCount
) hasn't changed.TabbedPaneProperty
is registered forJTabbedPane.class
by default, so this class applies to JTabbedPane and any subclass of JTabbedPane. One can override the default with theputProperty
method.
-
-
Constructor Summary
Constructors Constructor Description TabbedPaneProperty()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
getSessionState(java.awt.Component c)
Returns aTabbedPaneState
object forJTabbedPane c
.void
setSessionState(java.awt.Component c, java.lang.Object state)
Restore theJTabbedPane's
selectedIndex
property if the number oftabs
has not changed.
-
-
-
Method Detail
-
getSessionState
public java.lang.Object getSessionState(java.awt.Component c)
Returns aTabbedPaneState
object forJTabbedPane c
.Throws an
IllegalArgumentException
ifComponent c
isn't a non-nullJTabbedPane
.- Specified by:
getSessionState
in interfaceSessionStorage.Property
- Parameters:
c
- theJTabbedPane
whose selectedIndex will recoreded in aTabbedPaneState
object.- Returns:
- the
TabbedPaneState
object - 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's
selectedIndex
property if the number oftabs
has not changed.Throws an
IllegalArgumentException
ifc
is not aJTabbedPane
or ifstate
is non-null but not an instance ofSessionStorage.TabbedPaneState
.- Specified by:
setSessionState
in interfaceSessionStorage.Property
- Parameters:
c
- the JTabbedPane whose state is to be restoredstate
- theTabbedPaneState
to be restored- See Also:
getSessionState(java.awt.Component)
,SessionStorage.TabbedPaneState
-
-