org.eclipse.swtbot.swt.finder.widgets
Class AbstractSWTBotControl<T extends Control>

java.lang.Object
  extended by org.eclipse.swtbot.swt.finder.widgets.AbstractSWTBot<T>
      extended by org.eclipse.swtbot.swt.finder.widgets.AbstractSWTBotControl<T>
Direct Known Subclasses:
SWTBotBrowser, SWTBotButton, SWTBotCCombo, SWTBotCheckBox, SWTBotCLabel, SWTBotCombo, SWTBotDateTime, SWTBotGefFigureCanvas, SWTBotHyperlink, SWTBotImageHyperlink, SWTBotLabel, SWTBotLink, SWTBotList, SWTBotRadio, SWTBotShell

public class AbstractSWTBotControl<T extends Control>
extends AbstractSWTBot<T>

Helper to find SWT Controls and perform operations on them.

Version:
$Id$
Author:
Joshua Gosse <jlgosse [at] ca [dot] ibm [dot] com>

Field Summary
 
Fields inherited from class org.eclipse.swtbot.swt.finder.widgets.AbstractSWTBot
description, display, log, widget
 
Constructor Summary
AbstractSWTBotControl(T w)
          Constructs a new instance with the given widget.
AbstractSWTBotControl(T w, SelfDescribing description)
          Constructs a new instance with the given widget.
 
Method Summary
protected  Rectangle absoluteLocation()
          Get the bounds of the Widget in relation to Display
protected  AbstractSWTBotControl<T> click(boolean post)
          Click on the center of the widget.
protected  AbstractSWTBotControl<T> moveMouseToWidget()
          Moves the cursor to the center of the widget
protected  AbstractSWTBotControl<T> rightClick(boolean post)
          Right click on the center of the widget.
 
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

AbstractSWTBotControl

public AbstractSWTBotControl(T w)
                      throws WidgetNotFoundException
Constructs a new instance with the given widget.

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

AbstractSWTBotControl

public AbstractSWTBotControl(T w,
                             SelfDescribing description)
                      throws WidgetNotFoundException
Constructs a new instance 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

absoluteLocation

protected Rectangle absoluteLocation()
Get the bounds of the Widget in relation to Display

Overrides:
absoluteLocation in class AbstractSWTBot<T extends Control>
Returns:
the bounds of the Widget in relation to Display

click

protected AbstractSWTBotControl<T> click(boolean post)
Click on the center of the widget.

Parameters:
post - Whether or not Display.post(org.eclipse.swt.widgets.Event) should be used
Returns:
itself.

rightClick

protected AbstractSWTBotControl<T> rightClick(boolean post)
Right click on the center of the widget.

Parameters:
post - Whether or not Display.post(org.eclipse.swt.widgets.Event) should be used
Returns:
itself

moveMouseToWidget

protected AbstractSWTBotControl<T> moveMouseToWidget()
Moves the cursor to the center of the widget

Returns:
itself