Package com.ms.ui |
![]() Previous |
![]() Contents |
![]() Index |
![]() Next |
public interface IUISelector { // Fields public static final int SINGLESELECT; public static final int MULTISELECT; public static final int EXTENDSELECT; // Methods public int getSelectedIndex(); public int[] getSelectedIndices(); public Component getSelectedItem(); public Component[] getSelectedItems(); public int getSelectionMode(); 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(Component comp); public void setSelectedItem(Component comp, boolean notify); public void setSelectedItems(Component comps[]); public void setSelectedItems(Component comps[], boolean notify); public void setSelectionMode(int selMode); public void selectIndex(int index); public void selectIndex(int index, boolean on); public void selectIndex(int index, boolean on, boolean notify); public void selectItem(Component comp); public void selectItem(Component comp, boolean on); public void selectItem(Component comp, boolean on, boolean notify); }
Defines an interface for classes that manage the selection of child components. UISelector implements this interface.
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 no item is selected.
Remarks:
This method is only valid for single-selection controls. If the selection mode is MULTISELECT or EXTENDSELECT, this method returns -1.
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 no item is selected.
public Component getSelectedItem();Retrieves the currently selected item.
Return Value:
Returns the selected component, or null if no component is selected.
Remarks:
This method is only valid for single-selection controls. If the selection mode is MULTISELECT or EXTENDSELECT, this method returns null.
public Component[] getSelectedItems();Retrieves all currently selected items.
Return Value:
Returns an array of the selected components, or null if no component is selected.
public int getSelectionMode();Retrieves the selection mode of the control.
Return Value:
Returns one of the following three selection modes: SINGLESELECT, MULTISELECT, or EXTENDSELECT.
public void selectIndex(int index);Sets the selected state of the component at the specified index, and sets the control's selection to this component. By default, a LIST_SELECT event is not generated.
Return Value:
No return value.
Parameter Description index The zero-based index of the item to be selected.
public void selectIndex(int index, boolean on);Sets or clears the selected state of the component at the specified index, and sets the control's selection to this component. By default, a LIST_SELECT event is not generated.
Return Value:
No return value.
Parameter Description index The zero-based index of the item to be selected or de-selected. on If true, the item's selected state is set; otherwise, it is cleared.
public void selectIndex(int index, boolean on, boolean notify);Sets or clears the selected state of the component at the specified index, and sets the control's selection to this component. A LIST_SELECT event is optionally generated.
Return Value:
No return value.
Parameter Description index The zero-based index of the item to be selected or de-selected. on If true, the item's selected state is set; otherwise, it is cleared. notify If true, a LIST_SELECT event will be generated; otherwise, a LIST_SELECT event will not be generated.
public void selectItem(Component comp);Sets the selected state of the specified component, and sets the control's selection to this component. By default, a LIST_SELECT event is not generated.
Return Value:
No return value.
Parameter Description index The item to be selected.
public void selectItem(Component comp, boolean on);Sets or clears the selected state of the specified component, and sets the control's selection to this component. By default, a LIST_SELECT event is not generated.
Return Value:
No return value.
Parameter Description index The item to be selected or de-selected. on If true, the item's selected state is set; otherwise, it is cleared.
public void selectItem(Component comp, boolean on, boolean notify);Sets or clears the selected state of the specified component, and sets the control's selection to this component. A LIST_SELECT event is optionally generated.
Return Value:
No return value.
Parameter Description comp The item to be selected or de-selected. on If true, the item's selected state is set; otherwise, it is cleared. notify If true, a LIST_SELECT event will be generated; otherwise, a LIST_SELECT event will not be generated.
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.
Parameter Description index The zero-based index of the item to be selected. Remarks:
This method clears any previous selection.
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.
Parameter Description index The zero-based index of 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.
public void setSelectedIndices(int indices[]);Sets the selection to the components at the specified indices. By default, LIST_SELECT events are not gerenated.
Return Value:
No return value.
Parameter Description indices An array containing the indices of the items to be selected. Remarks:
This method clears any previous selection.
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.
Parameter Description 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. Remarks:
This method clears any previous selection.
public void setSelectedItem(Component comp);Sets the selection to the specified component. By default, a LIST_SELECT event is not generated.
Return Value:
No return value.
Parameter Description comp The item to be selected. Remarks:
This method clears any previous selection.
public void setSelectedItem(Component comp, boolean notify);Sets the selection to the specified component, and optionally generates a LIST_SELECT event.
Return Value:
No return value.
Parameter Description 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.
public void setSelectedItems(Component comps[]);Sets the selection to the specified components. By default, LIST_SELECT events are not generated.
Return Value:
No return value.
Parameter Description comps An array containing the items to be selected. Remarks:
This method clears any previous selection.
public void setSelectedItems(Component comps[], boolean notify);Sets the selection to the specified components, and optionally generates LIST_SELECT events.
Return Value:
No return value.
Parameter Description comps An array containing the items to be selected. notify If true, LIST_SELECT events will be generated; otherwise, LIST_SELECT events will not be generated. Remarks:
This method clears any previous selection.
public void setSelectionMode(int selMode);Sets the selection mode of the control.
Return Value:
No return value.
Parameter Description selMode The selection mode for the control. Specify SINGLESELECT, MULTISELECT, or EXTENDSELECT.
© 1997 Microsoft Corporation. All rights reserved. Legal Notices.