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

java.lang.Object
  extended by org.eclipse.swtbot.swt.finder.widgets.AbstractSWTBot<Button>
      extended by org.eclipse.swtbot.swt.finder.widgets.SWTBotToggleButton

public class SWTBotToggleButton
extends AbstractSWTBot<Button>

Represents a toggle button Button of type SWT.TOGGLE.

Version:
$Id$
Author:
Ketan Padegaonkar <KetanPadegaonkar [at] gmail [dot] com>
See Also:
SWTBotButton, SWTBotRadio, SWTBotCheckBox

Field Summary
 
Fields inherited from class org.eclipse.swtbot.swt.finder.widgets.AbstractSWTBot
description, display, log, widget
 
Constructor Summary
SWTBotToggleButton(Button w)
          Constructs an instance of this object with the given button (Toggle)
SWTBotToggleButton(Button w, SelfDescribing description)
          Constructs an instance of this object with the given button (Toggle)
 
Method Summary
 SWTBotToggleButton click()
          Click on the toggle button, toggle it.
 boolean isPressed()
          Gets if the toggle button is pressed.
protected  void notifyListeners()
          Notify listeners about toggle button state change.
 void press()
          Select the toggle button.
protected  void toggle()
          Toggle the toggle button.
 void unpress()
          Un-press the toggle button.
 
Methods inherited from class org.eclipse.swtbot.swt.finder.widgets.AbstractSWTBot
absoluteLocation, assertEnabled, asyncExec, backgroundColor, 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

SWTBotToggleButton

public SWTBotToggleButton(Button w)
                   throws WidgetNotFoundException
Constructs an instance of this object with the given button (Toggle)

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

SWTBotToggleButton

public SWTBotToggleButton(Button w,
                          SelfDescribing description)
                   throws WidgetNotFoundException
Constructs an instance of this object with the given button (Toggle)

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.
Since:
1.0
Method Detail

click

public SWTBotToggleButton click()
Click on the toggle button, toggle it.

Overrides:
click in class AbstractSWTBot<Button>
Returns:
itself.

unpress

public void unpress()
Un-press the toggle button.


press

public void press()
Select the toggle button.


toggle

protected void toggle()
Toggle the toggle button.


notifyListeners

protected void notifyListeners()
Notify listeners about toggle button state change.


isPressed

public boolean isPressed()
Gets if the toggle button is pressed.

Returns:
true if the toggle button is pressed. Otherwise false.