Package org.jdesktop.application.session
Class TabbedPaneProperty
java.lang.Object
org.jdesktop.application.session.TabbedPaneProperty
- All Implemented Interfaces:
PropertySupport
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 aTabbedPaneStateobject forJTabbedPane c.voidsetSessionState(Component c, Object state)
-
Constructor Details
-
TabbedPaneProperty
public TabbedPaneProperty()
-
-
Method Details
-
getSessionState
Returns aTabbedPaneStateobject forJTabbedPane c.Throws an
IllegalArgumentExceptionifComponent cisn't a non-nullJTabbedPane.- Specified by:
getSessionStatein interfacePropertySupport- Parameters:
c- theJTabbedPanewhose selectedIndex will recoreded in aTabbedPaneStateobject.- Returns:
- the
TabbedPaneStateobject - See Also:
-
setSessionState
Restore theJTabbedPane'sselectedIndexproperty if the number oftabshas not changed.Throws an
IllegalArgumentExceptionifcis not aJTabbedPaneor ifstateis non-null but not an instance ofTabbedPaneState.- Specified by:
setSessionStatein interfacePropertySupport- Parameters:
c- the JTabbedPane whose state is to be restoredstate- theTabbedPaneStateto be restored- See Also:
-