org.eclipse.swtbot.swt.finder.widgets
Class SWTBotCCombo

java.lang.Object
  extended by org.eclipse.swtbot.swt.finder.widgets.AbstractSWTBot<T>
      extended by org.eclipse.swtbot.swt.finder.widgets.AbstractSWTBotControl<CCombo>
          extended by org.eclipse.swtbot.swt.finder.widgets.SWTBotCCombo

public class SWTBotCCombo
extends AbstractSWTBotControl<CCombo>

This represents a CCombo widget.

Since:
1.0
Version:
$Id$
Author:
Cedric Chabanois <cchabanois [at] no-log [dot] org>

Field Summary
 
Fields inherited from class org.eclipse.swtbot.swt.finder.widgets.AbstractSWTBot
description, display, log, widget
 
Constructor Summary
SWTBotCCombo(CCombo w)
          Constructs an instance of this with the given widget.
SWTBotCCombo(CCombo w, SelfDescribing description)
          Constructs an instance of this with the given widget.
 
Method Summary
 int itemCount()
          Gets the number of items in the combo box.
 String[] items()
          Returns an array of Strings which are the items in the receiver's list.
 String selection()
          Gets the current selection in the combo.
 int selectionIndex()
          Gets the current selection index.
 void setSelection(int index)
          Sets the selection to the specified index.
 void setSelection(String text)
          Set the selection to the specified text.
 void setText(String text)
          Sets the text in the cCombo box.
 int textLimit()
          Returns the maximum number of characters that the receiver's text field is capable of holding.
 
Methods inherited from class org.eclipse.swtbot.swt.finder.widgets.AbstractSWTBotControl
absoluteLocation, click, moveMouseToWidget, rightClick
 
Methods inherited from class org.eclipse.swtbot.swt.finder.widgets.AbstractSWTBot
assertEnabled, asyncExec, backgroundColor, click, click, clickXY, contextMenu, contextMenu, createEvent, createMouseEvent, createSelectionEvent, doubleClickXY, foregroundColor, getId, getText, getToolTipText, hasStyle, isActive, isEnabled, isEnabledInternal, isVisible, keyboard, notify, notify, notify, pressShortcut, pressShortcut, pressShortcut, rightClick, rightClick, setFocus, sleep, syncExec, syncExec, syncExec, syncExec, syncExec, syncExec, syncExec, syncExec, toString, traverse, waitForEnabled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SWTBotCCombo

public SWTBotCCombo(CCombo w)
             throws WidgetNotFoundException
Constructs an instance of this with the given widget.

Parameters:
w - the widget.
Throws:
WidgetNotFoundException - if the widget is null or widget has been disposed.

SWTBotCCombo

public SWTBotCCombo(CCombo w,
                    SelfDescribing description)
             throws WidgetNotFoundException
Constructs an instance of this with the given widget.

Parameters:
w - the widget.
description - the description of the widget, this will be reported by AbstractSWTBot.toString()
Throws:
WidgetNotFoundException - if the widget is null or widget has been disposed.
Method Detail

setText

public void setText(String text)
Sets the text in the cCombo box.

Parameters:
text - the text to set.

textLimit

public int textLimit()
Returns the maximum number of characters that the receiver's text field is capable of holding. If this has not been changed by setTextLimit(), it will be the constant Combo.LIMIT.

Returns:
the text limit

setSelection

public void setSelection(String text)
Set the selection to the specified text.

Parameters:
text - the text to set into the combo.

selection

public String selection()
Gets the current selection in the combo.

Returns:
the current selection in the combo box or null if no item is selected.

selectionIndex

public int selectionIndex()
Gets the current selection index.

Returns:
the zero based index of the current selection.

setSelection

public void setSelection(int index)
Sets the selection to the specified index.

Parameters:
index - the zero based index.

itemCount

public int itemCount()
Gets the number of items in the combo box.

Returns:
the number of items in the combo box.

items

public String[] items()
Returns an array of Strings which are the items in the receiver's list.

Returns:
the items in the receiver's list