Interface IUISelector
public interface IUISelector
{
// Fields
public static final int EXTENDSELECT;
public static final int MULTISELECT;
public static final int NOSELECT;
public static final int SINGLESELECT;
// Methods
public void addActionListener(IUIActionListener l);
public void addItemListener(IUIItemListener 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 addSelectedItems(IUIComponent comps[]);
public void addSelectedItems(IUIComponent comps[],
boolean notify);
public IUIComponent getAnchorItem();
public IUIComponent getExtensionItem();
public int getSelectedIndex();
public int[] getSelectedIndices();
public IUIComponent getSelectedItem();
public IUIComponent[] getSelectedItems();
public int getSelectionMode();
public void removeActionListener(IUIActionListener l);
public void removeItemListener(IUIItemListener l);
public void removeSelectedIndex(int index);
public void removeSelectedIndex(int index, boolean notify);
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 setAnchorItem(IUIComponent comp);
public void setExtensionItem(IUIComponent comp);
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 mode);
}
This interface is used to manage the selection of child components. UISelector implements IUISelector.
public void addActionListener(IUIActionListener l);
Adds the specified action listener. The listener receives all action events generated for the control.
Return Value:
No return value.
Parameter | Description |
l
| The action listener to be added.
|
See Also: removeActionListener
public void addItemListener(IUIItemListener l);
Adds the specified item listener. The listener receives all item events generated for the control. (Item events are generated when the state of an item changes.)
Return Value:
No return value.
Parameter | Description |
l
| The item listener to be added.
|
See Also: removeItemListener
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.
Parameter | Description |
index
| The zero-based index of the item to be selected.
|
See Also: removeSelectedIndex
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.
Parameter | Description |
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.
|
See Also: removeSelectedIndex
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.
Parameter | Description |
indices
| An array containing the indices of the items to be selected.
|
See Also: removeSelectedIndices
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.
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.
|
See Also: removeSelectedIndices
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.
Parameter | Description |
comp
| The component to be selected.
|
See Also: removeSelectedItem
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.
Parameter | Description |
comp
| The component to be selected.
|
notify
| If true, list select events will be generated; otherwise, list select events will not be generated.
|
See Also: removeSelectedItem
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.
Parameter | Description |
comps
| An array containing the components to be selected.
|
See Also: removeSelectedItems
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.
Parameter | Description |
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.
|
See Also: removeSelectedItems
public IUIComponent getAnchorItem();
Retrieves the component that is the current anchor in extend select mode.
Return Value:
Returns the component that is the anchor.
See Also: setAnchorItem
public IUIComponent getExtensionItem();
Retrieves the item to which a selection last extended from the anchor item.
Return Value:
Returns the extension item.
See Also: setExtensionItem
public int getSelectedIndex();
Retrieves the zero-based index of the currently selected item.
Return Value:
Returns the index of the selected item if an item is selected; otherwise, returns -1.
Remarks:
If the control's selection mode is MULTISELECT or EXTENDSELECT, you can also call getSelectedIndices.
See Also: setSelectedIndex
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, if an item is selected; otherwise, returns -1.
See Also: setSelectedIndices
public IUIComponent getSelectedItem();
Retrieves the currently selected item.
Return Value:
Returns the selected component, if a component is selected; otherwise, returns null.
Remarks:
If the control's selection mode is MULTISELECT or EXTENDSELECT, you can also call getSelectedItems.
See Also: setSelectedItem
public IUIComponent[] getSelectedItems();
Retrieves all currently selected items.
Return Value:
Returns an array of the selected components, if a component is selected; otherwise, returns null.
See Also: setSelectedItems
public int getSelectionMode();
Retrieves the selection mode of the control.
Return Value:
Returns one of the following three selection modes: SINGLESELECT, MULTISELECT, or EXTENDSELECT.
See Also: setSelectionMode
public void removeActionListener(IUIActionListener l);
Removes the specified action listener. The listener no longer receives the control's action events.
Return Value:
No return value.
Parameter | Description |
l
| The action listener to be removed.
|
See Also: addActionListener
public void removeItemListener(IUIItemListener l);
Removes the specified item listener. The listener no longer receives the control's item events.
Return Value:
No return value.
Parameter | Description |
l
| The item listener to be removed.
|
See Also: addItemListener
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.
Parameter | Description |
index
| The zero-based index of the item to be deselected.
|
See Also: addSelectedIndex
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.
Parameter | Description |
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.
|
See Also: addSelectedIndex
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.
Parameter | Description |
indices
| An array containing the indices of the items to be deselected.
|
See Also: addSelectedIndices
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.
Parameter | Description |
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.
|
See Also: addSelectedIndices
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.
Parameter | Description |
comp
| The component to be deselected.
|
See Also: addSelectedItem
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.
Parameter | Description |
comp
| The component to be deselected.
|
notify
| If true, list deselect events will be generated; otherwise, list deselect events will not be generated.
|
See Also: addSelectedItem
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.
Parameter | Description |
comps
| An array containing the components to be deselected.
|
See Also: addSelectedItems
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.
Parameter | Description |
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.
|
See Also: addSelectedItems
public void setAnchorItem(IUIComponent comp);
Sets the item used as an anchor in extend select mode. The anchor item cannot be set to null.
Return Value:
No return value.
Parameter | Description |
comp
| The component that will be the new anchor.
|
Remarks:
Resetting the anchor automatically sets the current extension item to null. If it is intended to set them both to specific items, call setAnchorItem, followed by setExtensionItem.
Note Setting the anchor in an IUISelector other than the outermost one, has no effect.
Exceptions:
IllegalArgumentException
if comp is not a child of the selector, or if comp is null.
See Also: getAnchorItem
public void setExtensionItem(IUIComponent comp);
Sets the item to which a selection extends from an anchor.
Note Calling setAnchorItem automatically resets this item to null.
Return Value:
No return value.
Parameter | Description |
comp
| The component that will be the new extension item.
|
Exceptions:
IllegalArgumentException
if comp is not a component of the selector.
See Also: getExtensionItem
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.
See Also: getSelectedIndex
public void setSelectedIndex(int index, boolean notify);
Sets the selection to the component at the specified index and provides the option of generating 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.
See Also: getSelectedIndex
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.
Parameter | Description |
indices
| An array containing the indices of the items to be selected.
|
Remarks:
This method clears any previous selection.
See Also: getSelectedIndices
public void setSelectedIndices(int indices[], boolean notify);
Sets the selection to the components at the specified indices and provides the option of generating 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.
See Also: getSelectedIndices
public void setSelectedItem(IUIComponent comp);
Sets the selection to the specified component. 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.
See Also: getSelectedItem
public void setSelectedItem(IUIComponent comp, boolean notify);
Sets the selection to the specified component and provides the option of generating 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.
See Also: getSelectedItem
public void setSelectedItems(IUIComponent 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.
See Also: getSelectedItems
public void setSelectedItems(IUIComponent comps[], boolean notify);
Sets the selection to the specified components, and provides the option of generating 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.
See Also: getSelectedItems
public void setSelectionMode(int mode);
Sets the selection mode of the control.
Return Value:
No return value.
See Also: getSelectionMode
- EXTENDSELECT
- More than one item can be selected by dragging the mouse over the items or by using the SHIFT key to extend the selection.
- MULTISELECT
- Multiple items may be selected by clicking each individual item.
- NOSELECT
- Specifies that no items can be selected by the application.
- SINGLESELECT
- Only one item may be selected at a time.