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
AsessionStateproperty for JSplitPane.This class defines how the session state for
JSplitPanesissavedand andrestoredin terms of a property calledsessionState. The JSplitPane'sdividerLocationis saved and restored if itsorientationhasn't changed.SplitPanePropertyis registered forJSplitPane.classby default, so this class applies to JSplitPane and any subclass of JSplitPane. One can override the default with theputPropertymethod.
-
-
Constructor Summary
Constructors Constructor Description SplitPaneProperty()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ObjectgetSessionState(java.awt.Component c)Returns aSplitPaneStateobject forJSplitPane c.voidsetSessionState(java.awt.Component c, java.lang.Object state)Restore theJSplitPane'sdividerLocationproperty if itsorientationhas not changed.
-
-
-
Method Detail
-
getSessionState
public java.lang.Object getSessionState(java.awt.Component c)
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 interfacePropertySupport- Parameters:
c- theJSplitPanewhose dividerLocation will recoreded in aSplitPaneStateobject.- Returns:
- the
SplitPaneStateobject - See Also:
setSessionState(java.awt.Component, java.lang.Object),SplitPaneState
-
setSessionState
public void setSessionState(java.awt.Component c, java.lang.Object state)Restore theJSplitPane'sdividerLocationproperty if itsorientationhas not changed.Throws an
IllegalArgumentExceptionifcis not aJSplitPaneor ifstateis non-null but not an instance ofSplitPaneState.- Specified by:
setSessionStatein interfacePropertySupport- Parameters:
c- the JSplitPane whose state is to be restoredstate- theSplitPaneStateto be restored- See Also:
getSessionState(java.awt.Component),SplitPaneState
-
-