Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Eclipse Platform Release 3.0
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.eclipse.swt.custom
Class CCombo

    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.swt.custom.CCombo

All Implemented Interfaces:
  Drawable

public final class CCombo
extends Composite

The CCombo class represents a selectable user interface object that combines a text field and a list and issues notificiation when an item is selected from the list.

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.

Styles:
  BORDER, READ_ONLY, FLAT
Events:
  Selection

Field Summary

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

Constructor Summary
`CCombo(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
`void` | `add(String string)` Adds an item.
`void` | `add(String string, int index)` Adds an item at an index.
`void` | `addModifyListener(ModifyListener listener)` Adds the listener to receive events.
`void` | `addSelectionListener(SelectionListener listener)` Adds the listener to receive events.
`void` | `clearSelection()` Clears the current selection.
`Point` | `computeSize(int wHint, int hHint, boolean changed)` Returns the preferred size of the receiver.
`void` | `deselect(int index)` Deselects an item.
`void` | `deselectAll()` Deselects all items.
`Control[]` | `getChildren()` Returns an array containing the receiver's children.
`boolean` | `getEditable()` Gets the editable state.
`String` | `getItem(int index)` Gets an item at an index.
`int` | `getItemCount()` Gets the number of items.
`int` | `getItemHeight()` Gets the height of one item.
`String[]` | `getItems()` Gets the items.
`Point` | `getSelection()` Gets the selection.
`int` | `getSelectionIndex()` Gets the index of the selected item.
`int` | `getStyle()` Returns the receiver's style information.
`String` | `getText()` Gets the widget text.
`int` | `getTextHeight()` Gets the height of the combo's text field.
`int` | `getTextLimit()` Gets the text limit.
`int` | `getVisibleItemCount()` Gets the number of items that are visible in the drop down portion of the receiver's list.
`int` | `indexOf(String string)` Gets the index of an item.
`int` | `indexOf(String string, int start)` Gets the index of an item.
`boolean` | `isFocusControl()` Returns `true` if the receiver has the user-interface focus, and `false` otherwise.
`void` | `redraw()` Causes the entire bounds of the receiver to be marked as needing to be redrawn.
`void` | `redraw(int x, int y, int width, int height, boolean all)` Causes the rectangular area of the receiver specified by the arguments to be marked as needing to be redrawn.
`void` | `remove(int index)` Removes an item at an index.
`void` | `remove(int start, int end)` Removes a range of items.
`void` | `remove(String string)` Removes an item.
`void` | `removeAll()` Removes all items.
`void` | `removeModifyListener(ModifyListener listener)` Removes the listener.
`void` | `removeSelectionListener(SelectionListener listener)` Removes the listener.
`void` | `select(int index)` Selects an item.
`void` | `setBackground(Color color)` Sets the receiver's background color to the color specified by the argument, or to the default system color for the control if the argument is null.
`void` | `setEditable(boolean editable)` Sets the editable state.
`void` | `setEnabled(boolean enabled)` Enables the receiver if the argument is `true`, and disables it otherwise.
`boolean` | `setFocus()` Causes the receiver to have the keyboard focus, such that all keyboard events will be delivered to it.
`void` | `setFont(Font font)` Sets the font that the receiver will use to paint textual information to the font specified by the argument, or to the default font for that kind of control if the argument is null.
`void` | `setForeground(Color color)` Sets the receiver's foreground color to the color specified by the argument, or to the default system color for the control if the argument is null.
`void` | `setItem(int index, String string)` Sets the text of an item; indexing is zero based.
`void` | `setItems(String[] items)` Sets all items.
`void` | `setSelection(Point selection)` Sets the new selection.
`void` | `setText(String string)` Sets the widget text.
`void` | `setTextLimit(int limit)` Sets the text limit.
`void` | `setToolTipText(String string)` Sets the receiver's tool tip text to the argument, which may be null indicating that no tool tip text should be shown.
`void` | `setVisible(boolean visible)` Marks the receiver as visible if the argument is `true`, and marks it invisible otherwise.
`void` | `setVisibleItemCount(int count)` Sets the number of items that are visible in the drop down portion of the receiver's list.

Methods inherited from class org.eclipse.swt.widgets.Composite
`checkSubclass, getLayout, getTabList, layout, layout, setLayout, setTabList`

Methods inherited from class org.eclipse.swt.widgets.Scrollable
`computeTrim, getClientArea, getHorizontalBar, getVerticalBar`

Methods inherited from class org.eclipse.swt.widgets.Control
`addControlListener, addFocusListener, addHelpListener, addKeyListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addPaintListener, addTraverseListener, computeSize, forceFocus, getAccessible, getBackground, getBorderWidth, getBounds, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getParent, getShell, getSize, getToolTipText, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, removeControlListener, removeFocusListener, removeHelpListener, removeKeyListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removePaintListener, removeTraverseListener, setBounds, setBounds, setCapture, setCursor, setLayoutData, setLocation, setLocation, setMenu, setParent, setRedraw, setSize, setSize, toControl, toControl, toDisplay, toDisplay, traverse, update`

Methods inherited from class org.eclipse.swt.widgets.Widget
`addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, setData, setData, toString`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### CCombo

    public CCombo(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 widget which will be the parent of the new instance (cannot be null)
  `style` - the style of widget to construct
Throws:
  `IllegalArgumentException` -
  - ERROR_NULL_ARGUMENT - if the parent is null
  `SWTException` -
  - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent
See Also:
  `SWT.BORDER`, `SWT.READ_ONLY`, `SWT.FLAT`, `Widget.getStyle()`

Method Detail

### add

    public void add(String string)

  Adds an item.

  The item is placed at the end of the list. Indexing is zero based.

  Parameters:
    `string` - the new item
  Throws:
    `SWTError(ERROR_THREAD_INVALID_ACCESS)` - when called from the wrong thread
    `SWTError(ERROR_WIDGET_DISPOSED)` - when the widget has been disposed
    `SWTError(ERROR_NULL_ARGUMENT)` - when the string is null
    `SWTError(ERROR_ITEM_NOT_ADDED)` - when the item cannot be added

### add

    public void add(String string,
                    int index)

  Adds an item at an index.

  The item is placed at an index in the list. Indexing is zero based. This operation will fail when the index is out of range.

  Parameters:
    `string` - the new item
    `index` - the index for the item
  Throws:
    `SWTError(ERROR_THREAD_INVALID_ACCESS)` - when called from the wrong thread
    `SWTError(ERROR_WIDGET_DISPOSED)` - when the widget has been disposed
    `SWTError(ERROR_NULL_ARGUMENT)` - when the string is null
    `SWTError(ERROR_ITEM_NOT_ADDED)` - when the item cannot be added

### addModifyListener

    public void addModifyListener(ModifyListener listener)

  Adds the listener to receive events.

  Parameters:
    `listener` - the listener
  Throws:
    `SWTError(ERROR_THREAD_INVALID_ACCESS)` - when called from the wrong thread
    `SWTError(ERROR_WIDGET_DISPOSED)` - when the widget has been disposed
    `SWTError(ERROR_NULL_ARGUMENT)` - when listener is null

### addSelectionListener

    public void addSelectionListener(SelectionListener listener)

  Adds the listener to receive events.

  Parameters:
    `listener` - the listener
  Throws:
    `SWTError(ERROR_THREAD_INVALID_ACCESS)` - when called from the wrong thread
    `SWTError(ERROR_WIDGET_DISPOSED)` - when the widget has been disposed
    `SWTError(ERROR_NULL_ARGUMENT)` - when listener is null

### clearSelection

    public void clearSelection()

  Clears the current selection.

  Throws:
    `SWTError(ERROR_THREAD_INVALID_ACCESS)` - when called from the wrong thread
    `SWTError(ERROR_WIDGET_DISPOSED)` - when the widget has been disposed

### computeSize

    public Point computeSize(int wHint,
                             int hHint,
                             boolean changed)

  Description copied from class: `Control`
  Returns the preferred size of the receiver.

  The preferred size of a control is the size that it would best be displayed at. The width hint and height hint arguments allow the caller to ask a control questions such as "Given a particular width, how high does the control need to be to show all of the contents?" To indicate that the caller does not wish to constrain a particular dimension, the constant `SWT.DEFAULT` is passed for the hint.

  If the changed flag is `true`, it indicates that the receiver's contents have changed, therefore any caches that a layout manager containing the control may have been keeping need to be flushed. When the control is resized, the changed flag will be `false`, so layout manager caches can be retained.

  Overrides:
    `computeSize` in class `Composite`

### deselect

    public void deselect(int index)

  Deselects an item.

  If the item at an index is selected, it is deselected. If the item at an index is not selected, it remains deselected. Indices that are out of range are ignored. Indexing is zero based.

  Parameters:
    `index` - the index of the item
  Throws:
    `SWTError(ERROR_THREAD_INVALID_ACCESS)` - when called from the wrong thread
    `SWTError(ERROR_WIDGET_DISPOSED)` - when the widget has been disposed

### deselectAll

    public void deselectAll()

  Deselects all items.

  If an item is selected, it is deselected. If an item is not selected, it remains unselected.

  Throws:
    `SWTError(ERROR_THREAD_INVALID_ACCESS)` - when called from the wrong thread
    `SWTError(ERROR_WIDGET_DISPOSED)` - when the widget has been disposed

### getChildren

    public Control[] getChildren()

  Description copied from class: `Composite`
  Returns an array containing the receiver's children.

  Note: This is not the actual structure used by the receiver to maintain its list of children, so modifying the array will not affect the receiver.

  Overrides:
    `getChildren` in class `Composite`
  Returns:
    an array of children

### getEditable

    public boolean getEditable()

  Gets the editable state.

  Returns:
    true if the contents can be edited
  Throws:
    `SWTException` -
    - ERROR_WIDGET_DISPOSED - if the receiver has been disposed
    - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
  Since:
    3.0

### getItem

    public String getItem(int index)

  Gets an item at an index.

  Indexing is zero based. This operation will fail when the index is out of range or an item could not be queried from the OS.

  Parameters:
    `index` - the index of the item
  Returns:
    the item
  Throws:
    `SWTError(ERROR_THREAD_INVALID_ACCESS)` - when called from the wrong thread
    `SWTError(ERROR_WIDGET_DISPOSED)` - when the widget has been disposed
    `SWTError(ERROR_CANNOT_GET_ITEM)` - when the operation fails

### getItemCount

    public int getItemCount()

  Gets the number of items.

  This operation will fail if the number of items could not be queried from the OS.

  Returns:
    the number of items in the widget
  Throws:
    `SWTError(ERROR_THREAD_INVALID_ACCESS)` - when called from the wrong thread
    `SWTError(ERROR_WIDGET_DISPOSED)` - when the widget has been disposed
    `SWTError(ERROR_CANNOT_GET_COUNT)` - when the operation fails

### getItemHeight

    public int getItemHeight()

  Gets the height of one item.

  This operation will fail if the height of one item could not be queried from the OS.

  Returns:
    the height of one item in the widget
  Throws:
    `SWTError(ERROR_THREAD_INVALID_ACCESS)` - when called from the wrong thread
    `SWTError(ERROR_WIDGET_DISPOSED)` - when the widget has been disposed
    `SWTError(ERROR_CANNOT_GET_ITEM_HEIGHT)` - when the operation fails

### getItems

    public String[] getItems()

  Gets the items.

  This operation will fail if the items cannot be queried from the OS.

  Returns:
    the items in the widget
  Throws:
    `SWTError(ERROR_THREAD_INVALID_ACCESS)` - when called from the wrong thread
    `SWTError(ERROR_WIDGET_DISPOSED)` - when the widget has been disposed
    `SWTError(ERROR_CANNOT_GET_ITEM)` - when the operation fails

### getSelection

    public Point getSelection()

  Gets the selection.

  Returns:
    a point representing the selection start and end
  Throws:
    `SWTError(ERROR_THREAD_INVALID_ACCESS)` - when called from the wrong thread
    `SWTError(ERROR_WIDGET_DISPOSED)` - when the widget has been disposed

### getSelectionIndex

    public int getSelectionIndex()

  Gets the index of the selected item.

  Indexing is zero based. If no item is selected -1 is returned.

  Returns:
    the index of the selected item.
  Throws:
    `SWTError(ERROR_THREAD_INVALID_ACCESS)` - when called from the wrong thread
    `SWTError(ERROR_WIDGET_DISPOSED)` - when the widget has been disposed

### getStyle

    public int getStyle()

  Description copied from class: `Widget`
  Returns the receiver's style information.

  Note that the value which is returned by this method may not match the value which was provided to the constructor when the receiver was created. This can occur when the underlying operating system does not support a particular combination of requested styles. For example, if the platform widget used to implement a particular SWT widget always has scroll bars, the result of calling this method would always have the `SWT.H_SCROLL` and `SWT.V_SCROLL` bits set.

  Overrides:
    `getStyle` in class `Widget`
  Returns:
    the style bits

### getText

    public String getText()

  Gets the widget text.

  If the widget has no text, an empty string is returned.

  Returns:
    the widget text
  Throws:
    `SWTError(ERROR_THREAD_INVALID_ACCESS)` - when called from the wrong thread
    `SWTError(ERROR_WIDGET_DISPOSED)` - when the widget has been disposed

### getTextHeight

    public int getTextHeight()

  Gets the height of the combo's text field.

  The operation will fail if the height cannot be queried from the OS.

  Returns:
    the height of the combo's text field.
  Throws:
    `SWTError(ERROR_THREAD_INVALID_ACCESS)` - when called from the wrong thread
    `SWTError(ERROR_WIDGET_DISPOSED)` - when the widget has been disposed
    `SWTError(ERROR_ERROR_CANNOT_GET_ITEM_HEIGHT)` - when the operation fails

### getTextLimit

    public int getTextLimit()

  Gets the text limit.

  Returns:
    the text limit
  Throws:
    `SWTError(ERROR_THREAD_INVALID_ACCESS)` - when called from the wrong thread
    `SWTError(ERROR_WIDGET_DISPOSED)` - when the widget has been disposed

### getVisibleItemCount

    public int getVisibleItemCount()

  Gets the number of items that are visible in the drop down portion of the receiver's list.

  Returns:
    the number of items that are visible
  Throws:
    `SWTException` -
    - ERROR_WIDGET_DISPOSED - if the receiver has been disposed
    - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
  Since:
    3.0

### indexOf

    public int indexOf(String string)

  Gets the index of an item.

  The list is searched starting at 0 until an item is found that is equal to the search item. If no item is found, -1 is returned. Indexing is zero based.

  Parameters:
    `string` - the search item
  Returns:
    the index of the item
  Throws:
    `SWTError(ERROR_THREAD_INVALID_ACCESS)` - when called from the wrong thread
    `SWTError(ERROR_WIDGET_DISPOSED)` - when the widget has been disposed
    `SWTError(ERROR_NULL_ARGUMENT)` - when string is null

### indexOf

    public int indexOf(String string,
                       int start)

  Gets the index of an item.

  The widget is searched starting at start including the end position until an item is found that is equal to the search itenm. If no item is found, -1 is returned. Indexing is zero based.

  Parameters:
    `string` - the search item
    `start` - the starting position
  Returns:
    the index of the item
  Throws:
    `SWTError(ERROR_THREAD_INVALID_ACCESS)` - when called from the wrong thread
    `SWTError(ERROR_WIDGET_DISPOSED)` - when the widget has been disposed
    `SWTError(ERROR_NULL_ARGUMENT)` - when string is null

### isFocusControl

    public boolean isFocusControl()

  Description copied from class: `Control`
  Returns `true` if the receiver has the user-interface focus, and `false` otherwise.

  Overrides:
    `isFocusControl` in class `Control`
  Returns:
    the receiver's focus state

### redraw

    public void redraw()

  Description copied from class: `Control`
  Causes the entire bounds of the receiver to be marked as needing to be redrawn. The next time a paint request is processed, the control will be completely painted, including the background.

  Overrides:
    `redraw` in class `Control`
  See Also:
    `Control.update()`, `PaintListener`, `SWT.Paint`, `SWT.NO_BACKGROUND`, `SWT.NO_REDRAW_RESIZE`, `SWT.NO_MERGE_PAINTS`

### redraw

    public void redraw(int x,
                       int y,
                       int width,
                       int height,
                       boolean all)

  Description copied from class: `Control`
  Causes the rectangular area of the receiver specified by the arguments to be marked as needing to be redrawn. The next time a paint request is processed, that area of the receiver will be painted, including the background. If the `all` flag is `true`, any children of the receiver which intersect with the specified area will also paint their intersecting areas. If the `all` flag is `false`, the children will not be painted.

  Overrides:
    `redraw` in class `Control`
  Parameters:
    `x` - the x coordinate of the area to draw
    `y` - the y coordinate of the area to draw
    `width` - the width of the area to draw
    `height` - the height of the area to draw
    `all` - `true` if children should redraw, and `false` otherwise
  See Also:
    `Control.update()`, `PaintListener`, `SWT.Paint`, `SWT.NO_BACKGROUND`, `SWT.NO_REDRAW_RESIZE`, `SWT.NO_MERGE_PAINTS`

### remove

    public void remove(int index)

  Removes an item at an index.

  Indexing is zero based. This operation will fail when the index is out of range or an item could not be removed from the OS.

  Parameters:
    `index` - the index of the item
  Throws:
    `SWTError(ERROR_THREAD_INVALID_ACCESS)` - when called from the wrong thread
    `SWTError(ERROR_WIDGET_DISPOSED)` - when the widget has been disposed
    `SWTError(ERROR_ITEM_NOT_REMOVED)` - when the operation fails

### remove

    public void remove(int start,
                       int end)

  Removes a range of items.

  Indexing is zero based. The range of items is from the start index up to and including the end index. This operation will fail when the index is out of range or an item could not be removed from the OS.

  Parameters:
    `start` - the start of the range
    `end` - the end of the range
  Throws:
    `SWTError(ERROR_THREAD_INVALID_ACCESS)` - when called from the wrong thread
    `SWTError(ERROR_WIDGET_DISPOSED)` - when the widget has been disposed
    `SWTError(ERROR_ITEM_NOT_REMOVED)` - when the operation fails

### remove

    public void remove(String string)

  Removes an item.

  This operation will fail when the item could not be removed from the OS.

  Parameters:
    `string` - the search item
  Throws:
    `SWTError(ERROR_THREAD_INVALID_ACCESS)` - when called from the wrong thread
    `SWTError(ERROR_WIDGET_DISPOSED)` - when the widget has been disposed
    `SWTError(ERROR_NULL_ARGUMENT)` - when string is null
    `SWTError(ERROR_ITEM_NOT_REMOVED)` - when the operation fails

### removeAll

    public void removeAll()

  Removes all items.

  Throws:
    `SWTError(ERROR_THREAD_INVALID_ACCESS)` - when called from the wrong thread
    `SWTError(ERROR_WIDGET_DISPOSED)` - when the widget has been disposed

### removeModifyListener

    public void removeModifyListener(ModifyListener listener)

  Removes the listener.

  Parameters:
    `listener` - the listener
  Throws:
    `SWTError(ERROR_THREAD_INVALID_ACCESS)` - when called from the wrong thread
    `SWTError(ERROR_WIDGET_DISPOSED)` - when the widget has been disposed
    `SWTError(ERROR_NULL_ARGUMENT)` - when listener is null

### removeSelectionListener

    public void removeSelectionListener(SelectionListener listener)

  Removes the listener.

  Parameters:
    `listener` - the listener
  Throws:
    `SWTError(ERROR_THREAD_INVALID_ACCESS)` - when called from the wrong thread
    `SWTError(ERROR_WIDGET_DISPOSED)` - when the widget has been disposed
    `SWTError(ERROR_NULL_ARGUMENT)` - when listener is null

### select

    public void select(int index)

  Selects an item.

  If the item at an index is not selected, it is selected. Indices that are out of range are ignored. Indexing is zero based.

  Parameters:
    `index` - the index of the item
  Throws:
    `SWTError(ERROR_THREAD_INVALID_ACCESS)` - when called from the wrong thread
    `SWTError(ERROR_WIDGET_DISPOSED)` - when the widget has been disposed

### setBackground

    public void setBackground(Color color)

  Description copied from class: `Control`
  Sets the receiver's background color to the color specified by the argument, or to the default system color for the control if the argument is null.

  Overrides:
    `setBackground` in class `Control`
  Parameters:
    `color` - the new color (or null)

### setEditable

    public void setEditable(boolean editable)

  Sets the editable state.

  Parameters:
    `editable` - the new editable state
  Throws:
    `SWTException` -
    - ERROR_WIDGET_DISPOSED - if the receiver has been disposed
    - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
  Since:
    3.0

### setEnabled

    public void setEnabled(boolean enabled)

  Description copied from class: `Control`
  Enables the receiver if the argument is `true`, and disables it otherwise. A disabled control is typically not selectable from the user interface and draws with an inactive or "grayed" look.

  Overrides:
    `setEnabled` in class `Control`
  Parameters:
    `enabled` - the new enabled state

### setFocus

    public boolean setFocus()

  Description copied from class: `Control`
  Causes the receiver to have the keyboard focus, such that all keyboard events will be delivered to it. Focus reassignment will respect applicable platform constraints.

  Overrides:
    `setFocus` in class `Composite`

### setFont

    public void setFont(Font font)

  Description copied from class: `Control`
  Sets the font that the receiver will use to paint textual information to the font specified by the argument, or to the default font for that kind of control if the argument is null.

  Overrides:
    `setFont` in class `Control`
  Parameters:
    `font` - the new font (or null)

### setForeground

    public void setForeground(Color color)

  Description copied from class: `Control`
  Sets the receiver's foreground color to the color specified by the argument, or to the default system color for the control if the argument is null.

  Overrides:
    `setForeground` in class `Control`
  Parameters:
    `color` - the new color (or null)

### setItem

    public void setItem(int index,
                        String string)

  Sets the text of an item; indexing is zero based. This operation will fail when the index is out of range or an item could not be changed in the OS.

  Parameters:
    `index` - the index for the item
    `string` - the item
  Throws:
    `SWTError(ERROR_THREAD_INVALID_ACCESS)` - when called from the wrong thread
    `SWTError(ERROR_WIDGET_DISPOSED)` - when the widget has been disposed
    `SWTError(ERROR_NULL_ARGUMENT)` - when items is null
    `SWTError(ERROR_ITEM_NOT_MODIFIED)` - when the operation fails

### setItems

    public void setItems(String[] items)

  Sets all items.

  Parameters:
    `items` - the array of items
  Throws:
    `SWTError(ERROR_THREAD_INVALID_ACCESS)` - when called from the wrong thread
    `SWTError(ERROR_WIDGET_DISPOSED)` - when the widget has been disposed
    `SWTError(ERROR_NULL_ARGUMENT)` - when items is null
    `SWTError(ERROR_ITEM_NOT_ADDED)` - when the operation fails

### setSelection

    public void setSelection(Point selection)

  Sets the new selection.

  Parameters:
    `selection` - point representing the start and the end of the new selection
  Throws:
    `SWTError(ERROR_THREAD_INVALID_ACCESS)` - when called from the wrong thread
    `SWTError(ERROR_WIDGET_DISPOSED)` - when the widget has been disposed
    `SWTError(ERROR_NULL_ARGUMENT)` - when selection is null

### setText

    public void setText(String string)

  Sets the widget text.

  Parameters:
    `string` - the widget text
  Throws:
    `SWTError(ERROR_THREAD_INVALID_ACCESS)` - when called from the wrong thread
    `SWTError(ERROR_WIDGET_DISPOSED)` - when the widget has been disposed
    `SWTError(ERROR_NULL_ARGUMENT)` - when string is null

### setTextLimit

    public void setTextLimit(int limit)

  Sets the text limit.

  Parameters:
    `limit` - new text limit
  Throws:
    `SWTError(ERROR_THREAD_INVALID_ACCESS)` - when called from the wrong thread
    `SWTError(ERROR_WIDGET_DISPOSED)` - when the widget has been disposed
    `SWTError(ERROR_CANNOT_BE_ZERO)` - when limit is 0

### setToolTipText

    public void setToolTipText(String string)

  Description copied from class: `Control`
  Sets the receiver's tool tip text to the argument, which may be null indicating that no tool tip text should be shown.

  Overrides:
    `setToolTipText` in class `Control`
  Parameters:
    `string` - the new tool tip text (or null)

### setVisible

    public void setVisible(boolean visible)

  Description copied from class: `Control`
  Marks the receiver as visible if the argument is `true`, and marks it invisible otherwise.

  If one of the receiver's ancestors is not visible or some other condition makes the receiver not visible, marking it visible may not actually cause it to be displayed.

  Overrides:
    `setVisible` in class `Control`
  Parameters:
    `visible` - the new visibility state

### setVisibleItemCount

    public void setVisibleItemCount(int count)

  Sets the number of items that are visible in the drop down portion of the receiver's list.

  Parameters:
    `count` - the new number of items to be visible
  Throws:
    `SWTException` -
    - ERROR_WIDGET_DISPOSED - if the receiver has been disposed
    - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
  Since:
    3.0

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Eclipse Platform Release 3.0
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2000, 2004. All rights reserved.