All Packages Class Hierarchy This Package Previous Next Index
Class symantec.itools.awt.TabPanel
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----java.awt.Panel
|
+----symantec.itools.awt.BaseTabbedPanel
|
+----symantec.itools.awt.TabPanel
- public class TabPanel
- extends BaseTabbedPanel
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.
-
TabPanel()
- Constructs a TabPanel with tabs on top, rounded
-
TabPanel(boolean)
- Obsolete.
-
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.
-
addTabPanel(String, boolean, Component)
- Appends a new tab and associated panel, which will be shown when the
tab is selected.
-
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.
-
getPanelLabels()
- Gets the current tab labels associated with the panel positions.
-
getPanelTabIndex(Component)
- Gets the index for a specific panel.
-
getTabPanel(int)
- Gets the panel for the tab at the given index.
-
getTabsOnBottom()
- Gets whether the tabs are at the bottom of the dialog.
-
handleEvent(Event)
- Processes events for this component.
-
minimumSize()
- Returns the minimum dimensions to properly display this component.
-
preferredSize()
- Returns the recommended dimensions to properly display this component.
-
remove(Component)
- Removes the specified component from this container.
-
removeAllTabPanels()
- Removes all tabs and their associated panels, clearing the TabPanel entirely.
-
removeTabPanel(int)
- Removes a tab and its associated panel at the given index.
-
setCurrentPanelNdx(int)
- Selects the specified tab and shows its associated panel.
-
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
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
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
setCurrentPanelNdx
public void setCurrentPanelNdx(int index)
- Selects the specified tab and shows its associated panel.
- Parameters:
- index - the zero-relative index of the tab to select
- See Also:
- getCurrentPanelNdx
add
public 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 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 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:
- comp - the component to add (IGNORED)
- Returns:
- the component parameter
- Overrides:
- add in class BaseTabbedPanel
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
setPanelLabels
public void setPanelLabels(String sLabels[])
- 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
- See Also:
- getPanelLabels
getPanelLabels
public 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
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
setTabsOnBottom
public void setTabsOnBottom(boolean bTabsOnBottom)
- 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
- See Also:
- getTabsOnBottom
getTabsOnBottom
public boolean getTabsOnBottom()
- 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
setTabPanel
public synchronized void setTabPanel(String sLabel,
boolean bEnabled,
Component panel,
int index)
- 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
- See Also:
- setTab, getTabPanel
getTabPanel
public synchronized Component getTabPanel(int index)
- Gets the panel for the tab at the given index.
- Parameters:
- index - zero-relative index of the tab to show
- Returns:
- returns the Panel associated with the tab
- See Also:
- setTabPanel
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
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
enableTabPanel
public synchronized void enableTabPanel(boolean bEnable,
int index)
- 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
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
removeAllTabPanels
public synchronized void removeAllTabPanels()
- Removes all tabs and their associated panels, clearing the TabPanel entirely.
countTabs
public int countTabs()
- Gets the number of tab panels in the TabPanel.
- Returns:
- the number of tab panels currently in the TabPanel
handleEvent
public boolean handleEvent(Event evt)
- Processes events for this component.
This is a standard Java AWT method which gets called by the AWT
to handle this component's events. The default handler for
components dispatches to one of the following methods as needed:
action(), gotFocus(), lostFocus(), keyDown(), keyUp(), mouseEnter(),
mouseExit(), mouseMove(), mouseDrag(), mouseDown(), or mouseUp().
- Parameters:
- evt - the event to handle
- Returns:
- true if the event was handled and no further action is needed,
false to pass the event to this component's parent
- Overrides:
- handleEvent in class BaseTabbedPanel
- See Also:
- action, gotFocus, lostFocus, keyDown, keyUp, mouseEnter, mouseExit, mouseMove, mouseDrag, mouseDown, mouseUp
preferredSize
public Dimension preferredSize()
- 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:
- preferredSize in class BaseTabbedPanel
- See Also:
- minimumSize
minimumSize
public Dimension minimumSize()
- 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.
The returned size is large enough to display the biggest tab panel
at its minimum size.
- Overrides:
- minimumSize in class BaseTabbedPanel
- See Also:
- preferredSize
All Packages Class Hierarchy This Package Previous Next Index