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 Object
implements SessionStorage.Property
A
sessionState
property for JTabbedPane.
This class defines how the session state for JTabbedPanes
is saved
and
and restored
in
terms of a property called sessionState
. The
JTabbedPane's selectedIndex
is saved and restored
if the number of tabs (tabCount
) hasn't changed.
TabbedPaneProperty
is registered for
JTabbedPane.class
by default, so this class applies to
JTabbedPane and any subclass of JTabbedPane. One can
override the default with the putProperty
method.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns aTabbedPaneState
object forJTabbedPane c
.void
setSessionState
(Component c, Object state)
-
Constructor Details
-
TabbedPaneProperty
public TabbedPaneProperty()
-
-
Method Details
-
getSessionState
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
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:
-