public class JComponentDriver extends ContainerDriver
JComponent
s:
org.fest.swing.fixture
in your tests.robot
Constructor and Description |
---|
JComponentDriver(Robot robot)
Creates a new
JComponentDriver . |
Modifier and Type | Method and Description |
---|---|
Object |
clientProperty(JComponent c,
Object key)
Returns the client property stored in the given
, under the given key. |
protected void |
invokeAction(JComponent c,
String name)
|
protected boolean |
isVisible(JComponent c,
Point p)
|
protected static boolean |
isVisible(JComponent c,
Rectangle r)
Indicates whether the given
's visible contains the
given one. |
void |
requireToolTip(JComponent c,
Pattern pattern)
Asserts that the toolTip in the given
matches the given regular expression pattern. |
void |
requireToolTip(JComponent c,
String expected)
Asserts that the toolTip in the given
matches the given value. |
protected void |
scrollToVisible(JComponent c,
Rectangle r)
Invoke
on the given . |
move, resize, resizeHeight, resizeWidth
assertIsEnabledAndShowing, click, click, click, click, click, doubleClick, drag, dragOver, drop, focus, focusAndWaitForFocusGain, invokePopupMenu, invokePopupMenu, moveMouseIgnoringAnyError, moveMouseIgnoringAnyError, performAccessibleActionOf, pressAndReleaseKey, pressAndReleaseKey, pressAndReleaseKeys, pressKey, propertyName, releaseKey, requireDisabled, requireEnabled, requireEnabled, requireFocused, requireNotVisible, requireSize, requireVisible, rightClick, settings, waitForShowing
public JComponentDriver(Robot robot)
JComponentDriver
.robot
- the robot the robot to use to simulate user input.@RunsInCurrentThread protected final void scrollToVisible(JComponent c, Rectangle r)
JComponent.scrollRectToVisible(Rectangle)
on the given JComponent
.
Note: This method is not guaranteed to be executed in the event dispatch thread (EDT.) Clients are responsible for calling this method from the EDT.
c
- the given JComponent
.r
- the visible Rectangle
.@RunsInCurrentThread protected static boolean isVisible(JComponent c, Rectangle r)
JComponent
's visible Rectangle
contains the
given one.
Note: This method is not guaranteed to be executed in the event dispatch thread (EDT.) Clients are responsible for calling this method from the EDT.
c
- the given JComponent
.r
- the Rectangle
to verify.true
if the given Rectangle
is contained in the given JComponent
's
visible Rectangle
.@RunsInCurrentThread protected final boolean isVisible(JComponent c, Point p)
JComponent
's visible Rectangle
contains
the given Point
.
Note: This method is not guaranteed to be executed in the event dispatch thread (EDT.) Clients are responsible for calling this method from the EDT.
c
- the given JComponent
.p
- the Point
to verify.true
if the given Point
is contained in the given JComponent
's
visible Rectangle
.@RunsInEDT protected final void invokeAction(JComponent c, String name)
c
- the given JComponent
.name
- the name of the Action
to invoke.ActionFailedException
- if an Action
cannot be found under the given name.ActionFailedException
- if a KeyStroke
cannot be found for the Action
under the
given name.ActionFailedException
- if it is not possible to type any of the found KeyStroke
s.@RunsInEDT public void requireToolTip(JComponent c, String expected)
JComponent
matches the given value.c
- the given JComponent
.expected
- the expected toolTip. It can be a regular expression.AssertionError
- if the toolTip of the given JComponent
does not match the given value.@RunsInEDT public void requireToolTip(JComponent c, Pattern pattern)
JComponent
matches the given regular expression pattern.c
- the given JComponent
.pattern
- the regular expression pattern to match.NullPointerException
- if the given regular expression pattern is null
.AssertionError
- if the toolTip of the given JComponent
does not match the given value.@RunsInEDT public Object clientProperty(JComponent c, Object key)
JComponent
, under the given key.c
- the given JComponent
.key
- the key to use to retrieve the client property.null
if the property was
not found.NullPointerException
- if the given key is null
.Copyright © 2007-2012 FEST (Fixtures for Easy Software Testing). All Rights Reserved.