Combos are used in the same place
where a single selection List widget could
be used but space is limited. A Combo takes
less space than a List widget and shows
similar information.Note
Since Combos can contain both a list
and an editable text field, it is possible to confuse methods
which access one versus the other (compare for example,
clearSelection() and deselectAll()).
The API documentation is careful to indicate either "the
receiver's list" or the "the receiver's text field" to
distinguish between the two cases.
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.
Note
Only one of the styles DROP_DOWN and SIMPLE may be specified.
Important Note
This class is not intended to be subclassed.
List, Combo snippets, SWT Example: ControlExample, Sample code and further information
| Modifier and Type | Field and Description |
|---|---|
| pack-priv long | |
| pack-priv GdkRGBA | |
| pack-priv long | |
| pack-priv long | |
| pack-priv long | |
| pack-priv long | |
| pack-priv long | |
| private boolean | |
| pack-priv long | |
| pack-priv boolean | |
| pack-priv boolean | |
| pack-priv int | |
| pack-priv int | |
| pack-priv GdkRGBA | |
| pack-priv long | |
| pack-priv long | |
| pack-priv int | |
| pack-priv String[] | |
| pack-priv int | |
| public static final int | LIMIT
the operating system limit for the number of characters that the text field in an instance of this class can hold |
| pack-priv long | |
| pack-priv long | |
| pack-priv long | |
| pack-priv boolean | |
| pack-priv int |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | |
| public void | addModifyListener(ModifyListener
the listener which should be notified listener)Adds the listener to the collection of listeners who will
be notified when the receiver's text is modified, by sending
it one of the messages defined in the |
| public void | addSegmentListener(SegmentListener
the listener which should be notified listener)Adds a segment listener. |
| public void | addSelectionListener(SelectionListener
the listener which should be notified 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 |
| public void | addVerifyListener(VerifyListener
the listener which should be notified listener)Adds the listener to the collection of listeners who will
be notified when the receiver's text is verified, by sending
it one of the messages defined in the |
| pack-priv void | adjustChildClipping(long
the handle to the widget widget)Overrides org. |
| pack-priv static int | |
| protected void | checkSubclass()
Checks that this class can be subclassed.
|
| pack-priv boolean | |
| public void | clearSelection()
Sets the selection in the receiver's text field to an empty selection starting just before the first character. |
| pack-priv void | |
| pack-priv Point | computeNativeSize(long h, int wHint, int hHint, boolean changed)
Overrides org. |
| pack-priv Point | computeSizeInPixels(int wHint, int hHint, boolean changed)
Overrides org. |
| public void | |
| pack-priv void | |
| public void | |
| pack-priv GdkRGBA | |
| pack-priv void | |
| public void | deselect(int
the index of the item to deselect index)Deselects the item at the given zero-relative index in the receiver's list. |
| public void | |
| pack-priv boolean | dragDetect(int x, int y, boolean filter, boolean dragOnTimeout, boolean[] consume)
Overrides org. |
| pack-priv long | |
| pack-priv long | |
| pack-priv long | |
| pack-priv boolean | |
| pack-priv long | |
| pack-priv long | |
| pack-priv long | |
| pack-priv long | |
| pack-priv void | |
| pack-priv void | |
| pack-priv long | |
| pack-priv long | |
| public Point | Returns: a point, the location of the caretReturns a point describing the location of the caret relative to the receiver. |
| pack-priv Point | |
| public int | |
| pack-priv GdkRGBA | |
| pack-priv GdkRGBA | |
| public String | Returns: the item at the given indexthe index of the item to return index)Returns the item at the given, zero-relative index in the receiver's list. |
| public int | Returns: the number of itemsReturns the number of items contained in the receiver's list. |
| public int | Returns: the height of one itemReturns the height of the area which would be used to display one of the items in the receiver's list. |
| public String[] | Returns: the items in the receiver's listReturns a (possibly empty) array of |
| public boolean | Returns: the receiver's list's visibility stateReturns |
| pack-priv String | |
| public int | Returns: the orientation style |
| public Point | Returns: a point representing the selection start and endReturns a |
| public int | Returns: the index of the selected itemReturns the zero-relative index of the item which is currently selected in the receiver's list, or -1 if no item is selected. |
| public String | Returns: the receiver's textReturns a string containing a copy of the contents of the receiver's text field, or an empty string if there are no contents. |
| pack-priv String | |
| public int | |
| pack-priv int | |
| public int | Returns: the text limitReturns the maximum number of characters that the receiver's text field is capable of holding. |
| public int | Returns: the number of items that are visibleGets the number of items that are visible in the drop down portion of the receiver's list. |
| pack-priv long | |
| pack-priv long | gtk_button_press_event(long widget, long event)
Overrides org. |
| pack-priv long | |
| private void | |
| private void | |
| private void | |
| pack-priv long | |
| pack-priv long | gtk_delete_text(long widget, long start_pos, long end_pos)
|
| pack-priv long | |
| pack-priv long | gtk_event_after(long widget, long gdkEvent)
|
| pack-priv long | gtk_focus_out_event(long widget, long event)
Overrides org. |
| pack-priv long | gtk_insert_text(long widget, long new_text, long new_text_length, long position)
|
| pack-priv long | gtk_key_press_event(long widget, long event)
Overrides org. |
| pack-priv long | gtk_populate_popup(long widget, long menu)
Overrides org. |
| pack-priv long | |
| pack-priv long | |
| pack-priv boolean | |
| pack-priv void | |
| pack-priv void | |
| pack-priv long | |
| public int | |
| public int | |
| pack-priv boolean | |
| pack-priv long | |
| pack-priv long | |
| public void | |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| public void | remove(int
the index for the item index)Removes the item from the receiver's list at the given zero-relative index. |
| public void | remove(int
the start of the range start, int the end of the range end)Removes the items from the receiver's list which are between the given zero-relative start and end indices (inclusive). |
| public void | |
| public void | removeAll()
Removes all of the items from the receiver's list and clear the contents of receiver's text field. |
| public void | removeModifyListener(ModifyListener
the listener which should no longer be notified listener)Removes the listener from the collection of listeners who will be notified when the receiver's text is modified. |
| public void | removeSegmentListener(SegmentListener
the listener which should no longer be notified listener)Removes the listener from the collection of listeners who will be notified when the receiver's text is modified. |
| public void | removeSelectionListener(SelectionListener
the listener which should no longer be notified listener)Removes the listener from the collection of listeners who will be notified when the user changes the receiver's selection. |
| public void | removeVerifyListener(VerifyListener
the listener which should no longer be notified listener)Removes the listener from the collection of listeners who will be notified when the control is verified. |
| pack-priv Point | resizeCalculationsGTK3(long widget, int width, int height)
Overrides org. |
| public void | select(int
the index of the item to select index)Selects the item at the given zero-relative index in the receiver's list. |
| pack-priv void | setBackgroundGdkRGBA(long context, long handle, GdkRGBA rgba)
Overrides org. |
| pack-priv int | setBounds(int x, int y, int width, int height, boolean move, boolean resize)
Overrides org. |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | setForegroundGdkRGBA(long handle, GdkRGBA rgba)
Overrides org. |
| pack-priv void | |
| public void | |
| public void | |
| public void | setListVisible(boolean
the new visibility state visible)Marks the receiver's list as visible if the argument is |
| pack-priv void | |
| pack-priv void | |
| public void | setOrientation(int
new orientation style orientation)Overrides org. SWT.LEFT_TO_RIGHT or SWT.RIGHT_TO_LEFT.
|
| public void | setSelection(Point
a point representing the new selection start and end selection)Sets the selection in the receiver's text field to the range specified by the argument whose x coordinate is the start of the selection and whose y coordinate is the end of the selection. |
| public void | |
| public void | setTextLimit(int
new text limit limit)Sets the maximum number of characters that the receiver's text field is capable of holding to be the argument. |
| pack-priv void | setToolTipText(Shell shell, String newString)
|
| public void | setVisibleItemCount(int
the new number of items to be visible count)Sets the number of items that are visible in the drop down portion of the receiver's list. |
| pack-priv boolean | |
| pack-priv void | |
| pack-priv String |