Constructs a new instance of this class given its parent and a style value describing its behavior and appearance. <p> The style value is either one of the style constants defined in class <code>SWT</code> which is applicable to instances of this class, or must be built by <em>bitwise OR</em>'ing together (that is, using the <code>int</code> "|" operator) two or more of those <code>SWT</code> style constants. The class description lists the style constants that are applicable to the class. Style bits are also inherited from superclasses. </p>
Adds the argument to the end of the receiver's list.
Adds the argument to the receiver's list at the given zero-relative index. <p> Note: To add an item at the end of the list, use the result of calling <code>getItemCount()</code> as the index or use <code>add(String)</code>. </p>
Adds the listener to the collection of listeners who will be notified when the user changes the receiver's selection, by sending it one of the messages defined in the <code>SelectionListener</code> interface. <p> <code>widgetSelected</code> is called when the selection changes. <code>widgetDefaultSelected</code> is typically called when an item is double-clicked. </p>
Deselects the item at the given zero-relative index in the receiver. If the item at the index was already deselected, it remains deselected. Indices that are out of range are ignored.
Deselects the items at the given zero-relative indices in the receiver. If the item at the given zero-relative index in the receiver is selected, it is deselected. If the item at the index was not selected, it remains deselected. The range of the indices is inclusive. Indices that are out of range are ignored.
Deselects the items at the given zero-relative indices in the receiver. If the item at the given zero-relative index in the receiver is selected, it is deselected. If the item at the index was not selected, it remains deselected. Indices that are out of range and duplicate indices are ignored.
Deselects all selected items in the receiver.
Returns the zero-relative index of the item which currently has the focus in the receiver, or -1 if no item has focus.
Returns the item at the given, zero-relative index in the receiver. Throws an exception if the index is out of range.
Returns the number of items contained in the receiver.
Returns the height of the area which would be used to display <em>one</em> of the items in the list.
Returns a (possibly empty) array of <code>String</code>s which are the items in the receiver. <p> Note: This is not the actual structure used by the receiver to maintain its list of items, so modifying the array will not affect the receiver. </p>
Returns an array of <code>String</code>s that are currently selected in the receiver. The order of the items is unspecified. An empty array indicates that no items are selected. <p> Note: This is not the actual structure used by the receiver to maintain its selection, so modifying the array will not affect the receiver. </p> @return an array representing the selection
Returns the number of selected items contained in the receiver.
Returns the zero-relative index of the item which is currently selected in the receiver, or -1 if no item is selected.
Returns the zero-relative indices of the items which are currently selected in the receiver. The order of the indices is unspecified. The array is empty if no items are selected. <p> Note: This is not the actual structure used by the receiver to maintain its selection, so modifying the array will not affect the receiver. </p> @return the array of indices of the selected items
Returns the zero-relative index of the item which is currently at the top of the receiver. This index can change when items are scrolled or new items are added or removed.
Gets the index of an item. <p> The list is searched starting at 0 until an item is found that is equal to the search item. If no item is found, -1 is returned. Indexing is zero based.
Searches the receiver's list starting at the given, zero-relative index until an item is found that is equal to the argument, and returns the index of that item. If no item is found or the starting index is out of range, returns -1.
Returns <code>true</code> if the item is selected, and <code>false</code> otherwise. Indices out of range are ignored.
Removes the item from the receiver at the given zero-relative index.
Removes the items from the receiver which are between the given zero-relative start and end indices (inclusive).
Searches the receiver's list starting at the first item until an item is found that is equal to the argument, and removes that item from the list.
Removes the items from the receiver at the given zero-relative indices.
Removes all of the items from the receiver. <p> @exception SWTException <ul> <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> </ul>
Removes the listener from the collection of listeners who will be notified when the user changes the receiver's selection.
Selects the item at the given zero-relative index in the receiver's list. If the item at the index was already selected, it remains selected. Indices that are out of range are ignored.
Selects the items in the range specified by the given zero-relative indices in the receiver. The range of indices is inclusive. The current selection is not cleared before the new items are selected. <p> If an item in the given range is not selected, it is selected. If an item in the given range was already selected, it remains selected. Indices that are out of range are ignored and no items will be selected if start is greater than end. If the receiver is single-select and there is more than one item in the given range, then all indices are ignored.
Selects the items at the given zero-relative indices in the receiver. The current selection is not cleared before the new items are selected. <p> If the item at a given index is not selected, it is selected. If the item at a given index was already selected, it remains selected. Indices that are out of range and duplicate indices are ignored. If the receiver is single-select and multiple indices are specified, then all indices are ignored.
Selects all of the items in the receiver. <p> If the receiver is single-select, do nothing.
Sets the text of the item in the receiver's list at the given zero-relative index to the string argument.
Sets the receiver's items to be the given array of items.
Selects the item at the given zero-relative index in the receiver. If the item at the index was already selected, it remains selected. The current selection is first cleared, then the new item is selected. Indices that are out of range are ignored.
Selects the items in the range specified by the given zero-relative indices in the receiver. The range of indices is inclusive. The current selection is cleared before the new items are selected. <p> Indices that are out of range are ignored and no items will be selected if start is greater than end. If the receiver is single-select and there is more than one item in the given range, then all indices are ignored.
Selects the items at the given zero-relative indices in the receiver. The current selection is cleared before the new items are selected. <p> Indices that are out of range and duplicate indices are ignored. If the receiver is single-select and multiple indices are specified, then all indices are ignored.
Sets the receiver's selection to be the given array of items. The current selection is cleared before the new items are selected. <p> Items that are not in the receiver are ignored. If the receiver is single-select and multiple items are specified, then all items are ignored.
Sets the zero-relative index of the item which is currently at the top of the receiver. This index can change when items are scrolled or new items are added and removed.
Shows the selection. If the selection is already showing in the receiver, this method simply returns. Otherwise, the items are scrolled until the selection is visible.
Given a desired <em>client area</em> for the receiver (as described by the arguments), returns the bounding rectangle which would be required to produce that client area. <p> In other words, it returns a rectangle such that, if the receiver's bounds were set to that rectangle, the area of the receiver which is capable of displaying data (that is, not covered by the "trimmings") would be the rectangle described by the arguments (relative to the receiver's parent). </p>
Returns a rectangle which describes the area of the receiver which is capable of displaying data (that is, not covered by the "trimmings").
Returns the receiver's horizontal scroll bar if it has one, and null if it does not.
Returns the receiver's vertical scroll bar if it has one, and null if it does not.
Instances of this class represent a selectable user interface object that displays a list of strings and issues notification when a string is selected. A list may be single or multi select. <p> <dl> <dt><b>Styles:</b></dt> <dd>SINGLE, MULTI</dd> <dt><b>Events:</b></dt> <dd>Selection, DefaultSelection</dd> </dl> <p> Note: Only one of SINGLE and MULTI may be specified. </p><p> IMPORTANT: This class is <em>not</em> intended to be subclassed. </p>
@see <a href="http://www.eclipse.org/swt/snippets/#list">List snippets</a> @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: ControlExample</a> @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>