Package org.jdesktop.application.session
Class SplitPaneProperty
- java.lang.Object
-
- org.jdesktop.application.session.SplitPaneProperty
-
- All Implemented Interfaces:
PropertySupport
public class SplitPaneProperty extends java.lang.Object implements PropertySupport
AsessionState
property for JSplitPane.This class defines how the session state for
JSplitPanes
issaved
and andrestored
in terms of a property calledsessionState
. The JSplitPane'sdividerLocation
is saved and restored if itsorientation
hasn't changed.SplitPaneProperty
is registered forJSplitPane.class
by default, so this class applies to JSplitPane and any subclass of JSplitPane. One can override the default with theputProperty
method.
-
-
Constructor Summary
Constructors Constructor Description SplitPaneProperty()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
getSessionState(java.awt.Component c)
Returns aSplitPaneState
object forJSplitPane c
.void
setSessionState(java.awt.Component c, java.lang.Object state)
Restore theJSplitPane's
dividerLocation
property if itsorientation
has not changed.
-
-
-
Method Detail
-
getSessionState
public java.lang.Object getSessionState(java.awt.Component c)
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 interfacePropertySupport
- Parameters:
c
- theJSplitPane
whose dividerLocation will recoreded in aSplitPaneState
object.- Returns:
- the
SplitPaneState
object - See Also:
setSessionState(java.awt.Component, java.lang.Object)
,SplitPaneState
-
setSessionState
public void setSessionState(java.awt.Component c, java.lang.Object state)
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 ofSplitPaneState
.- Specified by:
setSessionState
in interfacePropertySupport
- Parameters:
c
- the JSplitPane whose state is to be restoredstate
- theSplitPaneState
to be restored- See Also:
getSessionState(java.awt.Component)
,SplitPaneState
-
-