Package org.jdesktop.application.session
Class TabbedPaneProperty
- java.lang.Object
-
- org.jdesktop.application.session.TabbedPaneProperty
-
- All Implemented Interfaces:
PropertySupport
public class TabbedPaneProperty extends java.lang.Object implements PropertySupport
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 interfacePropertySupport- Parameters:
c- theJTabbedPanewhose selectedIndex will recoreded in aTabbedPaneStateobject.- Returns:
- the
TabbedPaneStateobject - See Also:
setSessionState(java.awt.Component, java.lang.Object),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 ofTabbedPaneState.- Specified by:
setSessionStatein interfacePropertySupport- Parameters:
c- the JTabbedPane whose state is to be restoredstate- theTabbedPaneStateto be restored- See Also:
getSessionState(java.awt.Component),TabbedPaneState
-
-