public class DualList
extends org.eclipse.swt.widgets.Composite
Constructor and 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.
|
Modifier and Type | Method and 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
|
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
DLItem s which are the items
in the receiver. |
java.util.List<DLItem> |
getItemsAsList()
Returns a (possibly empty) list of
DLItem s which are the items
in the receiver. |
DLItem[] |
getSelection()
Returns an array of
DLItem s that are currently selected in the
receiver. |
java.util.List<DLItem> |
getSelectionAsList()
Returns a list of
DLItem 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 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(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 |
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 |
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 |
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(DLItem[] items)
Sets the receiver's items to be the given array of items.
|
void |
setItems(java.util.List<DLItem> items)
Sets the receiver's items to be the given list of items.
|
changed, checkSubclass, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList
computeTrim, getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBar
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
addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getListeners, getStyle, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setData, toString
public DualList(org.eclipse.swt.widgets.Composite parent, int style)
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.
parent
- a composite control which will be the parent of the new
instance (cannot be null)style
- the style of control to constructjava.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- public void add(DLItem item)
item
- the new itemjava.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- add(DLItem,int)
public void add(DLItem item, int 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)
.
item
- the new itemindex
- the index for the itemjava.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- #add(String)
public void addSelectionListener(org.eclipse.swt.events.SelectionListener listener)
SelectionListener
interface.listener
- the listener which should be notifiedjava.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- SelectionListener
,
removeSelectionListener(org.eclipse.swt.events.SelectionListener)
,
SelectionEvent
public void removeSelectionListener(org.eclipse.swt.events.SelectionListener listener)
listener
- the listener which should no longer be notifiedjava.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- SelectionListener
,
addSelectionListener(org.eclipse.swt.events.SelectionListener)
public void addSelectionChangeListener(SelectionChangeListener listener)
SelectionChangeListener
interface.listener
- the listener which should be notifiedjava.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- SelectionChangeListener
,
removeSelectionChangeListener(org.eclipse.nebula.widgets.opal.duallist.SelectionChangeListener)
,
SelectionChangeEvent
public void removeSelectionChangeListener(SelectionChangeListener listener)
listener
- the listener which should no longer be notifiedjava.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- SelectionChangeListener
,
addSelectionChangeListener(org.eclipse.nebula.widgets.opal.duallist.SelectionChangeListener)
public void deselect(int index)
index
- the index of the item to deselectorg.eclipse.swt.SWTException
- public void deselectDoNotFireEvent(int index)
index
- the index of the item to deselectorg.eclipse.swt.SWTException
- public void deselect(int[] indices)
indices
- the array of indices for the items to deselectjava.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- public void deselectDoNotFireEvent(int[] indices)
indices
- the array of indices for the items to deselectjava.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- public void deselect(int start, int end)
start
- the start index of the items to deselectend
- the end index of the items to deselectjava.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- public void deselectDoNotFireEvent(int start, int end)
start
- the start index of the items to deselectend
- the end index of the items to deselectjava.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- public void deselectAll()
org.eclipse.swt.SWTException
- public void deselectAllDoNotFireEvent()
org.eclipse.swt.SWTException
- public void deselectAll(boolean shouldFireEvents)
org.eclipse.swt.SWTException
- public DLItem getItem(int index)
index
- the index of the item to returnjava.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- public int getItemCount()
org.eclipse.swt.SWTException
- public DLItem[] getItems()
DLItem
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.
org.eclipse.swt.SWTException
- public java.util.List<DLItem> getItemsAsList()
DLItem
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.
org.eclipse.swt.SWTException
- public DLItem[] getSelection()
DLItem
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.
org.eclipse.swt.SWTException
- public java.util.List<DLItem> getSelectionAsList()
DLItem
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.
org.eclipse.swt.SWTException
- public int getSelectionCount()
org.eclipse.swt.SWTException
- public void remove(int index)
index
- the index for the itemjava.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- public void remove(int[] indices)
indices
- the array of indices of the itemsjava.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- public void remove(int start, int end)
start
- the start of the rangeend
- the end of the rangejava.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- public void remove(DLItem item)
item
- the item to removejava.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- public void removeAll()
org.eclipse.swt.SWTException
- public void select(int index)
index
- the index of the item to selectorg.eclipse.swt.SWTException
- public void selectDoNotFireEvent(int index)
index
- the index of the item to selectorg.eclipse.swt.SWTException
- public void select(int[] indices)
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.
indices
- the array of indices for the items to selectjava.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- public void selectDoNotFireEvent(int[] indices)
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.
indices
- the array of indices for the items to selectjava.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- public void select(int start, int end)
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.
start
- the start of the rangeend
- the end of the rangeorg.eclipse.swt.SWTException
- List#setSelection(int,int)
public void selectDoNotFireEvent(int start, int end)
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.
start
- the start of the rangeend
- the end of the rangeorg.eclipse.swt.SWTException
- List#setSelection(int,int)
public void selectAll()
If the receiver is single-select, do nothing.
org.eclipse.swt.SWTException
- public void selectAllDoNotFireEvent()
If the receiver is single-select, do nothing.
org.eclipse.swt.SWTException
- public void setBounds(int x, int y, int width, int height)
setBounds
in class org.eclipse.swt.widgets.Control
Control.setBounds(int, int, int, int)
public void setItem(int index, DLItem item)
index
- the index for the itemitem
- the new itemjava.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- public void setItems(DLItem[] items)
items
- the array of itemsjava.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- public void setItems(java.util.List<DLItem> items)
items
- the list of itemsjava.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- protected void moveSelectionToFirstPosition()
protected void selectItem()
protected void moveUpItem()
protected void deselectItem()
protected void moveDownItem()
protected void moveSelectionToLastPosition()