EchoPoint
2.1.0rc5

echopointng
Class TabbedPane

java.lang.Object
  extended by nextapp.echo2.app.Component
      extended by echopointng.ComponentEx
          extended by echopointng.AbleComponent
              extended by echopointng.TabbedPane
All Implemented Interfaces:
AccessKeyable, Attributeable, Borderable, Delegateable, Heightable, Insetable, MouseCursorable, Scrollable, Sizeable, Stretchable, ToolTipable, Widthable, Serializable, PaneContainer, RenderIdSupport

public class TabbedPane
extends AbleComponent
implements PaneContainer, Stretchable, Scrollable

TabbedPane is used to provide a tabbed interface to a collection of Components.

A TabModel is used to provide the collections of tabs and the content that should be shown when a given tab is selected.

A SingleSelectionModel is used to track which tab is currently selected.

This component is a PaneContainer and hence can have components that implement Pane as a child. However many Panes, such as SplitPane, require a definite height to be set in order to work properly. So make sure you call setHeight() if one of the children implements Pane

See Also:
Serialized Form

Field Summary
static Style DEFAULT_STYLE
           
static String PROPERTY_MODEL
           
static String PROPERTY_SELECTION_MODEL
           
static String PROPERTY_TAB_BORDER_STYLE
           
static String PROPERTY_TAB_LEAD_IN_WIDTH
           
static String PROPERTY_TAB_PLACEMENT
           
static String PROPERTY_TAB_SPACING
           
static int TAB_LINE_AND_CONTENT
          TAB_LINE_AND_CONTENT - shows a border around the tabs and a line betweent the tabs and the content It looks a bit like this (where ==== is the border and --- is the non-border area ----------- ----------- ----------- ----------- - - - - - - - - - - - - - - - - ============================ ========================== = = = = = = = = = = = = ===============================================================
static int TAB_LINE_ONLY
          TAB_LINE_ONLY - shows no border around the tabs and a line betweent the tabs and the content It looks a bit like this (where ==== is the border and --- is the non-border area ----------- ----------- ----------- ----------- - - - - - - - - - - - - - - - - ============================ ========================== - - - - - - - - - - - - ---------------------------------------------------------------
static int TAB_STRIP_AND_CONTENT
          TAB_STRIP_AND_CONTENT - shows the border around the tabs and content It looks a bit like this (where ==== is the border and --- is the non-border area =========== =========== =========== =========== = = = = = = = = = = = = = = = = ============================ ========================== = = = = = = = = = = = = ===============================================================
static int TAB_STRIP_ONLY
          TAB_STRIP_ONLY - shows a border around the tabs and a line betweent the tabs and the content It looks a bit like this (where ==== is the border and --- is the non-border area =========== =========== =========== =========== = = = = = = = = = = = = = = = = ============================ ========================== - - - - - - - - - - - - ---------------------------------------------------------------
 
Fields inherited from class echopointng.ComponentEx
PROPERTY_HIDDEN
 
Fields inherited from class nextapp.echo2.app.Component
CHILDREN_CHANGED_PROPERTY, ENABLED_CHANGED_PROPERTY, FOCUS_TRAVERSAL_INDEX_CHANGED_PROPERTY, FOCUS_TRAVERSAL_PARTICIPANT_CHANGED_PROPERTY, LAYOUT_DIRECTION_CHANGED_PROPERTY, LOCALE_CHANGED_PROPERTY, PROPERTY_BACKGROUND, PROPERTY_FONT, PROPERTY_FOREGROUND, PROPERTY_LAYOUT_DATA, STYLE_CHANGED_PROPERTY, STYLE_NAME_CHANGED_PROPERTY, VISIBLE_CHANGED_PROPERTY
 
Fields inherited from interface echopointng.able.Stretchable
PROPERTY_HEIGHT_STRETCHED, PROPERTY_MAXIMUM_STRETCHED_HEIGHT, PROPERTY_MINIMUM_STRETCHED_HEIGHT
 
Fields inherited from interface echopointng.able.Scrollable
ALWAYS, AUTO, CLIPHIDE, NEVER, PROPERTY_SCROLL_BAR_BASE_COLOR, PROPERTY_SCROLL_BAR_POLICY, PROPERTY_SCROLL_BAR_PROPERTIES, UNDEFINED
 
Fields inherited from interface echopointng.able.Widthable
PROPERTY_WIDTH
 
Fields inherited from interface echopointng.able.Heightable
PROPERTY_HEIGHT
 
Fields inherited from interface echopointng.able.AccessKeyable
PROPERTY_ACCESS_KEY
 
Fields inherited from interface echopointng.able.Borderable
PROPERTY_BORDER
 
Fields inherited from interface echopointng.able.MouseCursorable
CURSOR_AUTO, CURSOR_CROSSHAIR, CURSOR_CUSTOM_URI, CURSOR_DEFAULT, CURSOR_E_RESIZE, CURSOR_HELP, CURSOR_MOVE, CURSOR_N_RESIZE, CURSOR_NE_RESIZE, CURSOR_NW_RESIZE, CURSOR_POINTER, CURSOR_S_RESIZE, CURSOR_SE_RESIZE, CURSOR_SW_RESIZE, CURSOR_TEXT, CURSOR_W_RESIZE, CURSOR_WAIT, PROPERTY_MOUSE_CURSOR, PROPERTY_MOUSE_CURSOR_URI
 
Fields inherited from interface echopointng.able.Insetable
DEFAULT_INSETS, DEFAULT_OUTSETS, PROPERTY_INSETS, PROPERTY_OUTSETS
 
Fields inherited from interface echopointng.able.ToolTipable
PROPERTY_TOOL_TIP_TEXT
 
Constructor Summary
TabbedPane()
          Constructs a TabbedPane with the a default empty DefaultTabModel as the TabbedPane's model.
TabbedPane(TabModel tabModel)
          Constructs a TabbedPane with the specified TabModel.
 
Method Summary
 Extent getMaximumStretchedHeight()
           
 Extent getMinimumStretchedHeight()
           
 TabModel getModel()
           
 Color getScrollBarBaseColor()
          Returns the base color of the ScrollBarProperties associated with this Scrollable
 int getScrollBarPolicy()
          Returns the ScrollBarPolicy in place This can be one of : NONE ALWAYS AUTO CLIPHIDE
 ScrollBarProperties getScrollBarProperties()
          Returns the ScrollBarProperties associated with this Scrollable
 int getSelectedIndex()
           
 SingleSelectionModel getSelectionModel()
           
 int getTabBorderStyle()
          This can be one of the following values : TAB_STRIP_ONLY - shows a border around the tabs and a line betweent the tabs and the content TAB_STRIP_AND_CONTENT - shows the border around the tabs and content TAB_LINE_ONLY - shows no border around the tabs and a line betweent the tabs and the content TAB_LINE_AND_CONTENT - shows a border around the tabs and a line betweent the tabs and the content
 Extent getTabLeadInWidth()
           
 int getTabPlacement()
          Returns where the tabs are placed on the TabbedPane.
 int getTabSpacing()
           
 boolean isHeightStretched()
           
 void processInput(String inputName, Object inputValue)
           
 void setHeightStretched(boolean newValue)
          Set to true if the height should be stretched to use all available space of its parent.
 void setMaximumStretchedHeight(Extent newValue)
          Sets the maximum height that the component should stretch itself up to in pixels.
 void setMinimumStretchedHeight(Extent newValue)
          Sets the minimum height that the component should stretch itself down to in pixels.
 void setModel(TabModel model)
          Sets the TabModel used to provide the TabbedPane's tabs and content.
 void setScrollBarBaseColor(Color newValue)
          Sets the base color of the ScrollBarProperties associated with this Scrollable.
 void setScrollBarPolicy(int newScrollBarPolicy)
          Sets the scroll bar policy of the component This can be one of : SCOLLBARS_NONE SCOLLBARS_ALWAYS SCOLLBARS_AUTO CLIPHIDE
 void setScrollBarProperties(ScrollBarProperties newValue)
          Sets the ScrollBarProperties associated with this Scrollable
 void setSelectedIndex(int index)
          Sets the selected index of the TabbedPane.
 void setSelectionModel(SingleSelectionModel selectionModel)
          Sets the SingleSelectionModel used to track the selected index of the TabbedPane
 void setTabBorderStyle(int newValue)
          Sets the tab border style to use.
 void setTabLeadInWidth(Extent newValue)
          Sets the width of a lead in region before the first tab placement
 void setTabPlacement(int tabPlacement)
          Sets where the tabs are placed on the TabbedPane.
 void setTabSpacing(int tabSpacing)
          Sets the spacing (in pixels) between tabs
 int size()
           
 void validate()
           
 
Methods inherited from class echopointng.AbleComponent
getAccessKey, getBorder, getHeight, getInsets, getMouseCursor, getMouseCursorUri, getOutsets, getToolTipText, getWidth, setAccessKey, setBorder, setHeight, setInsets, setMouseCursor, setMouseCursorUri, setOutsets, setToolTipText, setWidth
 
Methods inherited from class echopointng.ComponentEx
getAttribute, getAttributeNames, getProperty, getProperty, getProperty, getProperty, getProperty, getProperty, getProperty, getProperty, getProperty, getProperty, getProperty, getProperty, getProperty, getProperty, getProperty, getProperty, getProperty, getRenderProperty, getRenderProperty, getRenderProperty, getRenderProperty, getRenderProperty, getRenderProperty, getRenderProperty, getRenderProperty, getRenderProperty, getRenderProperty, getRenderProperty, getRenderProperty, getRenderProperty, getRenderProperty, getRenderProperty, getRenderProperty, getRenderProperty, getRenderProperty, isHidden, setAttribute, setHidden, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty
 
Methods inherited from class nextapp.echo2.app.Component
add, add, addPropertyChangeListener, dispose, firePropertyChange, getApplicationInstance, getBackground, getComponent, getComponent, getComponentCount, getComponents, getEventListenerList, getFocusTraversalIndex, getFont, getForeground, getId, getIndexedProperty, getLayoutData, getLayoutDirection, getLocale, getParent, getProperty, getRenderId, getRenderIndexedProperty, getRenderIndexedProperty, getRenderLayoutDirection, getRenderLocale, getRenderProperty, getRenderProperty, getStyle, getStyleName, getVisibleComponent, getVisibleComponentCount, getVisibleComponents, hasEventListenerList, indexOf, init, isAncestorOf, isEnabled, isFocusTraversalParticipant, isRegistered, isRenderEnabled, isRenderVisible, isValidChild, isValidParent, isVisible, remove, remove, removeAll, removePropertyChangeListener, setBackground, setEnabled, setFocusTraversalIndex, setFocusTraversalParticipant, setFont, setForeground, setId, setIndexedProperty, setLayoutData, setLayoutDirection, setLocale, setProperty, setRenderId, setStyle, setStyleName, setVisible, verifyInput, visibleIndexOf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface echopointng.able.Delegateable
getRenderProperty, getRenderProperty
 
Methods inherited from interface echopointng.able.Widthable
getWidth, setWidth
 
Methods inherited from interface echopointng.able.Delegateable
getRenderProperty, getRenderProperty
 
Methods inherited from interface echopointng.able.Heightable
getHeight, setHeight
 
Methods inherited from interface echopointng.able.Delegateable
getRenderProperty, getRenderProperty
 

Field Detail

DEFAULT_STYLE

public static final Style DEFAULT_STYLE

PROPERTY_MODEL

public static final String PROPERTY_MODEL
See Also:
Constant Field Values

PROPERTY_SELECTION_MODEL

public static final String PROPERTY_SELECTION_MODEL
See Also:
Constant Field Values

PROPERTY_TAB_BORDER_STYLE

public static final String PROPERTY_TAB_BORDER_STYLE
See Also:
Constant Field Values

PROPERTY_TAB_LEAD_IN_WIDTH

public static final String PROPERTY_TAB_LEAD_IN_WIDTH
See Also:
Constant Field Values

PROPERTY_TAB_PLACEMENT

public static final String PROPERTY_TAB_PLACEMENT
See Also:
Constant Field Values

PROPERTY_TAB_SPACING

public static final String PROPERTY_TAB_SPACING
See Also:
Constant Field Values

TAB_LINE_AND_CONTENT

public static final int TAB_LINE_AND_CONTENT
TAB_LINE_AND_CONTENT - shows a border around the tabs and a line betweent the tabs and the content

It looks a bit like this (where ==== is the border and --- is the non-border area

  -----------   -----------  -----------  -----------
  -         -   -         -  -         -  -         -
  -         -   -         -  -         -  -         -
  ============================         ==========================
  =                                                             =
  =                                                             =
  =                                                             =
  =                                                             =
  =                                                             =
  =                                                             =
  ===============================================================
 

See Also:
Constant Field Values

TAB_LINE_ONLY

public static final int TAB_LINE_ONLY
TAB_LINE_ONLY - shows no border around the tabs and a line betweent the tabs and the content

It looks a bit like this (where ==== is the border and --- is the non-border area

  -----------   -----------  -----------  -----------
  -         -   -         -  -         -  -         -
  -         -   -         -  -         -  -         -
  ============================         ==========================
  -                                                             -
  -                                                             -
  -                                                             -
  -                                                             -
  -                                                             -
  -                                                             -
  ---------------------------------------------------------------
 

See Also:
Constant Field Values

TAB_STRIP_AND_CONTENT

public static final int TAB_STRIP_AND_CONTENT
TAB_STRIP_AND_CONTENT - shows the border around the tabs and content

It looks a bit like this (where ==== is the border and --- is the non-border area

  ===========   ===========  ===========  ===========
  =         =   =         =  =         =  =         =
  =         =   =         =  =         =  =         =
  ============================         ==========================
  =                                                             =
  =                                                             =
  =                                                             =
  =                                                             =
  =                                                             =
  =                                                             =
  ===============================================================
 

See Also:
Constant Field Values

TAB_STRIP_ONLY

public static final int TAB_STRIP_ONLY
TAB_STRIP_ONLY - shows a border around the tabs and a line betweent the tabs and the content

It looks a bit like this (where ==== is the border and --- is the non-border area

  ===========   ===========  ===========  ===========
  =         =   =         =  =         =  =         =
  =         =   =         =  =         =  =         =
  ============================         ==========================
  -                                                             -
  -                                                             -
  -                                                             -
  -                                                             -
  -                                                             -
  -                                                             -
  ---------------------------------------------------------------
 

See Also:
Constant Field Values
Constructor Detail

TabbedPane

public TabbedPane()
Constructs a TabbedPane with the a default empty DefaultTabModel as the TabbedPane's model.

You can retrieve this as follows to add content to the TabbedPane:

 TabbedPane tabbedPane = new TabbedPane();
 DefaultTabModel model = (DefaultTabModel) tabbedPane.getModel();
 model.addTab("Tab 1", new ContentThingy());
 model.addTab("Tab 2", new ContentThingo());
 


TabbedPane

public TabbedPane(TabModel tabModel)
Constructs a TabbedPane with the specified TabModel.

Parameters:
tabModel - - the TabModel to use for this TabbedPane
Method Detail

getModel

public TabModel getModel()
Returns:
returns the TabModel used to provide the TabbedPane's tabs and content.

getSelectedIndex

public int getSelectedIndex()
Returns:
the currently selected index in the TabbedPane's selection model

getSelectionModel

public SingleSelectionModel getSelectionModel()
Returns:
the SingleSelectionModel used to track the selected index of the TabbedPane

getTabBorderStyle

public int getTabBorderStyle()
This can be one of the following values :

Returns:
- the current tab border style.

getTabLeadInWidth

public Extent getTabLeadInWidth()
Returns:
lead in region before the first tab placement

getTabPlacement

public int getTabPlacement()
Returns where the tabs are placed on the TabbedPane. This can be one of the following values :

Returns:
- the current placement of the tabs

getTabSpacing

public int getTabSpacing()
Returns:
- the spacing (in pixels) between tabs, the default is 5

processInput

public void processInput(String inputName,
                         Object inputValue)
Overrides:
processInput in class Component
See Also:
Component.processInput(java.lang.String, java.lang.Object)

setModel

public void setModel(TabModel model)
Sets the TabModel used to provide the TabbedPane's tabs and content.

Parameters:
model - - the TabModel used to provide the TabbedPane's tabs and content.

setSelectedIndex

public void setSelectedIndex(int index)
Sets the selected index of the TabbedPane.

Shortcurt method to getSelectionModel().setSelectedIndex(index).

Parameters:
index - - the index to select

setSelectionModel

public void setSelectionModel(SingleSelectionModel selectionModel)
Sets the SingleSelectionModel used to track the selected index of the TabbedPane

Parameters:
selectionModel - - the SingleSelectionModel used to track the selected index of the TabbedPane

setTabBorderStyle

public void setTabBorderStyle(int newValue)
Sets the tab border style to use. This controls how the border is drawn around the tabs and content. This can be one of the following values :

Parameters:
newValue -
See Also:
TAB_STRIP_ONLY, TAB_STRIP_AND_CONTENT, TAB_LINE_ONLY, TAB_LINE_AND_CONTENT

setTabLeadInWidth

public void setTabLeadInWidth(Extent newValue)
Sets the width of a lead in region before the first tab placement

Parameters:
newValue - - lead in region before the first tab placement

setTabPlacement

public void setTabPlacement(int tabPlacement)
Sets where the tabs are placed on the TabbedPane. This can be one of the following values :

Parameters:
tabPlacement -

setTabSpacing

public void setTabSpacing(int tabSpacing)
Sets the spacing (in pixels) between tabs

Parameters:
tabSpacing - - the spacing (in pixels) between tabs

size

public int size()
Returns:
the size on the TabbedPane's TabModel

validate

public void validate()
Overrides:
validate in class Component
See Also:
Component.validate()

getMaximumStretchedHeight

public Extent getMaximumStretchedHeight()
Specified by:
getMaximumStretchedHeight in interface Stretchable
Returns:
- the maximum height that the component should stretch itself up to in pixels.
See Also:
Stretchable.getMaximumStretchedHeight()

getMinimumStretchedHeight

public Extent getMinimumStretchedHeight()
Specified by:
getMinimumStretchedHeight in interface Stretchable
Returns:
- the minimum height that the component should stretch itself down to in pixels.
See Also:
Stretchable.getMinimumStretchedHeight()

isHeightStretched

public boolean isHeightStretched()
Specified by:
isHeightStretched in interface Stretchable
Returns:
true if the height should be stretched to use all available space of its parent.
See Also:
Stretchable.isHeightStretched()

setHeightStretched

public void setHeightStretched(boolean newValue)
Description copied from interface: Stretchable
Set to true if the height should be stretched to use all available space of its parent.

Specified by:
setHeightStretched in interface Stretchable
Parameters:
newValue - - a boolean flag indicating whether the height should be stretched to use all available space of its parent or not.
See Also:
Stretchable.setHeightStretched(boolean)

setMaximumStretchedHeight

public void setMaximumStretchedHeight(Extent newValue)
Description copied from interface: Stretchable
Sets the maximum height that the component should stretch itself up to in pixels.

Specified by:
setMaximumStretchedHeight in interface Stretchable
Parameters:
newValue - - a new Extent value that MUST be in pixel units.
See Also:
Stretchable.setMaximumStretchedHeight(nextapp.echo2.app.Extent)

setMinimumStretchedHeight

public void setMinimumStretchedHeight(Extent newValue)
Description copied from interface: Stretchable
Sets the minimum height that the component should stretch itself down to in pixels.

Specified by:
setMinimumStretchedHeight in interface Stretchable
Parameters:
newValue - - a new Extent value that MUST be in pixel units.
See Also:
Stretchable.setMinimumStretchedHeight(nextapp.echo2.app.Extent)

getScrollBarBaseColor

public Color getScrollBarBaseColor()
Description copied from interface: Scrollable
Returns the base color of the ScrollBarProperties associated with this Scrollable

Specified by:
getScrollBarBaseColor in interface Scrollable
Returns:
the base color of the ScrollBarProperties associated with this Scrollable
See Also:
Scrollable.getScrollBarBaseColor()

getScrollBarPolicy

public int getScrollBarPolicy()
Description copied from interface: Scrollable
Returns the ScrollBarPolicy in place This can be one of :

Specified by:
getScrollBarPolicy in interface Scrollable
See Also:
Scrollable.getScrollBarPolicy()

getScrollBarProperties

public ScrollBarProperties getScrollBarProperties()
Description copied from interface: Scrollable
Returns the ScrollBarProperties associated with this Scrollable

Specified by:
getScrollBarProperties in interface Scrollable
Returns:
the ScrollBarProperties associated with this Scrollable
See Also:
Scrollable.getScrollBarProperties()

setScrollBarBaseColor

public void setScrollBarBaseColor(Color newValue)
Description copied from interface: Scrollable
Sets the base color of the ScrollBarProperties associated with this Scrollable. If no ScrollBarProperties is available, then a new one should be created.

Specified by:
setScrollBarBaseColor in interface Scrollable
Parameters:
newValue - - the new base color of ScrollBarProperties to use
See Also:
Scrollable.setScrollBarBaseColor(nextapp.echo2.app.Color)

setScrollBarPolicy

public void setScrollBarPolicy(int newScrollBarPolicy)
Description copied from interface: Scrollable
Sets the scroll bar policy of the component This can be one of :

Specified by:
setScrollBarPolicy in interface Scrollable
See Also:
Scrollable.setScrollBarPolicy(int)

setScrollBarProperties

public void setScrollBarProperties(ScrollBarProperties newValue)
Description copied from interface: Scrollable
Sets the ScrollBarProperties associated with this Scrollable

Specified by:
setScrollBarProperties in interface Scrollable
Parameters:
newValue - - the new ScrollBarProperties to use
See Also:
Scrollable.setScrollBarProperties(echopointng.able.ScrollBarProperties)

EchoPoint
2.1.0rc5