public class SplitPaneProperty extends Object implements PropertySupport
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.
Constructor and Description |
---|
SplitPaneProperty() |
Modifier and Type | Method and Description |
---|---|
Object |
getSessionState(Component c)
Returns a
SplitPaneState object
for JSplitPane c . |
void |
setSessionState(Component c,
Object state)
|
public Object getSessionState(Component c)
SplitPaneState
object
for JSplitPane c
. If the split pane's
dividerLocation
is -1, indicating that either
the divider hasn't been moved, or it's been reset,
then return null.
Throws an IllegalArgumentException
if Component c
isn't a non-null JSplitPane
.
getSessionState
in interface PropertySupport
c
- the JSplitPane
whose dividerLocation will
recoreded in a SplitPaneState
object.SplitPaneState
objectsetSessionState(java.awt.Component, java.lang.Object)
,
SplitPaneState
public void setSessionState(Component c, Object state)
JSplitPane's
dividerLocation
property if its orientation
has not changed.
Throws an IllegalArgumentException
if c
is
not a JSplitPane
or if state
is non-null
but not an instance of SplitPaneState
.
setSessionState
in interface PropertySupport
c
- the JSplitPane whose state is to be restoredstate
- the SplitPaneState
to be restoredgetSessionState(java.awt.Component)
,
SplitPaneState
Copyright © 2009–2019. All rights reserved.