Class symantec.itools.awt.TabPanel
All Packages Class Hierarchy This Package Previous Next Index
Class symantec.itools.awt.TabPanel
Object
|
+----Component
|
+----Container
|
+----Panel
|
+----BaseTabbedPanel
|
+----symantec.itools.awt.TabPanel
- public class TabPanel
- extends BaseTabbedPanel
- implements Serializable
TabPanel is a Panel extension which provides for a tabbed dialog effect.
Along the top (by default) of the panel is a series of file folder-like tabs,
each with a text label. Each tab is associated with a panel or component
that gets shown when the user clicks on the tab.
The TabPanel automatically manages swapping panels when a tab selected.
It can be used directly or extended.
When extending from TabPanel be sure to super()
during construction and to super.handleEvent(evt) from
handleEvent if you override it.
- Author:
- Scott Fauerbach
-
symantec.itools.awt.TabPanel()
- Constructs a TabPanel with tabs on top, rounded
-
symantec.itools.awt.TabPanel(boolean)
- Obsolete.
-
symantec.itools.awt.TabPanel(int, int)
- Constructs a TabPanel with the tabs in the given position and
having the specified look.
-
add(Component)
- Adds a component to the end of this container.
-
add(Component, int)
- Adds a component to the end of this container.
-
add(String, Component)
- Takes no action.
-
addPropertyChangeListener(PropertyChangeListener)
- Adds a listener for all event changes.
-
addTabPanel(String, boolean, Component)
- Appends a new tab and associated panel, which will be shown when the
tab is selected.
-
addTabPanel(String, boolean, Component, int)
- Adds a new tab and associated panel.
-
addVetoableChangeListener(VetoableChangeListener)
- Adds a vetoable listener for all event changes.
-
countTabs()
- Gets the number of tab panels in the TabPanel.
-
enableTabPanel(boolean, int)
- Conditionally enables a tab and its associated panel at the given index.
-
getCurrentPanelNdx()
- Returns the zero-relative index of the currently selected panel.
-
getMinimumSize()
- Returns the minimum dimensions to properly display this component.
-
getPanelLabel(int)
- Gets the current tab label associated with the current panels at the given index.
-
getPanelLabels()
- Gets the current tab labels associated with the panel positions.
-
getPanelTabIndex(Component)
- Gets the index for a specific panel.
-
getPreferredSize()
- Returns the recommended dimensions to properly display this component.
-
getTabPanel(int)
- Gets the panel for the tab at the given index.
-
getTabsOnBottom()
-
-
insertTabPanel(String, boolean, Component, int)
- Inserts a tab panel based on index.
-
isTabsOnBottom()
- Gets whether the tabs are at the bottom of the dialog.
-
remove(Component)
- Removes the specified component from this container.
-
removeAllTabPanels()
- Removes all tabs and their associated panels, clearing the TabPanel entirely.
-
removePropertyChangeListener(PropertyChangeListener)
- Removes a listener for all event changes.
-
removeTabPanel(int)
- Removes a tab and its associated panel at the given index.
-
removeVetoableChangeListener(VetoableChangeListener)
- Removes a vetoable listener for all event changes.
-
setCurrentPanelNdx(int)
- Selects the specified tab and shows its associated panel.
-
setPanelLabel(String, int)
- Sets the tab label associated with the current panels at the given index.
-
setPanelLabels(String[])
- Sets the tab labels associated with the panel positions.
-
setTabPanel(String, boolean, Component, int)
- Replaces a tab and its associated panel at the index specified.
-
setTabsOnBottom(boolean)
- Puts the tabs on the top or bottom of the dialog.
-
showTabPanel(int)
- Selects the tab at the given index, showing it and its associated panel.
-
updatePanelLabels()
- This routine re-sets all the tab labels using the latest string array
provided in setPanelLabels().
TabPanel
public TabPanel()
- Constructs a TabPanel with tabs on top, rounded
TabPanel
public TabPanel(boolean bTabsOnTop)
- Obsolete. Use TabPanel(int tabsPostion, int tabsStyle).
TabPanel
public TabPanel(int tabsPostion,
int tabsStyle)
- Constructs a TabPanel with the tabs in the given position and
having the specified look.
Note that if the tabs are on top, then they always are rounded.
- Parameters:
- tabsPosition - a constant indicating TOP or BOTTOM
- tabsStyle - a constant indicating ROUNDED or SQUARE
- See Also:
- TOP, BOTTOM, ROUNDED, SQUARE
add
public java.awt.Component add(Component comp)
- Adds a component to the end of this container.
This is a standard Java AWT method which gets called to add a
component to a container. The specified component is added to
the end of this container.
If the tab label for this position has not been set it is given
the name "tab - #", where # is the zero-relative index of its
position.
- Parameters:
- comp - the component to add
- Returns:
- the added component
- Overrides:
- add in class BaseTabbedPanel
- See Also:
- remove
add
public synchronized java.awt.Component add(Component comp,
int pos)
- Adds a component to the end of this container.
This is a standard Java AWT method which gets called to add a
component to a container. Typically, the specified component is added to
this container at the given zero-relative position index. A
position index of -1 would append the component to the end.
It is overridden so that it only appends to the TabPanel.
If the tab label for this position has not been set it is given
the name "tab - #", where # is the zero-relative index of its
position.
- Parameters:
- comp - the component to add
- pos - the zero-relative index at which to add the component or -1
for end (IGNORED)
- Returns:
- the added component
- Overrides:
- add in class BaseTabbedPanel
- See Also:
- remove
add
public synchronized java.awt.Component add(String name,
Component comp)
- Takes no action.
This is a standard Java AWT method which gets called to add a
component to a container.
It is overridden here to do nothing, so the user cannot change the way
this container works.
- Parameters:
- name - the positioning directive for the layout manager (IGNORED)
- comp - the component to add (IGNORED)
- Returns:
- the component parameter
- Overrides:
- add in class BaseTabbedPanel
addPropertyChangeListener
public synchronized void addPropertyChangeListener(PropertyChangeListener listener)
- Adds a listener for all event changes.
- Parameters:
- listener - the listener to add.
- Overrides:
- addPropertyChangeListener in class BaseTabbedPanel
- See Also:
- removePropertyChangeListener
addTabPanel
public int addTabPanel(String sLabel,
boolean bEnabled,
Component panel)
- Appends a new tab and associated panel, which will be shown when the
tab is selected. The tab/panel is added after the last existing
panel.
- Parameters:
- sLabel - the tab label
- bEnabled - enable the tab or not
- panel - the panel to associate with the tab
- Returns:
- the zero-relative index of the newly added tab panel
addTabPanel
public int addTabPanel(String sLabel,
boolean bEnabled,
Component panel,
int pos)
- Adds a new tab and associated panel. The tab/panel is added at the
specified index.
- Parameters:
- sLabel - the tab label
- bEnabled - enable the tab or not
- panel - the panel to associate with the tab
- pos - the zero-relative index of the new tab panel
- Returns:
- the zero-relative index of the newly added tab panel
addVetoableChangeListener
public synchronized void addVetoableChangeListener(VetoableChangeListener listener)
- Adds a vetoable listener for all event changes.
- Parameters:
- listener - the listener to add.
- Overrides:
- addVetoableChangeListener in class BaseTabbedPanel
- See Also:
- removeVetoableChangeListener
countTabs
public int countTabs()
- Gets the number of tab panels in the TabPanel.
- Returns:
- the number of tab panels currently in the TabPanel
enableTabPanel
public synchronized void enableTabPanel(boolean bEnable,
int index) throws PropertyVetoException
- Conditionally enables a tab and its associated panel at the given index.
The currently active tab cannot be disabled.
- Parameters:
- bEnable - true to enable, false to disable
- index - the zero-relative index of the tab
- Throws: PropertyVetoException
- if the specified property value is unacceptable
getCurrentPanelNdx
public int getCurrentPanelNdx()
- Returns the zero-relative index of the currently selected panel.
- Returns:
- the currently selected panel or -1 if none are shown
- See Also:
- setCurrentPanelNdx
getMinimumSize
public java.awt.Dimension getMinimumSize()
- Returns the minimum dimensions to properly display this component.
This is a standard Java AWT method which gets called to determine
the minimum size of this component.
- Overrides:
- getMinimumSize in class BaseTabbedPanel
- See Also:
- getPreferredSize
getPanelLabel
public java.lang.String getPanelLabel(int labelIndex)
- Gets the current tab label associated with the current panels at the given index.
- Parameters:
- int - labelIndex an index in the array of tab labels for the current panels.
- Returns:
- String the label of the panel at the given index. Null if the index is out of range.
- See Also:
- setPanelLabel
getPanelLabels
public java.lang.String[] getPanelLabels()
- Gets the current tab labels associated with the panel positions.
- Returns:
- an array of tab labels for the panel positions
- See Also:
- setPanelLabels
getPanelTabIndex
public synchronized int getPanelTabIndex(Component panel)
- Gets the index for a specific panel.
- Parameters:
- panel - the panel to get the index of
- Returns:
- the zero-relative index of the panel or -1 if it is not found
getPreferredSize
public java.awt.Dimension getPreferredSize()
- Returns the recommended dimensions to properly display this component.
This is a standard Java AWT method which gets called to determine
the recommended size of this component.
The returned size is large enough to display the biggest tab panel
at its preferred size.
- Overrides:
- getPreferredSize in class BaseTabbedPanel
- See Also:
- getMinimumSize
getTabPanel
public synchronized java.awt.Component getTabPanel(int index)
- Gets the panel for the tab at the given index.
- Parameters:
- index - zero-relative index of the tab
- Returns:
- returns the Panel associated with the tab
- See Also:
- setTabPanel
getTabsOnBottom
public boolean getTabsOnBottom()
- Note: getTabsOnBottom() is deprecated.
-
- See Also:
- isTabsOnBottom()
insertTabPanel
public synchronized void insertTabPanel(String sLabel,
boolean bEnabled,
Component panel,
int index)
- Inserts a tab panel based on index.
- Parameters:
- sLabel - Label of the new tab to insert
- bEnabled - If the new tab is enabled or not
- panel - The panel to insert
- index - zero-relative index at which the tab panel will be inserted.
isTabsOnBottom
public boolean isTabsOnBottom()
- Gets whether the tabs are at the bottom of the dialog.
- Returns:
- true if the tabs are at the bottom of the dialog, false if
they are at the top
- See Also:
- setTabsOnBottom
remove
public synchronized void remove(Component comp)
- Removes the specified component from this container.
This is a standard Java AWT method which gets called to remove a
component from a container. When this happens the component's
removeNotify() will also get called to indicate component removal.
- Parameters:
- comp - the component to remove
- Overrides:
- remove in class BaseTabbedPanel
- See Also:
- removeAll, add
removeAllTabPanels
public synchronized void removeAllTabPanels()
- Removes all tabs and their associated panels, clearing the TabPanel entirely.
removePropertyChangeListener
public synchronized void removePropertyChangeListener(PropertyChangeListener listener)
- Removes a listener for all event changes.
- Parameters:
- listener - the listener to remove.
- Overrides:
- removePropertyChangeListener in class BaseTabbedPanel
- See Also:
- addPropertyChangeListener
removeTabPanel
public synchronized void removeTabPanel(int index)
- Removes a tab and its associated panel at the given index.
The currently active tab cannot be removed.
- Parameters:
- index - zero-relative index of the tab
removeVetoableChangeListener
public synchronized void removeVetoableChangeListener(VetoableChangeListener listener)
- Removes a vetoable listener for all event changes.
- Parameters:
- listener - the listener to remove.
- Overrides:
- removeVetoableChangeListener in class BaseTabbedPanel
- See Also:
- addVetoableChangeListener
setCurrentPanelNdx
public void setCurrentPanelNdx(int index) throws PropertyVetoException
- Selects the specified tab and shows its associated panel.
- Parameters:
- index - the zero-relative index of the tab to select
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- getCurrentPanelNdx
setPanelLabel
public void setPanelLabel(String newLabel,
int labelIndex) throws PropertyVetoException
- Sets the tab label associated with the current panels at the given index.
- Parameters:
- String - newLabel the label to use for the tab at the given index.
- int - labelIndex an index in the array of tab labels for the current panels.
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- getPanelLabel
setPanelLabels
public void setPanelLabels(String[] sLabels) throws PropertyVetoException
- Sets the tab labels associated with the panel positions.
Note that the panels do not need to have been added yet for
this method to work.
- Parameters:
- sLabels - an array of tab labels for the panel positions
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- getPanelLabels
setTabPanel
public synchronized void setTabPanel(String sLabel,
boolean bEnabled,
Component panel,
int index) throws PropertyVetoException
- Replaces a tab and its associated panel at the index specified.
If it is desired to only change the label, use the base class
BaseTabbedPanel's method setTab(String sLabel, boolean bEnabled, int index).
- Parameters:
- sLabel - the new tab label
- bEnabled - enable the tab or not
- panel - the new panel
- index - the zero-relative index of the tab to change
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- setTab, getTabPanel
setTabsOnBottom
public void setTabsOnBottom(boolean bTabsOnBottom) throws PropertyVetoException
- Puts the tabs on the top or bottom of the dialog.
- Parameters:
- bTabsOnBottom - if true the tabs are placed at the bottom of the
dialog, if false on top
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- getTabsOnBottom
showTabPanel
public synchronized void showTabPanel(int index)
- Selects the tab at the given index, showing it and its associated panel.
The panel is activated, ready for user input.
The tab position must be enabled.
- Parameters:
- index - zero-relative index of the tab to select
- See Also:
- enableTabPanel
updatePanelLabels
public void updatePanelLabels()
- This routine re-sets all the tab labels using the latest string array
provided in setPanelLabels().
It is not typically called directly.
- See Also:
- setPanelLabels
All Packages Class Hierarchy This Package Previous Next Index