Packages
 In this topic

*Constructors

*Methods

 

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

 


Class UITabList

public class UITabList extends UISelector
{
  // Constructors
  public UITabList();

  // Methods
  public IUIComponent add(String s);
  public IUIComponent add(String s, int pos);
  public IUIComponent add(IUIComponent comp);
  public IUIComponent add(IUIComponent comp, int pos);
  public IUIComponent getFloater();
  public int getRoleCode();
  public void layout();
  public void paint(FxGraphics g);
  public IUIComponent passFocus(int dir);
  public void setSelectedItem(IUIComponent comp, boolean notify);
}

This class manages a collection of tabs. Each tab in the collection is a UITab object. UITabList uses UITabListLayout for its layout manager, and allows only one tab in the collection to be selected at a time.

Note UITabList only manages a set of tabs, not any associated pages. Typically, you'll use UITabViewer rather than using UITabList directly. UITabViewer uses UITabList internally to manage a collection of tabs and their associated pages.

A UITabList object is empty when it is first created. The add method allows you to insert tabs into the tab list control. This is shown in the following example.

// Construct a tab list control.
UITabList tl = new UITabList();

// Add two tabs to tl.
tl.add("tab 1");
tl.add("tab 2");

// Now add tl to the container.
add(tl);

Note When you call add with a String, the tab is automatically hot-tracked. To override this default, call add with a UIText object, as shown in the following example.

// Add a tab that displays a String. 
// By default, the tab is hot-tracked.
tl.add("hot");

// Add a tab that is not hot-tracked, using UIText. 
tl.add(new UIText("not hot"));

// To create a hot-tracked tab using UIText,
// specify the UIStatic.HOTTRACK style. 
tl.add(new UIText("hot UIText", UIStatic.HOTTRACK));

For more information about hot-tracking, see the UIText overview.

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.

UIComponent
  |
  +--UIContainer
    |
    +--UIStateContainer
      |
      +--UIPanel
        |
        +--UISelector
          |
          +--UITabList

Constructors

UITabList

public UITabList();

Creates an empty tab list control.

Remarks:

Call the add method to add tabs to the list.

Methods

add

public IUIComponent add(String s);

Adds a tab containing the specified text to the end of the tab list control.

Return Value:

Returns the tab component that was added.

ParameterDescription
s The text to be displayed on the tab.

Remarks:

By default, the tab is hot-tracked. To add a tab that is not hot-tracked, pass a UIText object instead of a String. For more information about hot-tracking, see the UITabList overview.

To remove a tab from the tab list control, call the remove method (inherited through UISelector).

add

public IUIComponent add(String s, int pos);

Adds a tab containing the specified text to the tab list control. The tab is added at the specified position.

Return Value:

Returns the tab component that was added.

ParameterDescription
s The text to be displayed on the tab.
pos The zero-based index at which to add the tab. To add the tab at the end of the control, pass -1.

Remarks:

By default, the tab is hot-tracked. To add a tab that is not hot-tracked, pass a UIText object instead of a String. For more information about hot-tracking, see the UITabList overview.

To remove a tab from the tab list control, call the remove method (inherited through UISelector).

add

public IUIComponent add(IUIComponent comp);

Adds a tab containing the specified component to the end of the tab list control.

Return Value:

Returns the tab component that was added.

ParameterDescription
comp The component to be displayed on the tab. If comp is already a UITab object, this tab is added. Otherwise, a new UITab object that displays comp is added.

Remarks:

Typically, you'll pass a UIText, UIGraphic, or UIItem object for the component. To remove a tab from the tab list control, call the remove method (inherited through UISelector).

add

public IUIComponent add(IUIComponent comp, int pos);

Adds a tab containing the specified component to the tab list control. The tab is added at the specified position.

Return Value:

Returns the tab component that was added.

ParameterDescription
comp The component to be displayed on the tab. If comp is already a UITab object, this tab is added. Otherwise, a new UITab object that displays comp is added.
pos The zero-based index at which to add the tab. To add the tab at the end of the control, pass -1.

Remarks:

Typically, you'll pass a UIText, UIGraphic, or UIItem object for the component. To remove a tab from the tab list control, call the remove method (inherited through UISelector).

getFloater

public IUIComponent getFloater();

This method simply returns the floating component in this container, if there is one. The floating component is the component which is superceding the standard z-order of the container's children by being first in the z-order. This is most commonly used when a component is being dragged, such as a column header or a scroll thumb.

Return Value:

Returns the current floating component; returns null if there is none.

getRoleCode

public int getRoleCode();

Returns the Microsoft® Active Accessibility™ role code for the tab list object.

Return Value:

Returns the ROLE_SYSTEM_PAGETABLIST role code.

layout

public void layout();

Lays out the components in the associated root container.

Return Value:

No return value.

paint

public void paint(FxGraphics g);

Draws the tab list control.

Return Value:

No return value.

ParameterDescription
g The graphics context.

passFocus

public IUIComponent passFocus(int dir);

Retrieves the component that should receive input focus when navigating to the container in the specified direction.

Return Value:

Returns the component, or the container itself, that should receive input focus.

ParameterDescription
dir The navigation direction. Specify one of the NAVDIR values defined in the IUIAccessible interface.

Remarks:

This method implements passFocus in the IUIContainer interface.

setSelectedItem

public void setSelectedItem(IUIComponent comp, boolean notify);

Sets the control's currently selected item.

Return Value:

No return value.

ParameterDescription
comp The component to be selected.
notify If true, a list select event will be generated; otherwise, a list select event will not be generated.

Overrides:

setSelectedItem(IUIComponent,boolean) in UISelector.

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