Package org.jdesktop.application
Class SessionStorage.SplitPaneProperty
java.lang.Object
org.jdesktop.application.SessionStorage.SplitPaneProperty
- All Implemented Interfaces:
SessionStorage.Property
- Enclosing class:
SessionStorage
public static class SessionStorage.SplitPaneProperty
extends Object
implements SessionStorage.Property
A
sessionState property for JSplitPane.
This class defines how the session state for JSplitPanes
is saved and
and restored in
terms of a property called sessionState. The
JSplitPane's dividerLocation is saved and restored
if its orientation hasn't changed.
SplitPaneProperty is registered for
JSplitPane.class by default, so this class applies to
JSplitPane and any subclass of JSplitPane. One can
override the default with the putProperty
method.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns aSplitPaneStateobject forJSplitPane c.voidsetSessionState(Component c, Object state)
-
Constructor Details
-
SplitPaneProperty
public SplitPaneProperty()
-
-
Method Details
-
getSessionState
Returns aSplitPaneStateobject forJSplitPane c. If the split pane'sdividerLocationis -1, indicating that either the divider hasn't been moved, or it's been reset, then return null.Throws an
IllegalArgumentExceptionifComponent cisn't a non-nullJSplitPane.- Specified by:
getSessionStatein interfaceSessionStorage.Property- Parameters:
c- theJSplitPanewhose dividerLocation will recoreded in aSplitPaneStateobject.- Returns:
- the
SplitPaneStateobject - See Also:
-
setSessionState
Restore theJSplitPane'sdividerLocationproperty if itsorientationhas not changed.Throws an
IllegalArgumentExceptionifcis not aJSplitPaneor ifstateis non-null but not an instance ofSessionStorage.SplitPaneState.- Specified by:
setSessionStatein interfaceSessionStorage.Property- Parameters:
c- the JSplitPane whose state is to be restoredstate- theSplitPaneStateto be restored- See Also:
-