T - Class of objects represented by this widgetpublic class MultiChoice<T>
extends org.eclipse.swt.widgets.Composite
Note that although this class is a subclass of Composite, it
does not make sense to add children to it, or set a layout on it.
| Constructor and Description |
|---|
MultiChoice(org.eclipse.swt.widgets.Composite parent,
int style)
Constructs a new instance of this class given its parent.
|
MultiChoice(org.eclipse.swt.widgets.Composite parent,
int style,
java.util.List<T> elements)
Constructs a new instance of this class given its parent.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(T value)
Adds the argument to the end of the receiver's list.
|
void |
add(T value,
int index)
Adds the argument to the receiver's list at the given zero-relative index.
|
void |
addAll(java.util.List<T> values)
Adds the argument to the end of the receiver's list.
|
void |
addAll(T[] values)
Adds the argument to the end of the receiver's list.
|
org.eclipse.swt.graphics.Point |
computeSize(int wHint,
int hHint,
boolean changed) |
void |
deselect(T value)
Deselects the item in the receiver's list.
|
void |
deselectAll()
Deselects all items in the receiver's list.
|
void |
deselectAt(int index)
Deselects the item at the given zero-relative index in the receiver's list.
|
org.eclipse.swt.graphics.Color |
getBackground() |
boolean |
getEditable()
Returns the editable state.
|
org.eclipse.swt.graphics.Font |
getFont() |
org.eclipse.swt.graphics.Color |
getForeground() |
T |
getItem(int index)
Returns the item at the given, zero-relative index in the receiver's list.
|
int |
getItemCount()
Returns the number of items contained in the receiver's list.
|
java.util.List<T> |
getItems()
Returns the list of items in the receiver's list.
|
(package private) T |
getLastModified() |
int |
getNumberOfColumns() |
(package private) org.eclipse.swt.widgets.Shell |
getPopup() |
int[] |
getSelectedIndex()
Returns the zero-relative indices of the items which are currently selected
in the receiver.
|
java.util.List<T> |
getSelection()
Returns an array of
Objects that are currently selected in the
receiver. |
org.eclipse.swt.events.SelectionListener |
getSelectionListener() |
java.lang.String |
getSeparator() |
java.lang.String |
getText() |
void |
refresh()
Refresh the widget (after the add of a new element for example)
|
void |
remove(T object)
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()
Remove all items of the receiver
|
void |
removeAt(int index)
Removes the item from the receiver's list at the given zero-relative index.
|
void |
select(T value)
Selects an item the receiver's list.
|
void |
selectAll()
Selects all selected items in the receiver's list.
|
void |
selectAt(int index)
Selects the item at the given zero-relative index in the receiver's list.
|
void |
setBackground(org.eclipse.swt.graphics.Color background) |
void |
setEditable(boolean editable)
Sets the editable state.
|
void |
setEnabled(boolean enabled) |
void |
setFont(org.eclipse.swt.graphics.Font font) |
void |
setForeground(org.eclipse.swt.graphics.Color foreground) |
void |
setLabelProvider(MultiChoiceLabelProvider labelProvider) |
void |
setNumberOfColumns(int numberOfColumns) |
void |
setSelectedIndex(int[] index)
Selects items in the receiver.
|
void |
setSelection(java.util.Set<T> selection)
Sets the selection of the receiver.
|
void |
setSelectionListener(MultiChoiceSelectionListener<T> selectionListener) |
void |
setSeparator(java.lang.String separator) |
void |
setText(java.lang.String textValue)
Fill the text box.
|
void |
setToolTipText(java.lang.String txt) |
void |
updateSelection()
Update the selection
|
protected void |
validateEntry() |
changed, checkSubclass, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabListcomputeTrim, getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBaraddControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTouchListener, addTraverseListener, computeSize, dragDetect, dragDetect, forceFocus, getAccessible, getBackgroundImage, getBorderWidth, getBounds, getCursor, getDragDetect, getEnabled, 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, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setLayoutData, setLocation, setLocation, setMenu, setOrientation, setParent, setRedraw, setRegion, setSize, setSize, setTextDirection, setTouchEnabled, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, traverse, traverse, updateaddDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getListeners, getStyle, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setData, toStringpublic MultiChoice(org.eclipse.swt.widgets.Composite parent,
int style)
parent - a widget which will be the parent of the new instance (cannot
be null)style - not usedjava.lang.IllegalArgumentException - org.eclipse.swt.SWTException - public MultiChoice(org.eclipse.swt.widgets.Composite parent,
int style,
java.util.List<T> elements)
parent - a widget which will be the parent of the new instance (cannot
be null)style - not usedelements - list of elements displayed by this widgetjava.lang.IllegalArgumentException - org.eclipse.swt.SWTException - protected void validateEntry()
public void add(T value)
values - new itemjava.lang.IllegalArgumentException - org.eclipse.swt.SWTException - public void add(T value, int index)
values - new itemindex - the index for the itemjava.lang.IllegalArgumentException - org.eclipse.swt.SWTException - public void addAll(java.util.List<T> values)
values - new itemsjava.lang.IllegalArgumentException - org.eclipse.swt.SWTException - public void addAll(T[] values)
values - new itemsjava.lang.IllegalArgumentException - org.eclipse.swt.SWTException - public boolean getEditable()
org.eclipse.swt.SWTException - public T getItem(int index)
index - the index of the item to returnjava.lang.NullPointerException - if there is no item in the receiverjava.lang.IllegalArgumentException - org.eclipse.swt.SWTException - public int getItemCount()
org.eclipse.swt.SWTException - public java.util.List<T> getItems()
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 void removeAt(int index)
index - the index for the itemjava.lang.NullPointerException - if there is no item in the receiverjava.lang.IllegalArgumentException - org.eclipse.swt.SWTException - public void remove(T object)
object - the item to removejava.lang.NullPointerException - if there is no item in the receiverjava.lang.IllegalArgumentException - org.eclipse.swt.SWTException - public void removeAll()
org.eclipse.swt.SWTException - public void setLabelProvider(MultiChoiceLabelProvider labelProvider)
labelProvider - the Label Provider to setpublic void setSelection(java.util.Set<T> selection)
selection - the new selectionjava.lang.NullPointerException - if there is no item in the receiverjava.lang.IllegalArgumentException - org.eclipse.swt.SWTException - public void selectAll()
java.lang.NullPointerException - if there is no item in the receiverorg.eclipse.swt.SWTException - public void selectAt(int index)
index - the index of the item to selectjava.lang.NullPointerException - if there is no item in the receiverjava.lang.IllegalArgumentException - org.eclipse.swt.SWTException - public void select(T value)
index - the index of the item to selectjava.lang.NullPointerException - if there is no item in the receiverjava.lang.IllegalArgumentException - org.eclipse.swt.SWTException - public void setSelectedIndex(int[] index)
index - the indexes of the items to selectjava.lang.NullPointerException - if there is no item in the receiverjava.lang.IllegalArgumentException - org.eclipse.swt.SWTException - public int[] getSelectedIndex()
Note: This is not the actual structure used by the receiver to maintain its selection, so modifying the array will not affect the receiver.
java.lang.NullPointerException - if there is no item in the receiverorg.eclipse.swt.SWTException - public java.util.List<T> getSelection()
Objects that are currently selected in the
receiver. The order of the items is unspecified. 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.
java.lang.NullPointerException - if there is no item in the receiverorg.eclipse.swt.SWTException - public void deselectAt(int index)
index - the index of the item to deselectjava.lang.NullPointerException - if there is no item in the receiverjava.lang.IllegalArgumentException - org.eclipse.swt.SWTException - public void deselect(T value)
value - the item to deselectjava.lang.NullPointerException - if there is no item in the receiverjava.lang.IllegalArgumentException - org.eclipse.swt.SWTException - public void deselectAll()
value - the item to deselectjava.lang.NullPointerException - if there is no item in the receiverorg.eclipse.swt.SWTException - public int getNumberOfColumns()
public void setNumberOfColumns(int numberOfColumns)
numberOfColumns - the number of columnspublic java.lang.String getSeparator()
public void setSeparator(java.lang.String separator)
separator - the new value of the separatorpublic org.eclipse.swt.graphics.Color getForeground()
getForeground in class org.eclipse.swt.widgets.ControlControl.getForeground()public void setForeground(org.eclipse.swt.graphics.Color foreground)
setForeground in class org.eclipse.swt.widgets.ControlControl.setForeground(org.eclipse.swt.graphics.Color)public org.eclipse.swt.graphics.Color getBackground()
getBackground in class org.eclipse.swt.widgets.ControlControl.getBackground()public void setBackground(org.eclipse.swt.graphics.Color background)
setBackground in class org.eclipse.swt.widgets.ControlControl.setBackground(org.eclipse.swt.graphics.Color)public org.eclipse.swt.graphics.Font getFont()
getFont in class org.eclipse.swt.widgets.ControlControl.getFont()public void setFont(org.eclipse.swt.graphics.Font font)
setFont in class org.eclipse.swt.widgets.ControlControl.setFont(org.eclipse.swt.graphics.Font)public void refresh()
public org.eclipse.swt.graphics.Point computeSize(int wHint,
int hHint,
boolean changed)
computeSize in class org.eclipse.swt.widgets.ControlControl.computeSize(int, int, boolean)public void setEnabled(boolean enabled)
setEnabled in class org.eclipse.swt.widgets.ControlControl.setEnabled(boolean)public void setEditable(boolean editable)
editable - the new editable stateorg.eclipse.swt.SWTException - public void setToolTipText(java.lang.String txt)
setToolTipText in class org.eclipse.swt.widgets.ControlControl.setToolTipText(java.lang.String)public org.eclipse.swt.events.SelectionListener getSelectionListener()
public void setSelectionListener(MultiChoiceSelectionListener<T> selectionListener)
selectionListener - the new selection listenerpublic void updateSelection()
T getLastModified()
org.eclipse.swt.widgets.Shell getPopup()
public void setText(java.lang.String textValue)
getSelection()
will return and empty text. To retrieve "USA", you have to use the method
getText();textValue - new text valuepublic java.lang.String getText()