Package org.jdesktop.application.session

# Class TabbedPaneProperty

java.lang.Object
org.jdesktop.application.session.TabbedPaneProperty

All Implemented Interfaces:
  `PropertySupport`

public class TabbedPaneProperty extends Object implements PropertySupport
A `sessionState` property for JTabbedPane.

This class defines how the session state for `JTabbedPanes` is `saved` and and `restored` in terms of a property called `sessionState`. The JTabbedPane's `selectedIndex` is saved and restored if the number of tabs (`tabCount`) hasn't changed.

`TabbedPaneProperty` is registered for `JTabbedPane.class` by default, so this class applies to JTabbedPane and any subclass of JTabbedPane. One can override the default with the `putProperty` method.

See Also:
  - `TabbedPaneState`
  - `SessionStorage.save(java.awt.Component, java.lang.String)`
  - `SessionStorage.restore(java.awt.Component, java.lang.String)`

## Constructor Summary

Constructors
Constructor
Description
`TabbedPaneProperty()`

## Method Summary

Modifier and Type
Method
Description
`Object`
`getSessionState(Component c)`
Returns a `TabbedPaneState` object for `JTabbedPane c`.
`void`
`setSessionState(Component c, Object state)`
Restore the `JTabbedPane's` `selectedIndex` property if the number of `tabs` has not changed.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### TabbedPaneProperty

public TabbedPaneProperty()

## Method Details

### getSessionState

public Object getSessionState(Component c)
Returns a `TabbedPaneState` object for `JTabbedPane c`.

Throws an `IllegalArgumentException` if `Component c` isn't a non-null `JTabbedPane`.

Specified by:
  `getSessionState` in interface `PropertySupport`
Parameters:
  `c` - the `JTabbedPane` whose selectedIndex will recoreded in a `TabbedPaneState` object.
Returns:
  the `TabbedPaneState` object
See Also:
  - `setSessionState(java.awt.Component, java.lang.Object)`
  - `TabbedPaneState`

### setSessionState

public void setSessionState(Component c, Object state)
Restore the `JTabbedPane's` `selectedIndex` property if the number of `tabs` has not changed.

Throws an `IllegalArgumentException` if `c` is not a `JTabbedPane` or if `state` is non-null but not an instance of `TabbedPaneState`.

Specified by:
  `setSessionState` in interface `PropertySupport`
Parameters:
  `c` - the JTabbedPane whose state is to be restored
  `state` - the `TabbedPaneState` to be restored
See Also:
  - `getSessionState(java.awt.Component)`
  - `TabbedPaneState`