Packages
 In this topic

*Constructors

*Methods

 

Packages   PreviousThis PackageNext
Package com.ms.ui   Previous This
Package
Next

 


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

Constructors

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.

Methods

add

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.

ParameterDescription
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.

add

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.

ParameterDescription
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.

addTab

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.

ParameterDescription
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.

getBase

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.

setSelectedIndex

public void setSelectedIndex(int index);

Selects the tab at the specified index.

Return Value:

No return value.

ParameterDescription
index The zero-based index of the tab to be selected.

Remarks:

When the specified tab is selected, its associated page is shown.

upnrm.gif © 1998 Microsoft Corporation. All rights reserved. Terms of use.