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 java.lang.Object implements SessionStorage.Property
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 interfaceSessionStorage.Property- Parameters:
c- theJSplitPanewhose dividerLocation will recoreded in aSplitPaneStateobject.- Returns:
- the
SplitPaneStateobject - See Also:
setSessionState(java.awt.Component, java.lang.Object),SessionStorage.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 ofSessionStorage.SplitPaneState.- Specified by:
setSessionStatein interfaceSessionStorage.Property- Parameters:
c- the JSplitPane whose state is to be restoredstate- theSplitPaneStateto be restored- See Also:
getSessionState(java.awt.Component),SessionStorage.SplitPaneState
-
-