|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.fest.swing.driver.ComponentDriver
org.fest.swing.driver.ContainerDriver
org.fest.swing.driver.JComponentDriver
public class JComponentDriver
Understands functional testing of
s:
JComponent
org.fest.swing.fixture
in your tests.
Field Summary |
---|
Fields inherited from class org.fest.swing.driver.ComponentDriver |
---|
robot |
Constructor Summary | |
---|---|
JComponentDriver(Robot robot)
Creates a new JComponentDriver . |
Method Summary | |
---|---|
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)
Invoke an from the 's
. |
protected boolean |
isVisible(JComponent c,
Point p)
Indicates whether the given 's visible contains
the given . |
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 . |
Methods inherited from class org.fest.swing.driver.ContainerDriver |
---|
move, resize, resizeHeight, resizeWidth |
Methods inherited from class org.fest.swing.driver.ComponentDriver |
---|
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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JComponentDriver(Robot robot)
JComponentDriver
.
robot
- the robot the robot to use to simulate user input.Method Detail |
---|
@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)
Action
from the JComponent
's
ActionMap
.
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
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |