Class DualList

java.lang.Object
org.eclipse.swt.widgets.Widget
org.eclipse.swt.widgets.Control
org.eclipse.swt.widgets.Scrollable
org.eclipse.swt.widgets.Composite
org.eclipse.nebula.widgets.opal.duallist.DualList
All Implemented Interfaces:
org.eclipse.swt.graphics.Drawable

public class DualList
extends org.eclipse.swt.widgets.Composite
Instances of this class are controls that allow the user to select multiple elements.
Styles:
(none)
Events:
Selection
  • Field Summary

    Fields inherited from class org.eclipse.swt.widgets.Control

    handle
  • 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 the SelectionChangeListener 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 the SelectionListener 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 item
    DLConfiguration 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 of DLItems which are the items in the receiver.
    java.util.List<DLItem> getItemsAsList()
    Returns a (possibly empty) list of DLItems which are the items in the receiver.
    DLItem[] getSelection()
    Returns an array of DLItems that are currently selected in the receiver.
    java.util.List<DLItem> getSelectionAsList()
    Returns a list of DLItems 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 down
    protected void moveSelectionToFirstPosition()
    Move the selected item to the first position
    protected void moveSelectionToLastPosition()
    Move the selected item to the last position
    protected void moveUpItem()
    Move the selected item up
    void 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 item
    void setBounds​(int x, int y, int width, int height)  
    void setConfiguration​(DLConfiguration configuration)
    Sets the receiver's configuration
    void 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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.eclipse.swt.graphics.Drawable

    isAutoScalable
  • 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 the int "|" operator) two or more of those SWT 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

      public void add​(DLItem item)
      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

      public void add​(DLItem item, int index)
      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 use add(DLItem).

      Parameters:
      item - the new item
      index - 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 the SelectionListener 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

      public 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 the SelectionChangeListener 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

      public void removeSelectionChangeListener​(SelectionChangeListener 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:
      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 deselect
      end - 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 deselect
      end - 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

      public DLItem getItem​(int index)
      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

      public DLItem[] getItems()
      Returns a (possibly empty) array of DLItems 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

      public java.util.List<DLItem> getItemsAsList()
      Returns a (possibly empty) list of DLItems 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

      public DLItem[] getSelection()
      Returns an array of DLItems 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

      public java.util.List<DLItem> getSelectionAsList()
      Returns a list of DLItems 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 range
      end - 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

      public 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.
      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 range
      end - 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 range
      end - 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 class org.eclipse.swt.widgets.Control
      See Also:
      Control.setBounds(int, int, int, int)
    • setItem

      public void setItem​(int index, DLItem item)
      Sets the item in the receiver's list at the given zero-relative index to the item argument.
      Parameters:
      index - the index for the item
      item - 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

      public void setItems​(DLItem[] items)
      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

      public void setItems​(java.util.List<DLItem> items)
      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

      public DLConfiguration 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

      public void setConfiguration​(DLConfiguration configuration)
      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