Class DualList
- All Implemented Interfaces:
org.eclipse.swt.graphics.Drawable
public class DualList
extends org.eclipse.swt.widgets.Composite
- Styles:
- (none)
- Events:
- Selection
-
Field Summary
-
Constructor Summary
Constructors Constructor Description DualList(org.eclipse.swt.widgets.Composite parent, int style)
Constructs a new instance of this class given its parent and a style value describing its behavior and appearance. -
Method Summary
Modifier and Type Method Description void
add(DLItem item)
Adds the argument to the end of the receiver's list.void
add(DLItem item, int index)
Adds the argument to the receiver's list at the given zero-relative index.void
addSelectionChangeListener(SelectionChangeListener listener)
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 theSelectionChangeListener
interface.void
addSelectionListener(org.eclipse.swt.events.SelectionListener listener)
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 theSelectionListener
interface.void
deselect(int index)
Deselects the item at the given zero-relative index in the receiver.void
deselect(int[] indices)
Deselects the items at the given zero-relative indices in the receiver.void
deselect(int start, int end)
Deselects the items at the given zero-relative indices in the receiver.void
deselectAll()
Deselects all selected items in the receiver.void
deselectAll(boolean shouldFireEvents)
Deselects all selected items in the receiver.void
deselectAllDoNotFireEvent()
Deselects all selected items in the receiver.void
deselectDoNotFireEvent(int index)
Deselects the item at the given zero-relative index in the receiver.void
deselectDoNotFireEvent(int[] indices)
Deselects the items at the given zero-relative indices in the receiver.void
deselectDoNotFireEvent(int start, int end)
Deselects the items at the given zero-relative indices in the receiver.protected void
deselectItem()
Deselect a given itemDLConfiguration
getConfiguration()
Returns the configuration of the receiver.DLItem
getItem(int index)
Returns the item at the given, zero-relative index in the receiver.int
getItemCount()
Returns the number of items contained in the receiver.DLItem[]
getItems()
Returns a (possibly empty) array ofDLItem
s which are the items in the receiver.java.util.List<DLItem>
getItemsAsList()
Returns a (possibly empty) list ofDLItem
s which are the items in the receiver.DLItem[]
getSelection()
Returns an array ofDLItem
s that are currently selected in the receiver.java.util.List<DLItem>
getSelectionAsList()
Returns a list ofDLItem
s that are currently selected in the receiver.int
getSelectionCount()
Returns the number of selected items contained in the receiver.protected void
moveDownItem()
Move the selected item downprotected void
moveSelectionToFirstPosition()
Move the selected item to the first positionprotected void
moveSelectionToLastPosition()
Move the selected item to the last positionprotected void
moveUpItem()
Move the selected item upvoid
remove(int index)
Removes the item from the receiver at the given zero-relative index.void
remove(int[] indices)
Removes the items from the receiver at the given zero-relative indices.void
remove(int start, int end)
Removes the items from the receiver which are between the given zero-relative start and end indices (inclusive).void
remove(DLItem item)
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.void
removeAll()
Removes all of the items from the receiver.void
removeSelectionChangeListener(SelectionChangeListener listener)
Removes the listener from the collection of listeners who will be notified when the user changes the receiver's selection.void
removeSelectionListener(org.eclipse.swt.events.SelectionListener listener)
Removes the listener from the collection of listeners who will be notified when the user changes the receiver's selection.void
select(int index)
Selects the item at the given zero-relative index in the receiver's list.void
select(int[] indices)
Selects the items at the given zero-relative indices in the receiver.void
select(int start, int end)
Selects the items in the range specified by the given zero-relative indices in the receiver.void
selectAll()
Selects all of the items in the receiver.void
selectAllDoNotFireEvent()
Selects all of the items in the receiver.void
selectDoNotFireEvent(int index)
Selects the item at the given zero-relative index in the receiver's list.void
selectDoNotFireEvent(int[] indices)
Selects the items at the given zero-relative indices in the receiver.void
selectDoNotFireEvent(int start, int end)
Selects the items in the range specified by the given zero-relative indices in the receiver.protected void
selectItem()
Select a given itemvoid
setBounds(int x, int y, int width, int height)
void
setConfiguration(DLConfiguration configuration)
Sets the receiver's configurationvoid
setItem(int index, DLItem item)
Sets the item in the receiver's list at the given zero-relative index to the item argument.void
setItems(java.util.List<DLItem> items)
Sets the receiver's items to be the given list of items.void
setItems(DLItem[] items)
Sets the receiver's items to be the given array of items.Methods inherited from class org.eclipse.swt.widgets.Composite
changed, checkSubclass, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList, toString
Methods inherited from class org.eclipse.swt.widgets.Scrollable
computeTrim, getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBar
Methods inherited from class org.eclipse.swt.widgets.Control
addControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTouchListener, addTraverseListener, computeSize, computeSize, dragDetect, dragDetect, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getCursor, getDragDetect, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getOrientation, getParent, getRegion, getShell, getSize, getTextDirection, getToolTipText, getTouchEnabled, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, print, redraw, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeGestureListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTouchListener, removeTraverseListener, requestLayout, setBackground, setBackgroundImage, setBounds, setCapture, setCursor, setDragDetect, setEnabled, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setOrientation, setParent, setRedraw, setRegion, setSize, setSize, setTextDirection, setToolTipText, setTouchEnabled, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, traverse, traverse, update
Methods inherited from class org.eclipse.swt.widgets.Widget
addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getListeners, getStyle, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setData
-
Constructor Details
-
DualList
public DualList(org.eclipse.swt.widgets.Composite parent, int style)Constructs a new instance of this class given its parent and a style value describing its behavior and appearance.The style value is either one of the style constants defined in class
SWT
which is applicable to instances of this class, or must be built by bitwise OR'ing together (that is, using theint
"|" operator) two or more of thoseSWT
style constants. The class description lists the style constants that are applicable to the class. Style bits are also inherited from superclasses.- Parameters:
parent
- a composite control which will be the parent of the new instance (cannot be null)style
- the style of control to construct- Throws:
java.lang.IllegalArgumentException
-- ERROR_NULL_ARGUMENT - if the parent is null
org.eclipse.swt.SWTException
-- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent
-
-
Method Details
-
add
Adds the argument to the end of the receiver's list.- Parameters:
item
- the new item- Throws:
java.lang.IllegalArgumentException
-- ERROR_NULL_ARGUMENT - if the item is null
org.eclipse.swt.SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- See Also:
add(DLItem,int)
-
add
Adds the argument to the receiver's list at the given zero-relative index.Note: To add an item at the end of the list, use the result of calling
getItemCount()
as the index or useadd(DLItem)
.- Parameters:
item
- the new itemindex
- the index for the item- Throws:
java.lang.IllegalArgumentException
-- ERROR_NULL_ARGUMENT - if the item is null
- ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list (inclusive)
org.eclipse.swt.SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- See Also:
#add(String)
-
addSelectionListener
public void addSelectionListener(org.eclipse.swt.events.SelectionListener listener)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 theSelectionListener
interface.- Parameters:
listener
- the listener which should be notified- Throws:
java.lang.IllegalArgumentException
-- ERROR_NULL_ARGUMENT - if the listener is null
org.eclipse.swt.SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- See Also:
SelectionListener
,removeSelectionListener(org.eclipse.swt.events.SelectionListener)
,SelectionEvent
-
removeSelectionListener
public void removeSelectionListener(org.eclipse.swt.events.SelectionListener listener)Removes the listener from the collection of listeners who will be notified when the user changes the receiver's selection.- Parameters:
listener
- the listener which should no longer be notified- Throws:
java.lang.IllegalArgumentException
-- ERROR_NULL_ARGUMENT - if the listener is null
org.eclipse.swt.SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- See Also:
SelectionListener
,addSelectionListener(org.eclipse.swt.events.SelectionListener)
-
addSelectionChangeListener
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 theSelectionChangeListener
interface.- Parameters:
listener
- the listener which should be notified- Throws:
java.lang.IllegalArgumentException
-- ERROR_NULL_ARGUMENT - if the listener is null
org.eclipse.swt.SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- See Also:
SelectionChangeListener
,removeSelectionChangeListener(org.eclipse.nebula.widgets.opal.duallist.SelectionChangeListener)
,SelectionChangeEvent
-
removeSelectionChangeListener
Removes the listener from the collection of listeners who will be notified when the user changes the receiver's selection.- Parameters:
listener
- the listener which should no longer be notified- Throws:
java.lang.IllegalArgumentException
-- ERROR_NULL_ARGUMENT - if the listener is null
org.eclipse.swt.SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- See Also:
SelectionChangeListener
,addSelectionChangeListener(org.eclipse.nebula.widgets.opal.duallist.SelectionChangeListener)
-
deselect
public void deselect(int index)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.- Parameters:
index
- the index of the item to deselect- Throws:
org.eclipse.swt.SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
deselectDoNotFireEvent
public void deselectDoNotFireEvent(int index)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.- Parameters:
index
- the index of the item to deselect- Throws:
org.eclipse.swt.SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
deselect
public void deselect(int[] indices)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.- Parameters:
indices
- the array of indices for the items to deselect- Throws:
java.lang.IllegalArgumentException
-- ERROR_NULL_ARGUMENT - if the set of indices is null
org.eclipse.swt.SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
deselectDoNotFireEvent
public void deselectDoNotFireEvent(int[] indices)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.- Parameters:
indices
- the array of indices for the items to deselect- Throws:
java.lang.IllegalArgumentException
-- ERROR_NULL_ARGUMENT - if the set of indices is null
org.eclipse.swt.SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
deselect
public void deselect(int start, int end)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.- Parameters:
start
- the start index of the items to deselectend
- the end index of the items to deselect- Throws:
java.lang.IllegalArgumentException
-- ERROR_INVALID_RANGE - if start is greater than end
org.eclipse.swt.SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
deselectDoNotFireEvent
public void deselectDoNotFireEvent(int start, int end)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.- Parameters:
start
- the start index of the items to deselectend
- the end index of the items to deselect- Throws:
java.lang.IllegalArgumentException
-- ERROR_INVALID_RANGE - if start is greater than end
org.eclipse.swt.SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
deselectAll
public void deselectAll()Deselects all selected items in the receiver.- Throws:
org.eclipse.swt.SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
deselectAllDoNotFireEvent
public void deselectAllDoNotFireEvent()Deselects all selected items in the receiver.- Throws:
org.eclipse.swt.SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
deselectAll
public void deselectAll(boolean shouldFireEvents)Deselects all selected items in the receiver.- Throws:
org.eclipse.swt.SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getItem
Returns the item at the given, zero-relative index in the receiver. Throws an exception if the index is out of range.- Parameters:
index
- the index of the item to return- Returns:
- the item at the given index
- Throws:
java.lang.IllegalArgumentException
-- ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)
org.eclipse.swt.SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getItemCount
public int getItemCount()Returns the number of items contained in the receiver.- Returns:
- the number of items
- Throws:
org.eclipse.swt.SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getItems
Returns a (possibly empty) array ofDLItem
s which are the items in the receiver.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.
- Returns:
- the items in the receiver's list
- Throws:
org.eclipse.swt.SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getItemsAsList
Returns a (possibly empty) list ofDLItem
s which are the items in the receiver.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.
- Returns:
- the items in the receiver's list
- Throws:
org.eclipse.swt.SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getSelection
Returns an array ofDLItem
s that are currently selected in the receiver. An empty array indicates that no items are selected.Note: This is not the actual structure used by the receiver to maintain its selection, so modifying the array will not affect the receiver.
- Returns:
- an array representing the selection
- Throws:
org.eclipse.swt.SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getSelectionAsList
Returns a list ofDLItem
s that are currently selected in the receiver. An empty array indicates that no items are selected.Note: This is not the actual structure used by the receiver to maintain its selection, so modifying the array will not affect the receiver.
- Returns:
- an array representing the selection
- Throws:
org.eclipse.swt.SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getSelectionCount
public int getSelectionCount()Returns the number of selected items contained in the receiver.- Returns:
- the number of selected items
- Throws:
org.eclipse.swt.SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
remove
public void remove(int index)Removes the item from the receiver at the given zero-relative index.- Parameters:
index
- the index for the item- Throws:
java.lang.IllegalArgumentException
-- ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)
org.eclipse.swt.SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
remove
public void remove(int[] indices)Removes the items from the receiver at the given zero-relative indices.- Parameters:
indices
- the array of indices of the items- Throws:
java.lang.IllegalArgumentException
-- ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)
- ERROR_NULL_ARGUMENT - if the indices array is null
org.eclipse.swt.SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
remove
public void remove(int start, int end)Removes the items from the receiver which are between the given zero-relative start and end indices (inclusive).- Parameters:
start
- the start of the rangeend
- the end of the range- Throws:
java.lang.IllegalArgumentException
-- ERROR_INVALID_RANGE - if either the start or end are not between 0 and the number of elements in the list minus 1 (inclusive) or if start>end
org.eclipse.swt.SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
remove
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.- Parameters:
item
- the item to remove- Throws:
java.lang.IllegalArgumentException
-- ERROR_NULL_ARGUMENT - if the item is null
- ERROR_INVALID_ARGUMENT - if the item is not found in the list
org.eclipse.swt.SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
removeAll
public void removeAll()Removes all of the items from the receiver.- Throws:
org.eclipse.swt.SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
select
public void select(int index)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.- Parameters:
index
- the index of the item to select- Throws:
org.eclipse.swt.SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
selectDoNotFireEvent
public void selectDoNotFireEvent(int index)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.- Parameters:
index
- the index of the item to select- Throws:
org.eclipse.swt.SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
select
public void select(int[] indices)Selects the items at the given zero-relative indices in the receiver. The current selection is not cleared before the new items are selected.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.
- Parameters:
indices
- the array of indices for the items to select- Throws:
java.lang.IllegalArgumentException
-- ERROR_NULL_ARGUMENT - if the array of indices is null
org.eclipse.swt.SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
selectDoNotFireEvent
public void selectDoNotFireEvent(int[] indices)Selects the items at the given zero-relative indices in the receiver. The current selection is not cleared before the new items are selected.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.
- Parameters:
indices
- the array of indices for the items to select- Throws:
java.lang.IllegalArgumentException
-- ERROR_NULL_ARGUMENT - if the array of indices is null
org.eclipse.swt.SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
select
public void select(int start, int end)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.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.
- Parameters:
start
- the start of the rangeend
- the end of the range- Throws:
org.eclipse.swt.SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- See Also:
List#setSelection(int,int)
-
selectDoNotFireEvent
public void selectDoNotFireEvent(int start, int end)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.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.
- Parameters:
start
- the start of the rangeend
- the end of the range- Throws:
org.eclipse.swt.SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- See Also:
List#setSelection(int,int)
-
selectAll
public void selectAll()Selects all of the items in the receiver.If the receiver is single-select, do nothing.
- Throws:
org.eclipse.swt.SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
selectAllDoNotFireEvent
public void selectAllDoNotFireEvent()Selects all of the items in the receiver.If the receiver is single-select, do nothing.
- Throws:
org.eclipse.swt.SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setBounds
public void setBounds(int x, int y, int width, int height)- Overrides:
setBounds
in classorg.eclipse.swt.widgets.Control
- See Also:
Control.setBounds(int, int, int, int)
-
setItem
Sets the item in the receiver's list at the given zero-relative index to the item argument.- Parameters:
index
- the index for the itemitem
- the new item- Throws:
java.lang.IllegalArgumentException
-- ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)
- ERROR_NULL_ARGUMENT - if the item is null
org.eclipse.swt.SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setItems
Sets the receiver's items to be the given array of items.- Parameters:
items
- the array of items- Throws:
java.lang.IllegalArgumentException
-- ERROR_NULL_ARGUMENT - if the items array is null
- ERROR_INVALID_ARGUMENT - if an item in the items array is null
org.eclipse.swt.SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setItems
Sets the receiver's items to be the given list of items.- Parameters:
items
- the list of items- Throws:
java.lang.IllegalArgumentException
-- ERROR_NULL_ARGUMENT - if the items list is null
- ERROR_INVALID_ARGUMENT - if an item in the items list is null
org.eclipse.swt.SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
moveSelectionToFirstPosition
protected void moveSelectionToFirstPosition()Move the selected item to the first position -
selectItem
protected void selectItem()Select a given item -
moveUpItem
protected void moveUpItem()Move the selected item up -
deselectItem
protected void deselectItem()Deselect a given item -
moveDownItem
protected void moveDownItem()Move the selected item down -
moveSelectionToLastPosition
protected void moveSelectionToLastPosition()Move the selected item to the last position -
getConfiguration
Returns the configuration of the receiver.- Returns:
- the current configuration of the receiver
- Throws:
org.eclipse.swt.SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setConfiguration
Sets the receiver's configuration- Parameters:
configuration
- the new configuration- Throws:
org.eclipse.swt.SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-