EchoPoint
1.0

echopoint
Class TabbedPane

java.lang.Object
  extended bynextapp.echo.Component
      extended bynextapp.echo.Container
          extended byechopoint.EchoPointComponent
              extended byechopoint.TabbedPane
All Implemented Interfaces:
MouseCursorable, ReflectionSetter, Scrollable, java.io.Serializable, ToolTipPopUpSupport, nextapp.echo.ToolTipSupport

public class TabbedPane
extends EchoPointComponent
implements Scrollable

The TabbedPane component provides tabbed panes to the Echo Web Framework.

Any component object can be used as the interior of the tabbed pane, however in general you would use a Panel object as the content of a tab, and then fill that Panel with other components.

The TabbedPane uses a SingleSelectionModel to represent the set of tab indices and the currently selected index. The DefaultSingleSelectionModel class only raises and event if the currently selected index changes. So to "trap" the user clicking on the same tab twice, derive your own SingleSelectionModel class.

If the tab count is greater than 0, then there will always be a selected index, which by default will be initialized to the first tab. If the tab count is 0, then the selected index will be -1.

An optional TabImageRenderer can be used to render "tab image representations". If a TabImageRenderer is in place, then the image returned will be used as the tab representation, rather then the simple text based approach. You will typically not want tab borders or tab insets if you are using a TabImageRenderer.

TabbedPane has an optimisation in place that means that only the currently selected component is given a rendering peer. This ensures that the smallest amount of memory is used to render the contents.

The width and height of the TabbedPane can be set. This sets the dimensions of the interior of the contents area. If the width is not set, ie it is set to Integer.MAX_VALUE or Integer.MIN_VALUE, then the TabbedPane will fill its containing component.

Scrollbars can also be used within the TabbedPane.

The TabbedPane can also have a close icon on each of the tabs. If this is pressed, then an ActionEvent is raised. The DefaultCloseActionListener will close the "tab" that raised the event. To use the tab closing functionality you will need to create a new DefaultCloseActionListener and attach it as well as set a close image into the TabbedPane.

Author:
Brad Baker
See Also:
for more information., Serialized Form

Nested Class Summary
static class TabbedPane.DefaultCloseActionListener
          Class for default close action.
static class TabbedPane.NestedStyleInfo
          Nested public static StyleInfo class.
 
Field Summary
static java.lang.String BORDER_COLOR_CHANGED_PROPERTY
           
static java.lang.String BORDER_SIZE_CHANGED_PROPERTY
           
static java.lang.String CLOSE_IMAGE_CHANGED_PROPERTY
           
static java.lang.String CLOSE_TOOLTIP_CHANGED_PROPERTY
           
static nextapp.echo.Color DEFAULT_BACKGROUND
           
static nextapp.echo.ImageReference DEFAULT_CLOSE_IMAGE
          default close image
static nextapp.echo.Color DEFAULT_FOREGROUND
           
static nextapp.echo.Color DEFAULT_INACTIVE_BACKGROUND
           
static nextapp.echo.Color DEFAULT_INACTIVE_FOREGROUND
           
static nextapp.echo.Color DEFAULT_INACTIVE_ROLLOVER_BACKGROUND
           
static nextapp.echo.Color DEFAULT_INACTIVE_ROLLOVER_FOREGROUND
           
static nextapp.echo.Insets DEFAULT_INSETS
           
static nextapp.echo.Color DEFAULT_ROLLOVER_BACKGROUND
           
static nextapp.echo.Color DEFAULT_ROLLOVER_FOREGROUND
           
static nextapp.echo.Insets DEFAULT_TAB_INSETS
           
static java.lang.String HEIGHT_CHANGED_PROPERTY
           
static java.lang.String ICON_SPACING_CHANGED_PROPERTY
           
static java.lang.String INACTIVE_BACKGROUND_CHANGED_PROPERTY
           
static java.lang.String INACTIVE_FONT_CHANGED_PROPERTY
           
static java.lang.String INACTIVE_FOREGROUND_CHANGED_PROPERTY
           
static java.lang.String INACTIVE_ROLLOVER_BACKGROUND_CHANGED_PROPERTY
           
static java.lang.String INACTIVE_ROLLOVER_FOREGROUND_CHANGED_PROPERTY
           
static java.lang.String INSETS_CHANGED_PROPERTY
           
static java.lang.String MODEL_CHANGED_PROPERTY
           
static java.lang.String RENDERING_CHANGED_PROPERTY
           
static java.lang.String ROLLOVER_BACKGROUND_CHANGED_PROPERTY
           
static java.lang.String ROLLOVER_FOREGROUND_CHANGED_PROPERTY
           
static java.lang.String SCROLL_BAR_X_CHANGED_PROPERTY
           
static java.lang.String SCROLL_BAR_Y_CHANGED_PROPERTY
           
static java.lang.String SCROLLBAR_POLICY_CHANGED_PROPERTY
           
static java.lang.String SELECTED_INDEX_CHANGED_PROPERTY
          Property Chnage Names
static java.lang.String STYLE_BORDER_COLOR
          A style constant for the Border Color property.
static java.lang.String STYLE_BORDER_SIZE
          A style constant for the Border Size property.
static java.lang.String STYLE_CLOSE_IMAGE
          A style constant for the Close Image property.
static java.lang.String STYLE_CLOSE_TOOLTIP
          A style constant for the Close ToolTip property.
static java.lang.String STYLE_ICON_SPACING
          A style constant for the Icon Spacing property.
static java.lang.String STYLE_INACTIVE_BACKGROUND
          A style constant for the Inactive Background property.
static java.lang.String STYLE_INACTIVE_FONT
          A style constant for the Inactive Font property.
static java.lang.String STYLE_INACTIVE_FOREGROUND
          A style constant for the Inactive Foreground property.
static java.lang.String STYLE_INACTIVE_ROLLOVER_BACKGROUND
          A style constant for the Inactive RollOver Background property.
static java.lang.String STYLE_INACTIVE_ROLLOVER_FOREGROUND
          A style constant for the Inactive RollOver Foreground property.
static java.lang.String STYLE_INSETS
          A style constant for the Insets property.
static java.lang.String STYLE_ROLLOVER_BACKGROUND
          A style constant for the RollOver Background property.
static java.lang.String STYLE_ROLLOVER_FOREGROUND
          A style constant for the RollOver Foreground property.
static java.lang.String STYLE_TAB_INSETS
          A style constant for the Tab Insets property.
static java.lang.String STYLE_TAB_PLACEMENT
          A style constant for the Inactive Font property.
static java.lang.String TAB_ADDED_PROPERTY
           
static java.lang.String TAB_COMPONENT_CHANGED_PROPERTY
           
static java.lang.String TAB_ICON_CHANGED_PROPERTY
           
static java.lang.String TAB_IMAGE_RENDERER_CHANGED_PROPERTY
           
static java.lang.String TAB_INSETS_CHANGED_PROPERTY
           
static java.lang.String TAB_PLACEMENT_CHANGED_PROPERTY
           
static java.lang.String TAB_REMOVED_PROPERTY
           
static java.lang.String TAB_SPACING_CHANGED_PROPERTY
           
static java.lang.String TAB_TIP_CHANGED_PROPERTY
           
static java.lang.String TAB_TITLE_CHANGED_PROPERTY
           
static SymbolicValue[] tabPlacementSymbolics
          Helper static SymbolicValue[] - tabPlacement - top and bottom
static java.lang.String WIDTH_CHANGED_PROPERTY
           
 
Fields inherited from class echopoint.EchoPointComponent
STYLE_TOOL_TIP_TEXT, TOOL_TIP_TEXT_CHANGED_PROPERTY, toolTipPopUp
 
Fields inherited from class nextapp.echo.Component
BACKGROUND_CHANGED_PROPERTY, CHILDREN_CHANGED_PROPERTY, ENABLED_CHANGED_PROPERTY, FONT_CHANGED_PROPERTY, FOREGROUND_CHANGED_PROPERTY, IDENTIFIER_CHANGED_PROPERTY, listenerList, LOCALE_CHANGED_PROPERTY, STYLE_BACKGROUND, STYLE_FONT, STYLE_FOREGROUND, UPDATE_PROPERTY, VISIBLE_CHANGED_PROPERTY
 
Fields inherited from interface echopoint.positionable.Scrollable
SCROLLBARS_ALWAYS, SCROLLBARS_AUTO, SCROLLBARS_CLIPHIDE, SCROLLBARS_NEVER, STYLE_HEIGHT, STYLE_SCROLL_BAR_POLICY, STYLE_WIDTH, UNDEFINED, undefinedSymbolic
 
Fields inherited from interface echopoint.positionable.MouseCursorable
borderStyleSymbolics, 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, STYLE_MOUSE_CURSOR, STYLE_MOUSE_CURSOR_URI
 
Constructor Summary
TabbedPane()
          Constructs a TabbedPane with the tab placement as EchoConstants.TOP
TabbedPane(int tabPlacement)
          Constructs a new TabbedPane
TabbedPane(int tabPlacement, TabImageRenderer renderer)
          Constructs a new TabbedPane.
TabbedPane(TabImageRenderer renderer)
          Constructs a TabbedPane with the tab placement as EchoConstants.TOP and the specified TabImageRenderer.
 
Method Summary
 void add(nextapp.echo.Component component)
          Adds a component to the TabbedPane with an empty title.
 void add(nextapp.echo.Component component, int index)
          Adds a component to the TabbedPane with an empty title.
 void add(java.lang.String tabTitle, nextapp.echo.Component component)
          Adds a component to the TabbedPane.
 void add(java.lang.String tabTitle, nextapp.echo.ImageReference tabIcon, nextapp.echo.Component component)
          Adds a component to the TabbedPane Cover method for insertTab
 void add(java.lang.String tabTitle, nextapp.echo.ImageReference tabIcon, nextapp.echo.Component component, java.lang.String tabToolTip)
          Adds a component to the TabbedPane Cover method for insertTab
 void addActionListener(nextapp.echo.event.ActionListener l)
          Adds an ActionListener to the TabbedPane.
 void addChangeListener(nextapp.echo.event.ChangeListener l)
          Adds a ChangeListener to the tabbed pane.
 void addTab(nextapp.echo.ImageReference tabIcon, nextapp.echo.Component component)
          Adds a component to the TabbedPane.
 void addTab(java.lang.String tabTitle, nextapp.echo.Component component)
          Adds a component to the TabbedPane.
 void addTab(java.lang.String tabTitle, nextapp.echo.ImageReference tabIcon, nextapp.echo.Component component)
          Adds a component to the TabbedPane Cover method for insertTab
 void addTab(java.lang.String tabTitle, nextapp.echo.ImageReference tabIcon, nextapp.echo.Component component, java.lang.String tabToolTip)
          Adds a component to the TabbedPane Cover method for insertTab
 void applyStyle(nextapp.echo.Style style)
          Applies the provided style to the component.
 void fireActionPerformed(nextapp.echo.event.ActionEvent e)
          Notifies all listeners that have registered for this event type.
 nextapp.echo.Color getBorderColor()
           
 int getBorderSize()
           
 nextapp.echo.ImageReference getCloseImage()
          Returns the image used for the close icon.
 java.lang.String getCloseToolTip()
          Returns the tooltip used for the close icon.
 nextapp.echo.Component getComponentAt(int index)
           
 int getCount()
          Returns the number of tabs within the TabbedPane.
 int getHeight()
          Returns the height of the WizardPane.
 nextapp.echo.ImageReference getIconAt(int index)
           
 int getIconSpacing()
           
 nextapp.echo.Color getInactiveBackground()
           
 nextapp.echo.Font getInactiveFont()
           
 nextapp.echo.Color getInactiveForeground()
           
 nextapp.echo.Color getInactiveRollOverBackground()
           
 nextapp.echo.Color getInactiveRollOverForeground()
           
 nextapp.echo.Insets getInsets()
          Returns the insets (margins) of the tabbed pane contents.
 SingleSelectionModel getModel()
          Returns the model associated with this TabbedPane.
 nextapp.echo.Color getRollOverBackground()
           
 nextapp.echo.Color getRollOverForeground()
           
 int getScrollBarPolicy()
          Returns the ScrollBarPolicy in place This can be one of : SCOLLBARS_NONE SCOLLBARS_ALWAYS SCOLLBARS_AUTO
 int getScrollBarX()
          Returns the position of the horizontal scroll bar, in pixels offset from the left of the component.
 int getScrollBarY()
          Returns the position of the vertical scroll bar, in pixels offset from the top the component.
 nextapp.echo.Component getSelectedComponent()
           
 int getSelectedIndex()
          Returns the currently selected tab index or -1 if none is selected
 int getTabCount()
          Returns the number of tabs within the TabbedPane.
 TabImageRenderer getTabImageRender()
          Returns the TabImageRenderer currently in use.
 int getTabIndex(nextapp.echo.Component component)
          Returns the index of the specified Component or -1 if it cannot be found.
 nextapp.echo.Insets getTabInsets()
          Returns the Insets to be used inside tabs
 int getTabPlacement()
           
 int getTabSpacing()
          Returns the spacing to be used between tabs
 java.lang.String getTitleAt(int index)
           
 java.lang.String getToolTipAt(int index)
           
 int getWidth()
          Returns the width of the WizardPane.
 int indexOfComponent(nextapp.echo.Component c)
          Returns the index of the given Component or -1 if it is not found
 int indexOfTab(nextapp.echo.ImageReference icon)
          Returns the index of the tab with the given ImageReference icon or -1 if it is not found
 int indexOfTab(java.lang.String tabTitle)
          Returns the index of the tab with the given title or -1 if it is not found
 void insertTab(java.lang.String tabTitle, nextapp.echo.ImageReference tabIcon, nextapp.echo.Component component, java.lang.String tabToolTip, int index)
          Insert a tab at the specified index.
 void remove(nextapp.echo.Component c)
          Removes a tab which corresponds to the Component c.
 void remove(int index)
          Removes a tab which corresponds to the index
 void removeActionListener(nextapp.echo.event.ActionListener l)
          Removes an ActionListener to the TabbedPane.
 void removeAll()
          Removes all tabs entries.
 void removeChangeListener(nextapp.echo.event.ChangeListener l)
          Removes a ChangeListener from this component.
 void removeTabAt(int index)
          Removes a tab from the tabbed pane at the specified index.
 java.lang.Object set(java.lang.reflect.Field field, java.lang.Object newValue)
          Called to save the old value of a field, set in a new value and return the old value of a field.
 void setBorderColor(nextapp.echo.Color newBorderColor)
          Sets the border Color of the TabbedPane
This methods fires a PropertyChangeEvent with a getPropertyName() value of TabbedPane.BORDER_COLOR_CHANGED_PROPERTY
 void setBorderSize(int newBorderSize)
          Sets the border size of the TabbedPane
This methods fires a PropertyChangeEvent with a getPropertyName() value of TabbedPane.BORDER_SIZE_CHANGED_PROPERTY
 void setCloseImage(nextapp.echo.ImageReference newCloseImage)
          Sets the image used for the close icon on each tab.
 void setCloseToolTip(java.lang.String newValue)
          Sets the text used for the close toolTip
 void setComponentAt(int index, nextapp.echo.Component component)
          Sets the Component at the specified index
This methods fires a PropertyChangeEvent with a getPropertyName() value of TabbedPane.TAB_COMPONENT_CHANGED_PROPERTY
 void setHeight(int newValue)
          Sets the height of the TabbedPane.
 void setIconAt(int index, nextapp.echo.ImageReference newImageRef)
          Sets the ImageReference icon at the specified index
This methods fires a PropertyChangeEvent with a getPropertyName() value of TabbedPane.TAB_ICON_CHANGED_PROPERTY
 void setIconSpacing(int newIconSpacing)
          Sets the icon spacing of the TabbedPane
This methods fires a PropertyChangeEvent with a getPropertyName() value of TabbedPane.ICON_SPACING_CHANGED_PROPERTY
 void setInactiveBackground(nextapp.echo.Color newInactiveBackground)
          Sets the background Color of the TabbedPane's inactive tabs.
 void setInactiveFont(nextapp.echo.Font newInactiveFont)
          Sets the Font of the TabbedPane's inactive tabs.
 void setInactiveForeground(nextapp.echo.Color newInactiveForeground)
          Sets the foreground Color of the TabbedPane's inactive tabs.
 void setInactiveRollOverBackground(nextapp.echo.Color newInactiveRollOverBackground)
          Sets the rollover background Color of the TabbedPane's inactive tabs.
 void setInactiveRollOverForeground(nextapp.echo.Color newInactiveRollOverForeground)
          Sets the rollover foreground Color of the TabbedPane's inactive tabs.
 void setInsets(nextapp.echo.Insets newValue)
          Sets the insets (margins) of the TabbedPane
 void setModel(SingleSelectionModel model)
          Sets the model to be used with this TabbedPane .
 void setRollOverBackground(nextapp.echo.Color newRollOverBackground)
          Sets the rollover background Color of the TabbedPane's tabs.
 void setRollOverForeground(nextapp.echo.Color newRollOverForeground)
          Sets the rollover foreground Color of the TabbedPane's tabs.
 void setScrollBarPolicy(int newScrollBarPolicy)
          This sets the scroll bar policy to use.
 void setScrollBarX(int newValue)
          Sets the position of the horizontal scroll bar, in pixels offset from the left of the component.
 void setScrollBarY(int newValue)
          Sets the position of the vertical scroll bar, in pixels offset from the top of the component.
 void setSelected(nextapp.echo.Component component)
          This will set the specified Component as the selected tab.
 void setSelectedIndex(int index)
          Sets the selected tab of the TabbedPane.
 void setTabImageRender(TabImageRenderer renderer)
          Sets the TabImageRenderer to use
 void setTabInsets(nextapp.echo.Insets insets)
          Sets the Insets to be used inside tabs
 void setTabPlacement(int newTabPlacement)
          Sets the tab placement of the TabbedPane
 void setTabSpacing(int i)
          Sets the spacing to be used between tabs.
 void setTitleAt(int index, java.lang.String tabTitle)
          Sets the title at the specified index
This methods fires a PropertyChangeEvent with a getPropertyName() value of TabbedPane.TAB_TITLE_CHANGED_PROPERTY
 void setToolTipAt(int index, java.lang.String tabToolTip)
          Sets the tool tip text at the specified index
This methods fires a PropertyChangeEvent with a getPropertyName() value of TabbedPane.TAB_TIP_CHANGED_PROPERTY
 void setWidth(int newValue)
          Sets the width of the TabbedPane.
 void validate()
           
 
Methods inherited from class echopoint.EchoPointComponent
getMouseCursor, getMouseCursorURI, getToolTipPopUp, getToolTipText, set, set, set, set, set, set, set, set, set, setEnabledAllChildren, setMouseCursor, setMouseCursorURI, setToolTipText
 
Methods inherited from class nextapp.echo.Component
addHierarchyListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getComponent, getComponentCount, getComponents, getEchoInstance, getFont, getForeground, getIdentifier, getLocale, getParent, indexOf, init, isAncestorOf, isEnabled, isRegistered, isShowing, isVisible, removeHierarchyListener, removePropertyChangeListener, setBackground, setEnabled, setFont, setForeground, setIdentifier, setLocale, setVisible, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STYLE_BORDER_COLOR

public static final java.lang.String STYLE_BORDER_COLOR
A style constant for the Border Color property. Values of this key must be of type nextapp.echo.Color.

See Also:
Constant Field Values

STYLE_BORDER_SIZE

public static final java.lang.String STYLE_BORDER_SIZE
A style constant for the Border Size property. Values of this key must be of type Integer.

See Also:
Constant Field Values

STYLE_ICON_SPACING

public static final java.lang.String STYLE_ICON_SPACING
A style constant for the Icon Spacing property. Values of this key must be of type Integer.

See Also:
Constant Field Values

STYLE_INSETS

public static final java.lang.String STYLE_INSETS
A style constant for the Insets property. Values of this key must be of type nextapp.echo.Insets.

See Also:
Constant Field Values

STYLE_TAB_INSETS

public static final java.lang.String STYLE_TAB_INSETS
A style constant for the Tab Insets property. Values of this key must be of type nextapp.echo.Insets.

See Also:
Constant Field Values

STYLE_ROLLOVER_BACKGROUND

public static final java.lang.String STYLE_ROLLOVER_BACKGROUND
A style constant for the RollOver Background property. Values of this key must be of type nextapp.echo.Color.

See Also:
Constant Field Values

STYLE_ROLLOVER_FOREGROUND

public static final java.lang.String STYLE_ROLLOVER_FOREGROUND
A style constant for the RollOver Foreground property. Values of this key must be of type nextapp.echo.Color.

See Also:
Constant Field Values

STYLE_INACTIVE_BACKGROUND

public static final java.lang.String STYLE_INACTIVE_BACKGROUND
A style constant for the Inactive Background property. Values of this key must be of type nextapp.echo.Color.

See Also:
Constant Field Values

STYLE_INACTIVE_FOREGROUND

public static final java.lang.String STYLE_INACTIVE_FOREGROUND
A style constant for the Inactive Foreground property. Values of this key must be of type nextapp.echo.Color.

See Also:
Constant Field Values

STYLE_INACTIVE_ROLLOVER_BACKGROUND

public static final java.lang.String STYLE_INACTIVE_ROLLOVER_BACKGROUND
A style constant for the Inactive RollOver Background property. Values of this key must be of type nextapp.echo.Color.

See Also:
Constant Field Values

STYLE_INACTIVE_ROLLOVER_FOREGROUND

public static final java.lang.String STYLE_INACTIVE_ROLLOVER_FOREGROUND
A style constant for the Inactive RollOver Foreground property. Values of this key must be of type nextapp.echo.Color.

See Also:
Constant Field Values

STYLE_INACTIVE_FONT

public static final java.lang.String STYLE_INACTIVE_FONT
A style constant for the Inactive Font property. Values of this key must be of type nextapp.echo.Font.

See Also:
Constant Field Values

STYLE_TAB_PLACEMENT

public static final java.lang.String STYLE_TAB_PLACEMENT
A style constant for the Inactive Font property. Values of this key must be of type nextapp.echo.Font.

See Also:
Constant Field Values

STYLE_CLOSE_IMAGE

public static final java.lang.String STYLE_CLOSE_IMAGE
A style constant for the Close Image property. Values of this key must be of type nextapp.ImageReference

See Also:
Constant Field Values

STYLE_CLOSE_TOOLTIP

public static final java.lang.String STYLE_CLOSE_TOOLTIP
A style constant for the Close ToolTip property. Values of this key must be of type String

See Also:
Constant Field Values

tabPlacementSymbolics

public static SymbolicValue[] tabPlacementSymbolics
Helper static SymbolicValue[] - tabPlacement - top and bottom


SELECTED_INDEX_CHANGED_PROPERTY

public static final java.lang.String SELECTED_INDEX_CHANGED_PROPERTY
Property Chnage Names

See Also:
Constant Field Values

MODEL_CHANGED_PROPERTY

public static final java.lang.String MODEL_CHANGED_PROPERTY
See Also:
Constant Field Values

TAB_REMOVED_PROPERTY

public static final java.lang.String TAB_REMOVED_PROPERTY
See Also:
Constant Field Values

TAB_ADDED_PROPERTY

public static final java.lang.String TAB_ADDED_PROPERTY
See Also:
Constant Field Values

TAB_PLACEMENT_CHANGED_PROPERTY

public static final java.lang.String TAB_PLACEMENT_CHANGED_PROPERTY
See Also:
Constant Field Values

BORDER_COLOR_CHANGED_PROPERTY

public static final java.lang.String BORDER_COLOR_CHANGED_PROPERTY
See Also:
Constant Field Values

BORDER_SIZE_CHANGED_PROPERTY

public static final java.lang.String BORDER_SIZE_CHANGED_PROPERTY
See Also:
Constant Field Values

ROLLOVER_FOREGROUND_CHANGED_PROPERTY

public static final java.lang.String ROLLOVER_FOREGROUND_CHANGED_PROPERTY
See Also:
Constant Field Values

ROLLOVER_BACKGROUND_CHANGED_PROPERTY

public static final java.lang.String ROLLOVER_BACKGROUND_CHANGED_PROPERTY
See Also:
Constant Field Values

INACTIVE_FOREGROUND_CHANGED_PROPERTY

public static final java.lang.String INACTIVE_FOREGROUND_CHANGED_PROPERTY
See Also:
Constant Field Values

INACTIVE_BACKGROUND_CHANGED_PROPERTY

public static final java.lang.String INACTIVE_BACKGROUND_CHANGED_PROPERTY
See Also:
Constant Field Values

INACTIVE_ROLLOVER_FOREGROUND_CHANGED_PROPERTY

public static final java.lang.String INACTIVE_ROLLOVER_FOREGROUND_CHANGED_PROPERTY
See Also:
Constant Field Values

INACTIVE_ROLLOVER_BACKGROUND_CHANGED_PROPERTY

public static final java.lang.String INACTIVE_ROLLOVER_BACKGROUND_CHANGED_PROPERTY
See Also:
Constant Field Values

INACTIVE_FONT_CHANGED_PROPERTY

public static final java.lang.String INACTIVE_FONT_CHANGED_PROPERTY
See Also:
Constant Field Values

INSETS_CHANGED_PROPERTY

public static final java.lang.String INSETS_CHANGED_PROPERTY
See Also:
Constant Field Values

TAB_INSETS_CHANGED_PROPERTY

public static final java.lang.String TAB_INSETS_CHANGED_PROPERTY
See Also:
Constant Field Values

ICON_SPACING_CHANGED_PROPERTY

public static final java.lang.String ICON_SPACING_CHANGED_PROPERTY
See Also:
Constant Field Values

TAB_SPACING_CHANGED_PROPERTY

public static final java.lang.String TAB_SPACING_CHANGED_PROPERTY
See Also:
Constant Field Values

TAB_ICON_CHANGED_PROPERTY

public static final java.lang.String TAB_ICON_CHANGED_PROPERTY
See Also:
Constant Field Values

TAB_TITLE_CHANGED_PROPERTY

public static final java.lang.String TAB_TITLE_CHANGED_PROPERTY
See Also:
Constant Field Values

TAB_TIP_CHANGED_PROPERTY

public static final java.lang.String TAB_TIP_CHANGED_PROPERTY
See Also:
Constant Field Values

TAB_COMPONENT_CHANGED_PROPERTY

public static final java.lang.String TAB_COMPONENT_CHANGED_PROPERTY
See Also:
Constant Field Values

RENDERING_CHANGED_PROPERTY

public static final java.lang.String RENDERING_CHANGED_PROPERTY
See Also:
Constant Field Values

TAB_IMAGE_RENDERER_CHANGED_PROPERTY

public static final java.lang.String TAB_IMAGE_RENDERER_CHANGED_PROPERTY
See Also:
Constant Field Values

SCROLLBAR_POLICY_CHANGED_PROPERTY

public static final java.lang.String SCROLLBAR_POLICY_CHANGED_PROPERTY
See Also:
Constant Field Values

WIDTH_CHANGED_PROPERTY

public static final java.lang.String WIDTH_CHANGED_PROPERTY
See Also:
Constant Field Values

HEIGHT_CHANGED_PROPERTY

public static final java.lang.String HEIGHT_CHANGED_PROPERTY
See Also:
Constant Field Values

SCROLL_BAR_X_CHANGED_PROPERTY

public static final java.lang.String SCROLL_BAR_X_CHANGED_PROPERTY
See Also:
Constant Field Values

SCROLL_BAR_Y_CHANGED_PROPERTY

public static final java.lang.String SCROLL_BAR_Y_CHANGED_PROPERTY
See Also:
Constant Field Values

CLOSE_IMAGE_CHANGED_PROPERTY

public static final java.lang.String CLOSE_IMAGE_CHANGED_PROPERTY
See Also:
Constant Field Values

CLOSE_TOOLTIP_CHANGED_PROPERTY

public static final java.lang.String CLOSE_TOOLTIP_CHANGED_PROPERTY
See Also:
Constant Field Values

DEFAULT_INSETS

public static final nextapp.echo.Insets DEFAULT_INSETS

DEFAULT_TAB_INSETS

public static final nextapp.echo.Insets DEFAULT_TAB_INSETS

DEFAULT_BACKGROUND

public static final nextapp.echo.Color DEFAULT_BACKGROUND

DEFAULT_FOREGROUND

public static final nextapp.echo.Color DEFAULT_FOREGROUND

DEFAULT_ROLLOVER_BACKGROUND

public static final nextapp.echo.Color DEFAULT_ROLLOVER_BACKGROUND

DEFAULT_ROLLOVER_FOREGROUND

public static final nextapp.echo.Color DEFAULT_ROLLOVER_FOREGROUND

DEFAULT_INACTIVE_BACKGROUND

public static final nextapp.echo.Color DEFAULT_INACTIVE_BACKGROUND

DEFAULT_INACTIVE_FOREGROUND

public static final nextapp.echo.Color DEFAULT_INACTIVE_FOREGROUND

DEFAULT_INACTIVE_ROLLOVER_BACKGROUND

public static final nextapp.echo.Color DEFAULT_INACTIVE_ROLLOVER_BACKGROUND

DEFAULT_INACTIVE_ROLLOVER_FOREGROUND

public static final nextapp.echo.Color DEFAULT_INACTIVE_ROLLOVER_FOREGROUND

DEFAULT_CLOSE_IMAGE

public static nextapp.echo.ImageReference DEFAULT_CLOSE_IMAGE
default close image

Constructor Detail

TabbedPane

public TabbedPane(TabImageRenderer renderer)
Constructs a TabbedPane with the tab placement as EchoConstants.TOP and the specified TabImageRenderer.

If the TabImageRenderer is non null then the borders will be removed and the tab insets will be set to zero. This is usually the appearance you will want.


TabbedPane

public TabbedPane()
Constructs a TabbedPane with the tab placement as EchoConstants.TOP


TabbedPane

public TabbedPane(int tabPlacement)
Constructs a new TabbedPane

Parameters:
tabPlacement - the tab placement of the tabbed pane, can be one of the following values.

TabbedPane

public TabbedPane(int tabPlacement,
                  TabImageRenderer renderer)
Constructs a new TabbedPane.

If the TabImageRenderer is non null then the borders will be removed and the tab insets will be set to zero. This is usually the appearance you will want.

Parameters:
tabPlacement - the tab placement of the tabbed pane, can be one of the following values.
renderer - - the TabImageRenderer to use
Method Detail

addActionListener

public void addActionListener(nextapp.echo.event.ActionListener l)
Adds an ActionListener to the TabbedPane. It will be informed if the Tabs have close icons and the use has asked to close the tab.

Parameters:
l - - a new ActionListener

removeActionListener

public void removeActionListener(nextapp.echo.event.ActionListener l)
Removes an ActionListener to the TabbedPane.

Parameters:
l - - a ActionListener to remove

fireActionPerformed

public void fireActionPerformed(nextapp.echo.event.ActionEvent e)
Notifies all listeners that have registered for this event type.

Parameters:
e - The ActionEvent to send.

add

public void add(java.lang.String tabTitle,
                nextapp.echo.Component component)
Adds a component to the TabbedPane.

Cover method for insertTab


add

public void add(java.lang.String tabTitle,
                nextapp.echo.ImageReference tabIcon,
                nextapp.echo.Component component)
Adds a component to the TabbedPane

Cover method for insertTab


add

public void add(java.lang.String tabTitle,
                nextapp.echo.ImageReference tabIcon,
                nextapp.echo.Component component,
                java.lang.String tabToolTip)
Adds a component to the TabbedPane

Cover method for insertTab


add

public void add(nextapp.echo.Component component)
Adds a component to the TabbedPane with an empty title.

Cover method for insertTab


add

public void add(nextapp.echo.Component component,
                int index)
Adds a component to the TabbedPane with an empty title. at the specified index.

Cover method for insertTab


addChangeListener

public void addChangeListener(nextapp.echo.event.ChangeListener l)
Adds a ChangeListener to the tabbed pane.

Parameters:
l - The ChangeListener to be added.

addTab

public void addTab(java.lang.String tabTitle,
                   nextapp.echo.Component component)
Adds a component to the TabbedPane. Cover method for insertTab


addTab

public void addTab(nextapp.echo.ImageReference tabIcon,
                   nextapp.echo.Component component)
Adds a component to the TabbedPane. Cover method for insertTab


addTab

public void addTab(java.lang.String tabTitle,
                   nextapp.echo.ImageReference tabIcon,
                   nextapp.echo.Component component)
Adds a component to the TabbedPane Cover method for insertTab


addTab

public void addTab(java.lang.String tabTitle,
                   nextapp.echo.ImageReference tabIcon,
                   nextapp.echo.Component component,
                   java.lang.String tabToolTip)
Adds a component to the TabbedPane Cover method for insertTab


applyStyle

public void applyStyle(nextapp.echo.Style style)
Applies the provided style to the component. The base nextapp.echo.Component style names can be used as well.

Specified by:
applyStyle in interface Scrollable
Overrides:
applyStyle in class EchoPointComponent
See Also:
Component.applyStyle(nextapp.echo.Style)

getBorderColor

public nextapp.echo.Color getBorderColor()
Returns:
The Color of the TabbedPane's border.

getBorderSize

public int getBorderSize()
Returns:
The size of the TabbedPane's border.

getComponentAt

public nextapp.echo.Component getComponentAt(int index)
Returns:
The Component of the tab at the specified index.

getCount

public int getCount()
Returns the number of tabs within the TabbedPane.


getHeight

public int getHeight()
Returns the height of the WizardPane. If this value is -1, then no height will be used.

Specified by:
getHeight in interface Scrollable

getIconAt

public nextapp.echo.ImageReference getIconAt(int index)
Returns:
The ImageReference incon of the tab at the specified index.

getIconSpacing

public int getIconSpacing()
Returns:
The icon spacing of the TabbedPane

getInactiveBackground

public nextapp.echo.Color getInactiveBackground()
Returns:
the background Color of the inactive tabs

getInactiveFont

public nextapp.echo.Font getInactiveFont()
Returns:
the Font of the inactive tabs

getInactiveForeground

public nextapp.echo.Color getInactiveForeground()
Returns:
the foreground Color of the inactive tabs

getInactiveRollOverBackground

public nextapp.echo.Color getInactiveRollOverBackground()
Returns:
the rollover background Color of the inactive tabs

getInactiveRollOverForeground

public nextapp.echo.Color getInactiveRollOverForeground()
Returns:
the rollover foreground Color of the inactive tabs

getInsets

public nextapp.echo.Insets getInsets()
Returns the insets (margins) of the tabbed pane contents.

Returns:
The insets of the tabbed pane.

getModel

public SingleSelectionModel getModel()
Returns the model associated with this TabbedPane.


getRollOverBackground

public nextapp.echo.Color getRollOverBackground()
Returns:
the rollover background Color of the tabs

getRollOverForeground

public nextapp.echo.Color getRollOverForeground()
Returns:
the rollover foreground Color of the tabs

getScrollBarPolicy

public int getScrollBarPolicy()
Returns the ScrollBarPolicy in place This can be one of :

Specified by:
getScrollBarPolicy in interface Scrollable

getScrollBarX

public int getScrollBarX()
Returns the position of the horizontal scroll bar, in pixels offset from the left of the component.

Specified by:
getScrollBarX in interface Scrollable
Returns:
The position of the horizontal scroll bar.

getScrollBarY

public int getScrollBarY()
Returns the position of the vertical scroll bar, in pixels offset from the top the component.

Specified by:
getScrollBarY in interface Scrollable
Returns:
The position of the vertical scroll bar.

getSelectedComponent

public nextapp.echo.Component getSelectedComponent()
Returns:
the Component at the currently selected index or null if no tab is currently selected.

getSelectedIndex

public int getSelectedIndex()
Returns the currently selected tab index or -1 if none is selected


getTabCount

public int getTabCount()
Returns the number of tabs within the TabbedPane.


getTabPlacement

public int getTabPlacement()
Returns:
The tab placement of the TabbedPane

getTitleAt

public java.lang.String getTitleAt(int index)
Returns:
The title of the tab at the specified index.

getToolTipAt

public java.lang.String getToolTipAt(int index)
Returns:
The tool tip of the tab at the specified index.

getWidth

public int getWidth()
Returns the width of the WizardPane. If this value is -1, then no width will be used.

Specified by:
getWidth in interface Scrollable

indexOfComponent

public int indexOfComponent(nextapp.echo.Component c)
Returns the index of the given Component or -1 if it is not found


indexOfTab

public int indexOfTab(java.lang.String tabTitle)
Returns the index of the tab with the given title or -1 if it is not found


indexOfTab

public int indexOfTab(nextapp.echo.ImageReference icon)
Returns the index of the tab with the given ImageReference icon or -1 if it is not found


getTabIndex

public int getTabIndex(nextapp.echo.Component component)
Returns the index of the specified Component or -1 if it cannot be found.

Parameters:
component - - the component to search for
Returns:
- the index where ther component occurs or -1 if it cannot be found

setSelected

public void setSelected(nextapp.echo.Component component)
                 throws java.util.NoSuchElementException
This will set the specified Component as the selected tab.

Parameters:
component - - the component to search for
Throws:
java.util.NoSuchElementException - if the Component cannnot be found

insertTab

public void insertTab(java.lang.String tabTitle,
                      nextapp.echo.ImageReference tabIcon,
                      nextapp.echo.Component component,
                      java.lang.String tabToolTip,
                      int index)
Insert a tab at the specified index.


remove

public void remove(int index)
Removes a tab which corresponds to the index


remove

public void remove(nextapp.echo.Component c)
Removes a tab which corresponds to the Component c.


removeAll

public void removeAll()
Removes all tabs entries.


removeChangeListener

public void removeChangeListener(nextapp.echo.event.ChangeListener l)
Removes a ChangeListener from this component.

Parameters:
l - the ChangeListener to remove

removeTabAt

public void removeTabAt(int index)
Removes a tab from the tabbed pane at the specified index.


setBorderColor

public void setBorderColor(nextapp.echo.Color newBorderColor)
Sets the border Color of the TabbedPane
This methods fires a PropertyChangeEvent with a getPropertyName() value of TabbedPane.BORDER_COLOR_CHANGED_PROPERTY


setBorderSize

public void setBorderSize(int newBorderSize)
Sets the border size of the TabbedPane
This methods fires a PropertyChangeEvent with a getPropertyName() value of TabbedPane.BORDER_SIZE_CHANGED_PROPERTY


setComponentAt

public void setComponentAt(int index,
                           nextapp.echo.Component component)
Sets the Component at the specified index
This methods fires a PropertyChangeEvent with a getPropertyName() value of TabbedPane.TAB_COMPONENT_CHANGED_PROPERTY


setHeight

public void setHeight(int newValue)
Sets the height of the TabbedPane. If this value is -1, then no height will be used.

Note that this is the height of the contents of the TabbedPane not the outside of the TabbedPane. This allows scrolling within the contents of the TabbedPane.

This methods fires a PropertyChangeEvent with a getPropertyName() value of TabbedPane.HEIGHT_CHANGED_PROPERTY

Specified by:
setHeight in interface Scrollable

setIconAt

public void setIconAt(int index,
                      nextapp.echo.ImageReference newImageRef)
Sets the ImageReference icon at the specified index
This methods fires a PropertyChangeEvent with a getPropertyName() value of TabbedPane.TAB_ICON_CHANGED_PROPERTY


setIconSpacing

public void setIconSpacing(int newIconSpacing)
Sets the icon spacing of the TabbedPane
This methods fires a PropertyChangeEvent with a getPropertyName() value of TabbedPane.ICON_SPACING_CHANGED_PROPERTY


setInactiveBackground

public void setInactiveBackground(nextapp.echo.Color newInactiveBackground)
Sets the background Color of the TabbedPane's inactive tabs.
This methods fires a PropertyChangeEvent with a getPropertyName() value of TabbedPane.INACTIVE_BACKGROUND_CHANGED_PROPERTY


setInactiveFont

public void setInactiveFont(nextapp.echo.Font newInactiveFont)
Sets the Font of the TabbedPane's inactive tabs.
This methods fires a PropertyChangeEvent with a getPropertyName() value of TabbedPane.INACTIVE_FONT_CHANGED_PROPERTY


setInactiveForeground

public void setInactiveForeground(nextapp.echo.Color newInactiveForeground)
Sets the foreground Color of the TabbedPane's inactive tabs.
This methods fires a PropertyChangeEvent with a getPropertyName() value of TabbedPane.INACTIVE_BACKGROUND_CHANGED_PROPERTY


setInactiveRollOverBackground

public void setInactiveRollOverBackground(nextapp.echo.Color newInactiveRollOverBackground)
Sets the rollover background Color of the TabbedPane's inactive tabs.
This methods fires a PropertyChangeEvent with a getPropertyName() value of TabbedPane.INACTIVE_ROLLOVER_BACKGROUND_CHANGED_PROPERTY


setInactiveRollOverForeground

public void setInactiveRollOverForeground(nextapp.echo.Color newInactiveRollOverForeground)
Sets the rollover foreground Color of the TabbedPane's inactive tabs.
This methods fires a PropertyChangeEvent with a getPropertyName() value of TabbedPane.INACTIVE_ROLLOVER_BACKGROUND_CHANGED_PROPERTY


setInsets

public void setInsets(nextapp.echo.Insets newValue)
Sets the insets (margins) of the TabbedPane

Parameters:
newValue - An insets object that specifies the size of each margin of this TabbedPane

setModel

public void setModel(SingleSelectionModel model)
Sets the model to be used with this TabbedPane .

Parameters:
model - the model to be used

setRollOverBackground

public void setRollOverBackground(nextapp.echo.Color newRollOverBackground)
Sets the rollover background Color of the TabbedPane's tabs.
This methods fires a PropertyChangeEvent with a getPropertyName() value of TabbedPane.ROLLOVER_BACKGROUND_CHANGED_PROPERTY


setRollOverForeground

public void setRollOverForeground(nextapp.echo.Color newRollOverForeground)
Sets the rollover foreground Color of the TabbedPane's tabs.
This methods fires a PropertyChangeEvent with a getPropertyName() value of TabbedPane.ROLLOVER_BACKGROUND_CHANGED_PROPERTY


setScrollBarPolicy

public void setScrollBarPolicy(int newScrollBarPolicy)
This sets the scroll bar policy to use. This can be one of :

Specified by:
setScrollBarPolicy in interface Scrollable

setScrollBarX

public void setScrollBarX(int newValue)
Sets the position of the horizontal scroll bar, in pixels offset from the left of the component.

Specified by:
setScrollBarX in interface Scrollable
Parameters:
newValue - The new position of the horizontal scroll bar, in pixels.

setScrollBarY

public void setScrollBarY(int newValue)
Sets the position of the vertical scroll bar, in pixels offset from the top of the component.

Specified by:
setScrollBarY in interface Scrollable
Parameters:
newValue - The new position of the vertical scroll bar, in pixels.

setSelectedIndex

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


setTabPlacement

public void setTabPlacement(int newTabPlacement)
Sets the tab placement of the TabbedPane

Parameters:
newTabPlacement - the tab placement of the tabbed pane, can be one of the following values.
  • EchoConstants.TOP (the default)
  • EchoConstants.BOTTOM

setTitleAt

public void setTitleAt(int index,
                       java.lang.String tabTitle)
Sets the title at the specified index
This methods fires a PropertyChangeEvent with a getPropertyName() value of TabbedPane.TAB_TITLE_CHANGED_PROPERTY


setToolTipAt

public void setToolTipAt(int index,
                         java.lang.String tabToolTip)
Sets the tool tip text at the specified index
This methods fires a PropertyChangeEvent with a getPropertyName() value of TabbedPane.TAB_TIP_CHANGED_PROPERTY


setWidth

public void setWidth(int newValue)
Sets the width of the TabbedPane. If this value is -1, then no width will be used.

Note that this is the height of the contents of the TabbedPane not the outside of the TabbedPane. This allows scrolling within the contents of the TabbedPane.

This methods fires a PropertyChangeEvent with a getPropertyName() value of TabbedPane.WIDTH_CHANGED_PROPERTY

Specified by:
setWidth in interface Scrollable

getCloseImage

public nextapp.echo.ImageReference getCloseImage()
Returns the image used for the close icon.

Returns:
nextapp.echo.ImageReference

getCloseToolTip

public java.lang.String getCloseToolTip()
Returns the tooltip used for the close icon.

Returns:
nextapp.echo.ImageReference

setCloseImage

public void setCloseImage(nextapp.echo.ImageReference newCloseImage)
Sets the image used for the close icon on each tab.

Parameters:
newCloseImage - nextapp.echo.ImageReference

setCloseToolTip

public void setCloseToolTip(java.lang.String newValue)
Sets the text used for the close toolTip

Parameters:
newValue - String

validate

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

getTabInsets

public nextapp.echo.Insets getTabInsets()
Returns the Insets to be used inside tabs

Returns:
- the Insets to be used inside tabs

getTabSpacing

public int getTabSpacing()
Returns the spacing to be used between tabs

Returns:
the spacing to be used between tabs

setTabInsets

public void setTabInsets(nextapp.echo.Insets insets)
Sets the Insets to be used inside tabs

Parameters:
insets - - the Insets to be used inside tabs

setTabSpacing

public void setTabSpacing(int i)
Sets the spacing to be used between tabs.

Parameters:
i - the spacing to be used between tabs.

getTabImageRender

public TabImageRenderer getTabImageRender()
Returns the TabImageRenderer currently in use. This can be null.

Returns:
the TabImageRenderer in use

setTabImageRender

public void setTabImageRender(TabImageRenderer renderer)
Sets the TabImageRenderer to use

Parameters:
renderer - the TabImageRenderer to use

set

public java.lang.Object set(java.lang.reflect.Field field,
                            java.lang.Object newValue)
                     throws java.lang.Exception
Description copied from interface: ReflectionSetter
Called to save the old value of a field, set in a new value and return the old value of a field. This interface allows a field set operation to be "delegated" back into the class that has permission to perform the field set.

 public Object set(Field f, Object newValue) throws Exception {
      Object oldValue = f.get(this);
      f.set(this,newValue);
      return oldValue;
 }
 

Specified by:
set in interface ReflectionSetter
Parameters:
field - - the field to be set
newValue - - the new value to be set
Returns:
the oldValue of the field
Throws:
java.lang.Exception
See Also:
ReflectionSetter.set(Field, Object)

EchoPoint
1.0