Package org.fest.swing.driver
Class WindowDriver
java.lang.Object
org.fest.swing.driver.ComponentDriver
org.fest.swing.driver.ContainerDriver
org.fest.swing.driver.WindowDriver
- Direct Known Subclasses:
DialogDriver
,FrameDriver
Understands functional testing of
Window
s:
- user input simulation
- state verification
- property value query
org.fest.swing.fixture
in your tests.-
Field Summary
Fields inherited from class org.fest.swing.driver.ComponentDriver
robot
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Closing the
.Window
private static Point
private static void
private static void
void
Moves the
to the given location.Window
void
moveToBack
(Window w) If the given
is visible, sends it to the back and may cause it to lose focus or activation if it is the focused or active.Window
void
If the given
is visible, brings it to the front and may make it the focused one.Window
void
resizeHeightTo
(Window w, int height) Resizes the
vertically.Window
void
Resizes the
to the given size.Window
void
resizeWidthTo
(Window w, int width) Resizes the
horizontally.Window
void
Shows the
.Window
void
Shows the
, resized to the given size.Window
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
-
Constructor Details
-
WindowDriver
Creates a newWindowDriver
.- Parameters:
robot
- the robot to use to simulate user input.
-
-
Method Details
-
resizeWidthTo
Resizes the
horizontally.Window
- Parameters:
w
- the targetWindow
.width
- the width that theWindow
should have after being resized.- Throws:
ActionFailedException
- if theWindow
is not enabled.ActionFailedException
- if theWindow
is not resizable by the user.ActionFailedException
- if theWindow
is not showing on the screen.
-
resizeHeightTo
Resizes the
vertically.Window
- Parameters:
w
- the targetWindow
.height
- the height that theWindow
should have after being resized.- Throws:
ActionFailedException
- if theWindow
is not enabled.ActionFailedException
- if theWindow
is not resizable by the user.ActionFailedException
- if theWindow
is not showing on the screen.
-
resizeTo
Resizes the
to the given size.Window
- Parameters:
w
- the targetWindow
.size
- the size to resize theWindow
to.- Throws:
ActionFailedException
- if theWindow
is not enabled.ActionFailedException
- if theWindow
is not resizable by the user.ActionFailedException
- if theWindow
is not showing on the screen.
-
moveTo
Moves the
to the given location.Window
- Parameters:
w
- the targetWindow
.where
- the location to move theWindow
to.- Throws:
ActionFailedException
- if theWindow
is not enabled.ActionFailedException
- if theWindow
is not movable by the user.ActionFailedException
- if theWindow
is not showing on the screen.
-
close
Closing the
.Window
- Parameters:
w
- the targetWindow
.- Throws:
ActionFailedException
- if theWindow
is not enabled.ActionFailedException
- if theWindow
is not showing on the screen.
-
closeInfo
-
show
Shows the
.Window
- Parameters:
w
- the targetWindow
.
-
show
Shows the
, resized to the given size.Window
- Parameters:
w
- the targetWindow
.size
- the size to resize theWindow
to.
-
moveToFront
If the given
is visible, brings it to the front and may make it the focused one.Window
- Parameters:
w
- the targetWindow
.
-
doMoveToFront
-
moveToBack
If the given
is visible, sends it to the back and may cause it to lose focus or activation if it is the focused or active.Window
- Parameters:
w
- the targetWindow
.
-
doMoveToBack
-