@InternalApi public class WindowDriver extends ContainerDriver
Supports functional testing of AWT or Swing Window
s.
Note: This class is intended for internal use only. Please use the classes in the package
org.assertj.swing.fixture
in your tests.
robot
Constructor and Description |
---|
WindowDriver(Robot robot)
Creates a new
WindowDriver . |
Modifier and Type | Method and Description |
---|---|
void |
close(Window w)
Closing the
Window . |
void |
moveTo(Window w,
Point where)
Moves the
Window to the given location. |
void |
moveToBack(Window w)
If the given
Window is visible, sends it to the back and may cause it to lose focus or activation if it is
the focused or active. |
void |
moveToFront(Window w)
If the given
Window is visible, brings it to the front and may make it the focused one. |
void |
resizeHeightTo(Window w,
int height)
Resizes the
Window vertically. |
void |
resizeTo(Window w,
Dimension size)
Resizes the
Window to the given size. |
void |
resizeWidthTo(Window w,
int width)
Resizes the
Window horizontally. |
void |
show(Window w)
Shows the
Window . |
void |
show(Window w,
Dimension size)
Shows the
Window , resized to the given size. |
doResizeHeight, doResizeWidth, isResizable, move, resize
backgroundOf, checkClickAllowed, checkInEdtEnabledAndShowing, checkInEdtShowing, click, click, click, click, click, doubleClick, drag, dragOver, drop, drop, focus, focusAndWaitForFocusGain, fontOf, foregroundOf, invokePopupMenu, invokePopupMenu, moveMouseIgnoringAnyError, moveMouseIgnoringAnyError, performAccessibleActionOf, pressAndReleaseKey, pressAndReleaseKey, pressAndReleaseKeys, pressKey, pressKeyWhileRunning, propertyName, releaseKey, requireDisabled, requireEnabled, requireEnabled, requireFocused, requireNotVisible, requireSize, requireVisible, rightClick, settings, waitForShowing
public WindowDriver(@Nonnull Robot robot)
WindowDriver
.robot
- the robot to use to simulate user input.@RunsInEDT public void resizeWidthTo(@Nonnull Window w, int width)
Window
horizontally.w
- the target Window
.width
- the width that the Window
should have after being resized.ActionFailedException
- if the Window
is not enabled.ActionFailedException
- if the Window
is not resizable by the user.ActionFailedException
- if the Window
is not showing on the screen.@RunsInEDT public void resizeHeightTo(@Nonnull Window w, int height)
Window
vertically.w
- the target Window
.height
- the height that the Window
should have after being resized.ActionFailedException
- if the Window
is not enabled.ActionFailedException
- if the Window
is not resizable by the user.ActionFailedException
- if the Window
is not showing on the screen.@RunsInEDT public void resizeTo(@Nonnull Window w, @Nonnull Dimension size)
Window
to the given size.w
- the target Window
.size
- the size to resize the Window
to.ActionFailedException
- if the Window
is not enabled.ActionFailedException
- if the Window
is not resizable by the user.ActionFailedException
- if the Window
is not showing on the screen.public void moveTo(@Nonnull Window w, @Nonnull Point where)
Window
to the given location.w
- the target Window
.where
- the location to move the Window
to.ActionFailedException
- if the Window
is not enabled.ActionFailedException
- if the Window
is not movable by the user.ActionFailedException
- if the Window
is not showing on the screen.@RunsInEDT public void close(@Nonnull Window w)
Window
.w
- the target Window
.ActionFailedException
- if the Window
is not enabled. Or if the
Window
is not showing on the screen.@RunsInEDT public void show(@Nonnull Window w)
Window
.w
- the target Window
.@RunsInEDT public void show(@Nonnull Window w, @Nonnull Dimension size)
Window
, resized to the given size.w
- the target Window
.size
- the size to resize the Window
to.@RunsInEDT public void moveToFront(@Nonnull Window w)
Window
is visible, brings it to the front and may make it the focused one.w
- the target Window
.@RunsInEDT public void moveToBack(@Nonnull Window w)
Window
is visible, sends it to the back and may cause it to lose focus or activation if it is
the focused or active.w
- the target Window
.Copyright © 2014–2019 AssertJ. All rights reserved.