Packages
 In this topic

*Constructors

*Methods

 

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

 


Class AwtUITree

public class AwtUITree extends AwtUIControl implements 
            IAwtUIItemSelectable
{
  // Constructors
  public AwtUITree();
  public AwtUITree(String s);
  public AwtUITree(Image i, String s);
  public AwtUITree(IUIComponent comp);
  public AwtUITree(IUIComponent comp, int indent);

  // Methods
  public Component add(Component comp);
  public Component add(Component comp, int pos);
  public IUIComponent add(String s);
  public IUIComponent add(String s, int pos);
  public IUIComponent add(Image i, String s);
  public IUIComponent add(Image i, String s, int pos);
  public IUIComponent add(IUIComponent comp);
  public IUIComponent add(IUIComponent comp, int pos);
  public void addActionListener(ActionListener l);
  public void addItemListener(ItemListener l);
  public void addSelectedIndex(int index);
  public void addSelectedIndex(int index, boolean notify);
  public void addSelectedIndices(int indices[]);
  public void addSelectedIndices(int indices[], boolean notify);
  public void addSelectedItem(IUIComponent comp);
  public void addSelectedItem(IUIComponent comp, boolean notify);
  public void addSelectedItem(IUIComponent comp, boolean on);
  public void addSelectedItems(IUIComponent comps[]);
  public void addSelectedItems(IUIComponent comps[],
        boolean notify);
  public IUIComponent find(String prefix, boolean fromFocus);
  public IUIComponent find(String prefix, IUIComponent compStart);
  public IUIComponent find(String prefix);
  public IUIComponent getBase();
  public IUIComponent getExpander();
  public int getSelectedIndex();
  public int[] getSelectedIndices();
  public IUIComponent getSelectedItem();
  public IUIComponent[] getSelectedItems();
  public int getSelectionMode();
  public boolean hasChildren();
  public boolean isExpanded();
  protected void processActionEvent(ActionEvent e);
  protected void processHostEvent(AWTEvent e);
  protected void processItemEvent(ItemEvent e);
  public void remove(int index);
  public void remove(IUIComponent comp);
  public synchronized void removeActionListener(ActionListener l);
  public synchronized void removeItemListener(ItemListener l);
  public void removeSelectedIndex(int index);
  public void removeSelectedIndex(int index, boolean notify);
  public void removeSelectedIndices(int indices[]);
  public void removeSelectedIndices(int indices[]);
  public void removeSelectedIndices(int indices[], boolean notify);
  public void removeSelectedItem(IUIComponent comp);
  public void removeSelectedItem(IUIComponent comp, boolean notify);
  public void removeSelectedItems(IUIComponent comps[]);
  public void removeSelectedItems(IUIComponent comps[],
        boolean notify);
  public void setExpanded(boolean expanded);
  public void setSelectedIndex(int index);
  public void setSelectedIndex(int index, boolean notify);
  public void setSelectedIndices(int indices[]);
  public void setSelectedIndices(int indices[], boolean notify);
  public void setSelectedItem(IUIComponent comp);
  public void setSelectedItem(IUIComponent comp, boolean notify);
  public void setSelectedItems(IUIComponent comps[]);
  public void setSelectedItems(IUIComponent comps[],
        boolean notify);
  public void setSelectionMode(int selMode);
}

This class implements the functionality of a UITree object in an AWT-based control. An AwtUITree control is an AwtUIHost component whose associated root container holds a UITree object. By hosting this object, an AwtUITree control integrates AFC with AWT. Although an AwtUITree control is fully compatible with AWT, a UITree 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
      |
      +--AwtUITree

Constructors

AwtUITree

public AwtUITree();

Creates an AWT-based tree control with no content.

Remarks:

Call the add method to add child items to the tree control. To add an item to the root node itself, call setHeader (inherited through AwtUIHost). For an example of calling setHeader, see the UITree overview.

AwtUITree

public AwtUITree(String s);

Creates an AWT-based tree control with the specified text.

ParameterDescription
s The text to be displayed by the node.

Remarks:

By default, the tree node is hot-tracked. To create a node that is not hot-tracked, pass a UIText object instead of a String. For more information about hot-tracking, see the UITree overview.

To add child items to the tree control, call the add method.

AwtUITree

public AwtUITree(Image i, String s);

Creates an AWT-based tree control with the specified image and text.

ParameterDescription
i The image to be displayed by the node.
s The text to be displayed by the node.

Remarks:

By default, the tree node is hot-tracked. To create a node that is not hot-tracked, pass a UIItem object instead of an Image and String. For more information about hot-tracking, see the UITree overview.

To add child items to the tree control, call the add method.

AwtUITree

public AwtUITree(IUIComponent comp);

Creates an AWT-based tree control with the specified component.

ParameterDescription
comp The component to be displayed by the node.

Remarks:

Typically, you'll pass a UIText, UIGraphic, or UIItem object for the component. To add child items to the tree control, call the add method.

AwtUITree

public AwtUITree(IUIComponent comp, int indent);

Creates an AWT-based tree control with the specified component and indent.

ParameterDescription
comp The component to be displayed by the node.
indent The indent (in pixels) to be used when laying out node children.

Remarks:

Typically, you'll pass a UIText, UIGraphic, or UIItem object for the component. To add child items to the tree control, call the add method.

Methods

add

public Component add(Component comp);

Adds the specified component to the end of the control. The Component must be an instance of the AwtUIHost class.

Return Value:

Returns the component that was added.

ParameterDescription
comp The component to be added.

Remarks:

Typically, you'll pass a UIText, UIGraphic, or UIItem object for the component. The newly-added child component is shown or hidden, according to the control's expanded state.

See Also: remove

add

public Component add(Component comp, int pos);

Adds the specified component to the tree control at the specified position. The Component must be an instance of the AwtUIHost class.

Return Value:

Returns the component that was added.

ParameterDescription
comp The component to be added.
pos The zero-based index at which to add the item. If the node itself displays a content component (a header), this item is at index 0 and the first child begins at index 1. To add a child item at the end of the tree control, pass -1.

Remarks:

Typically, you'll pass a UIText, UIGraphic, or UIItem object for the component. The newly-added child component is shown or hidden, according to the control's expanded state.

See Also: remove

add

public IUIComponent add(String s);

Adds the specified text to the end of the control.

Return Value:

Returns the text component that was added.

ParameterDescription
s The text to be added.

Remarks:

The newly-added child component is shown or hidden, according to the tree control's expanded state. By default, the item is hot-tracked. To add an item that is not hot-tracked, pass a UIText object instead of a String. For more information about hot-tracking, see the UITree overview.

See Also: remove

add

public IUIComponent add(String s, int pos);

Adds the specified text to the control at the specified position.

Return Value:

Returns the text component that was added.

ParameterDescription
s The text to be added.
pos The zero-based index at which to add the text. If the root node itself displays an item (a header component), this item is at index 0, and the first child begins at index 1. To add a child item at the end of the tree control, pass -1.

Remarks:

The newly-added child component is shown or hidden, according to the tree control's expanded state. By default, the item is hot-tracked. To add an item that is not hot-tracked, pass a UIText object instead of a String. For more information about hot-tracking, see the UITree overview.

Note If the tree node has a header, adding an item at index 0 will insert the item as the new header and shift all other components by one index position. As a result, the previous header becomes the first child item. To simply replace the header without shifting its position, call the setHeader method (inherited through AwtUIHost). For an example of calling setHeader, see the UITree overview.

See Also: remove

add

public IUIComponent add(Image i, String s);

Adds the specified image and text to the end of the control.

Return Value:

Returns the item component that was added.

ParameterDescription
i The image to be added.
s The text to be added.

Remarks:

The newly added child component is shown or hidden, according to the tree control's expanded state. By default, the item is hot-tracked. To add an item that is not hot-tracked, pass a UIItem object instead of an Image and String.

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

See Also: remove

add

public IUIComponent add(Image i, String s, int pos);

Adds the specified image and text to the control at the specified position.

Return Value:

Returns the item component that was added.

ParameterDescription
i The image to be added.
s The text to be added.
pos The zero-based index at which to add the text and image. If the root node itself displays an item (a header component), this item is at index 0, and the first child begins at index 1. To add a child item at the end of the tree control, pass -1.

Remarks:

The newly added child component is shown or hidden, according to the tree control's expanded state. By default, the item is hot-tracked. To add an item that is not hot-tracked, pass a UIItem object instead of an Image and String. For more information about hot-tracking, see the UITree overview.

Note If the tree node has a header, adding an item at index 0 will insert the item as the new header and shift all other components by one index position. As a result, the previous header becomes the first child item. To simply replace the header without shifting its position, call the setHeader method (inherited through AwtUIHost). For an example of calling setHeader, see the UITree overview.

See Also: remove

add

public IUIComponent add(IUIComponent comp);

Adds the specified component to the end of the control.

Return Value:

Returns the component that was added.

ParameterDescription
comp The component to be added.

Remarks:

Typically, you'll pass a UIText, UIGraphic, or UIItem object for the component. The newly added child component is shown or hidden, according to the control's expanded state.

Overrides:

add(IUIComponent) in AwtUIControl.

See Also: remove

add

public IUIComponent add(IUIComponent comp, int pos);

Adds the specified component to the tree control at the specified position.

Return Value:

Returns the component that was added.

ParameterDescription
comp The component to be added.
pos The zero-based index at which to add the component. If the root node itself displays an item (a header component), this item is at index 0, and the first child begins at index 1. To add a child item at the end of the tree control, pass -1.

Remarks:

Typically, you'll pass a UIText, UIGraphic, or UIItem object for the component. The newly added child component is shown or hidden, according to the tree control's expanded state.

Note If the tree node has a header, adding an item at index 0 will insert the item as the new header and shift all other components by one index position. As a result, the previous header becomes the first child item. To simply replace the header without shifting its position, call the setHeader method (inherited through AwtUIHost). For an example of calling setHeader, see the UITree overview.

Overrides:

add(IUIComponent,int) in AwtUIControl.

See Also: remove

addActionListener

public void addActionListener(ActionListener l);

Adds the specified action listener. The listener receives all action events generated for the control.

Return Value:

No return value.

ParameterDescription
l The action listener to be added.

See Also: removeActionListener

addItemListener

public void addItemListener(ItemListener l);

Adds the specified item listener. The listener receives all item events generated for the control.

Return Value:

No return value.

ParameterDescription
l The item listener to be added.

See Also: removeItemListener

addSelectedIndex

public void addSelectedIndex(int index);

Selects the component at the specified index, without affecting other selections. By default, list select events are not generated.

Return Value:

No return value.

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

addSelectedIndex

public void addSelectedIndex(int index, boolean notify);

Selects the component at the specified index, without affecting other selections. Optionally generates list select events.

Return Value:

No return value.

ParameterDescription
index The zero-based index of the item to be selected.
notify If true, list select events will be generated; otherwise, list select events will not be generated.

addSelectedIndices

public void addSelectedIndices(int indices[]);

Selects the components at the specified indices, without affecting other selections. By default, list select events are not generated.

Return Value:

No return value.

ParameterDescription
indices An array containing the indices of the items to be selected.

addSelectedIndices

public void addSelectedIndices(int indices[], boolean notify);

Selects the components at the specified indices, without affecting other selections. Optionally generates list select events.

Return Value:

No return value.

ParameterDescription
indices An array containing the indices of the items to be selected.
notify If true, list select events will be generated; otherwise, list select events will not be generated.

addSelectedItem

public void addSelectedItem(IUIComponent comp);

Selects the specified component, without affecting other selections. By default, list select events are not generated.

Return Value:

No return value.

ParameterDescription
comp The component to be selected.

addSelectedItem

public void addSelectedItem(IUIComponent comp, boolean notify);

Selects the specified component, without affecting other selections. Optionally generates list select events.

Return Value:

No return value.

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

addSelectedItem

public void addSelectedItem(IUIComponent comp, boolean on);

Sets or clears the selected state of the specified component and sets the control's selection to this component. A list select event is not generated.

Return Value:

No return value.

ParameterDescription
comp The item to be selected or de-selected.
on If true, the item's selected state is set; otherwise, it is cleared.

Remarks:

This method clears any previous selection.

See Also: addSelectedIndex, setSelectedItem, getSelectedItem

addSelectedItems

public void addSelectedItems(IUIComponent comps[]);

Selects the specified components, without affecting other selections. By default, list select events are not generated.

Return Value:

No return value.

ParameterDescription
comps An array containing the components to be selected.

addSelectedItems

public void addSelectedItems(IUIComponent comps[], boolean notify);

Selects the specified components, without affecting other selections. Optionally generates list select events.

Return Value:

No return value.

ParameterDescription
comps An array containing the component to be selected.
notify If true, list select events will be generated; otherwise, list select events will not be generated. Currently not used.

find

public IUIComponent find(String prefix, boolean fromFocus);

Searches the control for an item whose name begins with the specified prefix. The search begins from either the current focus, or the first item in the selector.

Return Value:

Returns the first matching component, if a match is found; otherwise, returns null.

ParameterDescription
prefix The prefix string to search for.
fromFocus If true, the search begins from the current focus. Otherwise, the search begins with the first item in the selector.

find

public IUIComponent find(String prefix, IUIComponent compStart);

Searches the control for an item whose name begins with the specified prefix. The search begins at compStart.

Return Value:

Returns the first matching component, if a match is found; otherwise, returns null.

ParameterDescription
prefix The prefix string to search for.
compStart The component at which the search begins. If it is null, the search will begin at the 1st item (according to navigate).

find

public IUIComponent find(String prefix);

Searches the control for an item whose name begins with the specified prefix. The search starts at the first item in the control.

Return Value:

Returns the first matching component; otherwise, returns null if a component is not found.

ParameterDescription
prefix The prefix string to search for.

getBase

public IUIComponent getBase();

Retrieves the UI component that the control is based on.

Return Value:

Returns the UITree object associated with the control.

Remarks:

When the AWT-based control is first created, it is associated with a UITree object.

getExpander

public IUIComponent getExpander();

Retrieves the tree control's Expand button, which indicates whether the node is expanded or collapsed.

Return Value:

Returns the component currently being used as the expand button.

Remarks:

By default, the control's associated UITree object uses a UIExpandButton component for the expand button.

getSelectedIndex

public int getSelectedIndex();

Retrieves the zero-based index of the currently selected item.

Return Value:

Returns the index of the selected item or -1 if an item is not selected. If the root node of the tree displays an item, this item is at index 0, and the first child item is at index 1. Otherwise, the first child begins at index 0.

See Also: getSelectedItem, setSelectedIndex

getSelectedIndices

public int[] getSelectedIndices();

Retrieves the zero-based indices of all currently selected items.

Return Value:

Returns an array of the indices of the selected items or null if an item is not selected. If the root node of the tree displays an item, this item is at index 0, and the first child item is at index 1. Otherwise, the first child begins at index 0.

Remarks:

Because the control's selection mode can only be SINGLESELECT, this method returns only one item in the array.

See Also: getSelectedIndex, getSelectedItems, setSelectedIndices

getSelectedItem

public IUIComponent getSelectedItem();

Retrieves the currently selected item.

Return Value:

Returns the selected component; otherwise, returns null if a component is not selected.

See Also: getSelectedIndex, setSelectedItem

getSelectedItems

public IUIComponent[] getSelectedItems();

Retrieves all currently selected items.

Return Value:

Returns an array of the selected components; otherwise, returns null if a component is not selected.

Remarks:

Because the control's selection mode can only be SINGLESELECT, this method returns one item in the array.

See Also: getSelectedIndices, setSelectedItems

getSelectionMode

public int getSelectionMode();

Retrieves the selection mode of the control.

Return Value:

Returns the control's selection mode. For a list of valid return modes, see the setSelectionMode method.

hasChildren

public boolean hasChildren();

Determines whether the tree control has child items.

Return Value:

Returns true if the node has child items; otherwise, returns false.

isExpanded

public boolean isExpanded();

Determines whether the tree control is expanded.

Return Value:

Returns true if the node is expanded; otherwise, returns false.

See Also: setExpanded

processActionEvent

protected void processActionEvent(ActionEvent e);

Processes action events.

Return Value:

No return value.

ParameterDescription
e The action event.

Remarks:

This method is called by processHostEvent and dispatches the event to a registered action listener. When overriding this method, call the super method processActionEvent to ensure the default event processing continues normally.

See Also: addActionListener

processHostEvent

protected void processHostEvent(AWTEvent e);

Processes the specified event.

Return Value:

No return value.

ParameterDescription
e The event.

Remarks:

This method is automatically invoked if a listener has has been registered through a call to addXXXListener. Depending on the type of event, processHostEvent calls one of the following methods.

Event type Method called
item event processItemEvent
action event processActionEvent
component event processComponentEvent (inherited through AwtUIHost)
container event processContainerEvent (inherited through AwtUIHost)
focus event processFocusEvent (inherited through AwtUIHost)
key event processKeyEvent (inherited through AwtUIHost)
mouse event processMouseEvent (inherited through AwtUIHost)
mouse motion event processMouseMotionEvent (inherited through AwtUIHost)

When overriding processHostEvent, call the super method processHostEvent to ensure the default event processing continues normally.

processItemEvent

protected void processItemEvent(ItemEvent e);

Processes item events.

Return Value:

No return value.

ParameterDescription
e The item event.

Remarks:

This method is called by processHostEvent and dispatches the event to a registered item listener. When overriding this method, call the super method processItemEvent to ensure the default event processing continues normally.

See Also: addItemListener

remove

public void remove(int index);

Removes the component at the specified index.

Return Value:

No return value.

ParameterDescription
index The zero-based index of the component to be removed. If the root node of the tree displays an item, this item is at index 0, and the first child item is at index 1. Otherwise, the first child begins at index 0.

Remarks:

For an example of calling remove, see UISelector.remove.

remove

public void remove(IUIComponent comp);

Removes the specified component from the control.

Return Value:

No return value.

ParameterDescription
comp The component to be removed.

Remarks:

For an example of calling remove, see UISelector.remove.

Overrides:

remove(IUIComponent) in AwtUIControl.

removeActionListener

public synchronized void removeActionListener(ActionListener l);

Removes the specified action listener. The listener no longer receives the control's action events.

Return Value:

No return value.

ParameterDescription
l The action listener to be removed.

See Also: addActionListener

removeItemListener

public synchronized void removeItemListener(ItemListener l);

Removes the specified item listener. The listener no longer receives the control's item events.

Return Value:

No return value.

ParameterDescription
l The item listener to be removed.

See Also: addItemListener

removeSelectedIndex

public void removeSelectedIndex(int index);

Deselects the component at the specified index, without affecting other selections. By default, list deselect events are not generated.

Return Value:

No return value.

ParameterDescription
index The zero-based index of the item to be deselected.

removeSelectedIndex

public void removeSelectedIndex(int index, boolean notify);

Deselects the component at the specified index, without affecting other selections. Optionally generates list select events.

Return Value:

No return value.

ParameterDescription
index The zero-based index of the item to be deselected.
notify If true, list deselect events will be generated; otherwise, list deselect events will not be generated.

removeSelectedIndices

public void removeSelectedIndices(int indices[]);

Deselects the components at the specified indices, without affecting other selections. By default, list deselect events are not generated.

Return Value:

No return value.

ParameterDescription
indices An array containing the indices of the items to be deselected.

removeSelectedIndices

public void removeSelectedIndices(int indices[]);

Deselects the components at the specified indices, without affecting other selections. By default, list deselect events are not generated.

Return Value:

No return value.

ParameterDescription
indices An array containing the indices of the items to be deselected.

removeSelectedIndices

public void removeSelectedIndices(int indices[], boolean notify);

Deselects the components at the specified indices, without affecting other selections. Optionally generates list deselect events.

Return Value:

No return value.

ParameterDescription
indices An array containing the indices of the items to be deselected.
notify If true, list deselect events will be generated; otherwise, list deselect events will not be generated.

removeSelectedItem

public void removeSelectedItem(IUIComponent comp);

Deselects the specified component, without affecting other selections. By default, list deselect events are not generated.

Return Value:

No return value.

ParameterDescription
comp The component to be deselected.

removeSelectedItem

public void removeSelectedItem(IUIComponent comp, boolean notify);

Deselects the specified component, without affecting other selections. Optionally generates list deselect events.

Return Value:

No return value.

ParameterDescription
comp The component to be deselected.
notify If true, list deselect events will be generated; otherwise, list deselect events will not be generated.

removeSelectedItems

public void removeSelectedItems(IUIComponent comps[]);

Deselects the specified components, without affecting other selections. By default, list deselect events are not generated.

Return Value:

No return value.

ParameterDescription
comps An array containing the components to be deselected.

removeSelectedItems

public void removeSelectedItems(IUIComponent comps[], boolean notify);

Deselects the specified components, without affecting other selections. Optionally generates list deselect events.

Return Value:

No return value.

ParameterDescription
comps An array containing the component to be deselected.
notify If true, list deselect events will be generated; otherwise, list deselect events will not be generated.

setExpanded

public void setExpanded(boolean expanded);

Expands or collapses the tree control to show or hide the node's children.

Return Value:

No return value.

ParameterDescription
expanded If true, the node will be expanded; otherwise, the node will be collapsed.

See Also: isExpanded

setSelectedIndex

public void setSelectedIndex(int index);

Sets the selection to the component at the specified index. By default, a list select event is not generated.

Return Value:

No return value.

ParameterDescription
index The zero-based index of the item to be selected. If the root node of the tree displays an item, this item is at index 0, and the first child item is at index 1. Otherwise, the first child begins at index 0.

Remarks:

This method clears any previous selection.

See Also: setSelectedItem, addSelectedIndex, getSelectedIndex

setSelectedIndex

public void setSelectedIndex(int index, boolean notify);

Sets the selection to the component at the specified index and optionally generates a list select event.

Return Value:

No return value.

ParameterDescription
index The zero-based index of the item to be selected. If the root node of the tree displays an item, this item is at index 0, and the first child item is at index 1. Otherwise, the first child begins at index 0.
notify If true, a list select event will be generated; otherwise, a list select event will not be generated.

Remarks:

This method clears any previous selection.

See Also: setSelectedItem, addSelectedIndex, getSelectedIndex

setSelectedIndices

public void setSelectedIndices(int indices[]);

Sets the selection to the components at the specified indices. List select events are not generated.

Return Value:

No return value.

ParameterDescription
indices An array containing the zero-based indices of the items to be selected. If the root node of the tree displays an item, this item is at index 0, and the first child item is at index 1. Otherwise, the first child begins at index 0. Because the control's selection mode can only be SINGLESELECT, the array should contain only one index.

Remarks:

This method clears any previous selection.

See Also: setSelectedIndex, setSelectedItems, getSelectedIndices

setSelectedIndices

public void setSelectedIndices(int indices[], boolean notify);

Sets the selection to the components at the specified indices and optionally generates list select events.

Return Value:

No return value.

ParameterDescription
indices An array containing the zero-based indices of the items to be selected. If the root node of the tree displays an item, this item is at index 0, and the first child item is at index 1. Otherwise, the first child begins at index 0. Because the control's selection mode can only be SINGLESELECT, the array should contain only one index.
notify If true, list select events will be generated; otherwise, list select events will not be generated.

Remarks:

This method clears any previous selection.

See Also: setSelectedIndex, setSelectedItems, getSelectedIndices

setSelectedItem

public void setSelectedItem(IUIComponent comp);

Sets the selection to the specified component. A list select event is not generated.

Return Value:

No return value.

ParameterDescription
comp The item to be selected.

Remarks:

This method clears any previous selection.

Exceptions:

IllegalArgumentException if the specified component is not an immediate child of the control.

See Also: setSelectedIndex, addSelectedItem, getSelectedItem

setSelectedItem

public void setSelectedItem(IUIComponent comp, boolean notify);

Sets the selection to the specified component and optionally generates a list select event.

Return Value:

No return value.

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

Remarks:

This method clears any previous selection.

Exceptions:

IllegalArgumentException if the specified component is not an immediate child of the control.

See Also: setSelectedIndex, addSelectedItem, getSelectedItem

setSelectedItems

public void setSelectedItems(IUIComponent comps[]);

Sets the selection to the specified components. List select events are not generated.

Return Value:

No return value.

ParameterDescription
comps An array containing the items to be selected. Because the control's selection mode can only be SINGLESELECT, the array should contain only one item.

Remarks:

This method clears any previous selection.

Exceptions:

IllegalArgumentException if any component in the array is not an immediate child of the control.

See Also: setSelectedItem, setSelectedIndices, getSelectedItems

setSelectedItems

public void setSelectedItems(IUIComponent comps[], boolean notify);

Sets the selection to the specified components and optionally generates list select events.

Return Value:

No return value.

ParameterDescription
comps An array containing the items to be selected. Because the control's selection mode can only be SINGLESELECT, the array should contain only one item.
notify If true, list select events will be generated; otherwise, list select events will not be generated.

Remarks:

This method clears any previous selection.

Exceptions:

IllegalArgumentException if any component in the array is not an immediate child of the control.

See Also: setSelectedIndices, getSelectedItems

setSelectionMode

public void setSelectionMode(int selMode);

Sets the selection mode of the control.

Return Value:

No return value.

ParameterDescription
selMode The selection mode for the control. The following selection modes are valid.
SINGLESELECT MULTISELECT EXTENDSELECT
NOSELECT

Exceptions:

IllegalArgumentException if an undefined selection mode was specified.

See Also: getSelectionMode

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