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 aSplitPaneState
object forJSplitPane c
.void
setSessionState
(Component c, Object state)
-
Constructor Details
-
SplitPaneProperty
public SplitPaneProperty()
-
-
Method Details
-
getSessionState
Returns aSplitPaneState
object forJSplitPane c
. If the split pane'sdividerLocation
is -1, indicating that either the divider hasn't been moved, or it's been reset, then return null.Throws an
IllegalArgumentException
ifComponent c
isn't a non-nullJSplitPane
.- Specified by:
getSessionState
in interfaceSessionStorage.Property
- Parameters:
c
- theJSplitPane
whose dividerLocation will recoreded in aSplitPaneState
object.- Returns:
- the
SplitPaneState
object - See Also:
-
setSessionState
Restore theJSplitPane's
dividerLocation
property if itsorientation
has not changed.Throws an
IllegalArgumentException
ifc
is not aJSplitPane
or ifstate
is non-null but not an instance ofSessionStorage.SplitPaneState
.- Specified by:
setSessionState
in interfaceSessionStorage.Property
- Parameters:
c
- the JSplitPane whose state is to be restoredstate
- theSplitPaneState
to be restored- See Also:
-