Class AwtUITabViewer
public class AwtUITabViewer extends AwtUIControl
{
// Constructors
public AwtUITabViewer();
// Methods
public IUIComponent add(String name, IUIComponent comp);
public Component add(String name, Component comp);
public IUIComponent addTab(IUIComponent tab,
IUIComponent content);
public IUIComponent getBase();
public void setSelectedIndex(int index);
}
This class implements the functionality of a UITabViewer object in an AWT-based control. An AwtUITabViewer control is an AwtUIHost component whose associated root container holds a UITabViewer object. By hosting this object, an AwtUITabViewer control integrates AFC with AWT. Although an AwtUITabViewer control is fully compatible with AWT, a UITabViewer control is optimized for performance and size.
Note The hot-track color is the same color as the button text color. As a result, hot-tracking does not appear to be functional.
Panel
|
+--AwtUIHost
|
+--AwtUIControl
|
+--AwtUITabViewer
public AwtUITabViewer();
Creates an empty AWT-based tab viewer control.
Remarks:
Call add or addTab to insert a tab and its associated page into the control.
public IUIComponent add(String name, IUIComponent comp);
Adds a tab and its associated page to the control. The tab displays the specified text and the page displays the specified component.
Return Value:
Returns the page component that was added, if successful; otherwise, returns null.
Parameter | Description |
name
| The text to be displayed on the tab.
|
comp
| The component to be displayed on the page that is associated with the tab.
|
Remarks:
If the name parameter identifies a tab that already exists in the tab viewer, this tab's page is updated with comp. Otherwise, a new tab and page are added. A tab's page is displayed only when the tab is selected.
By default, the tab is hot-tracked. To add a tab that is not hot-tracked, call the addTab method and pass a UIText object. For more information about hot-tracking, see the UITabViewer overview.
Overrides:
add(String,IUIComponent) in AwtUIControl.
public Component add(String name, Component comp);
Adds a tab and its associated page to the control. The tab displays the specified text, and the page displays the specified AwtUI component. Pure AWT components cannot be used.
Return Value:
Returns the control itself.
Parameter | Description |
name
| The text to be displayed on the tab.
|
comp
| The AwtUI component to be displayed on the page that is associated with the tab.
|
Remarks:
If the name parameter identifies a tab that already exists in the tab viewer, this tab's page is updated with comp. Otherwise, a new tab and page are added. A tab's page is displayed only when the tab is selected.
By default, the tab is hot-tracked. To add a tab that is not hot-tracked, call the addTab method and pass a UIText object. For more information about hot-tracking, see the UITabViewer overview.
Overrides:
add(String,Component) in AwtUIControl.
Exceptions:
IllegalArgumentException
if a pure AWT component was specified.
public IUIComponent addTab(IUIComponent tab, IUIComponent content);
Adds a tab and its associated page to the control. The tab and page display the specified components.
Return Value:
Returns the page component that was added, if successful; otherwise, returns null.
Parameter | Description |
tab
| The component to be displayed on the tab. If comp is a UITab object, this tab is added. Otherwise, a new UITab object that displays comp is added.
|
content
| The component to be displayed on the page that is associated with the tab.
|
Remarks:
If the name parameter identifies a tab that already exists in the tab viewer, this tab's page is updated with content. Otherwise, a new tab and page are added. A tab's page is displayed only when the tab is selected.
Typically, you'll pass a UIText, UIGraphic, or UIItem object for the component. For examples of how to add tabs, see the UITabViewer overview.
public IUIComponent getBase();
Retrieves the UI component that the control is based on.
Return Value:
Returns the UITabViewer object associated with the control.
Remarks:
When the AWT-based control is first created, it is associated with a UITabViewer object.
public void setSelectedIndex(int index);
Selects the tab at the specified index.
Return Value:
No return value.
Parameter | Description |
index
| The zero-based index of the tab to be selected.
|
Remarks:
When the specified tab is selected, its associated page is shown.