Package org.fest.swing.driver
Class JInternalFrameDriver
java.lang.Object
org.fest.swing.driver.ComponentDriver
org.fest.swing.driver.ContainerDriver
org.fest.swing.driver.JComponentDriver
org.fest.swing.driver.JInternalFrameDriver
Understands functional testing of
JInternalFrame
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
close
(JInternalFrame internalFrame) Closes the given
.JInternalFrame
closeInfo
(JInternalFrame internalFrame) void
deiconify
(JInternalFrame internalFrame) De-iconifies the given
.JInternalFrame
deiconifyInfo
(JInternalFrame internalFrame) (package private) void
failIfVetoed
(JInternalFrame internalFrame, JInternalFrameAction action, UnexpectedException unexpected) private static Point
findIconifyLocation
(JInternalFrame internalFrame) findMaximizeLocation
(JInternalFrame internalFrame) void
iconify
(JInternalFrame internalFrame) Iconifies the given
.JInternalFrame
iconifyInfo
(JInternalFrame internalFrame) void
maximize
(JInternalFrame internalFrame) Maximizes the given
, deconifying it first if it is iconified.JInternalFrame
private void
maximizeOrNormalize
(JInternalFrame internalFrame, JInternalFrameAction action, Pair<Container, Point> toMoveMouseTo) void
moveTo
(JInternalFrame internalFrame, Point where) Moves the
to the given location.JInternalFrame
void
moveToBack
(JInternalFrame internalFrame) Brings the given
to the back.JInternalFrame
void
moveToFront
(JInternalFrame internalFrame) Brings the given
to the front.JInternalFrame
void
normalize
(JInternalFrame internalFrame) Normalizes the given
, deconifying it first if it is iconified.JInternalFrame
void
resizeHeightTo
(JInternalFrame w, int height) Resizes the
vertically.JInternalFrame
void
resizeTo
(JInternalFrame internalFrame, Dimension size) Resizes the
to the given size.JInternalFrame
void
resizeWidthTo
(JInternalFrame internalFrame, int width) Resizes the
horizontally.JInternalFrame
private void
setIconProperty
(JInternalFrame internalFrame, JInternalFrameAction action) private void
setMaximumProperty
(JInternalFrame internalFrame, JInternalFrameAction action) private static void
toBack
(JInternalFrame internalFrame) private static void
toFront
(JInternalFrame internalFrame) validateAndFindCloseInfo
(JInternalFrame internalFrame) validateAndfindDeiconifyInfo
(JInternalFrame internalFrame) validateAndfindIconifyInfo
(JInternalFrame internalFrame) validateAndFindMaximizeLocation
(JInternalFrame internalFrame) validateAndFindNormalizeLocation
(JInternalFrame internalFrame) private static void
validateCanClose
(JInternalFrame internalFrame) private static void
validateCanMaximize
(JInternalFrame internalFrame) private static void
validateIsShowingOrIconified
(JInternalFrame internalFrame) private PropertyVetoException
vetoFrom
(UnexpectedException unexpected) Methods inherited from class org.fest.swing.driver.JComponentDriver
clientProperty, invokeAction, isVisible, isVisible, requireToolTip, requireToolTip, scrollToVisible
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
-
JInternalFrameDriver
Creates a newJInternalFrameDriver
.- Parameters:
robot
- the robot to use to simulate user input.
-
-
Method Details
-
moveToFront
Brings the given
to the front.JInternalFrame
- Parameters:
internalFrame
- the targetJInternalFrame
.
-
toFront
-
moveToBack
Brings the given
to the back.JInternalFrame
- Parameters:
internalFrame
- the targetJInternalFrame
.
-
toBack
-
maximize
Maximizes the given
, deconifying it first if it is iconified.JInternalFrame
- Parameters:
internalFrame
- the targetJInternalFrame
.- Throws:
IllegalStateException
- if theJInternalFrame
is not maximizable.IllegalStateException
- if theJInternalFrame
is not showing on the screen.ActionFailedException
- if theJInternalFrame
vetoes the action.
-
validateAndFindMaximizeLocation
@RunsInEDT private static Pair<Container,Point> validateAndFindMaximizeLocation(JInternalFrame internalFrame) -
validateCanMaximize
-
normalize
Normalizes the given
, deconifying it first if it is iconified.JInternalFrame
- Parameters:
internalFrame
- the targetJInternalFrame
.- Throws:
IllegalStateException
- if theJInternalFrame
is not showing on the screen.ActionFailedException
- if theJInternalFrame
vetoes the action.
-
validateAndFindNormalizeLocation
@RunsInEDT private static Pair<Container,Point> validateAndFindNormalizeLocation(JInternalFrame internalFrame) -
validateIsShowingOrIconified
-
findMaximizeLocation
@RunsInCurrentThread private static Pair<Container,Point> findMaximizeLocation(JInternalFrame internalFrame) -
maximizeOrNormalize
@RunsInEDT private void maximizeOrNormalize(JInternalFrame internalFrame, JInternalFrameAction action, Pair<Container, Point> toMoveMouseTo) -
setMaximumProperty
@RunsInEDT private void setMaximumProperty(JInternalFrame internalFrame, JInternalFrameAction action) -
iconify
Iconifies the given
.JInternalFrame
- Parameters:
internalFrame
- the targetJInternalFrame
.- Throws:
IllegalStateException
- if theJInternalFrame
is not showing on the screen.IllegalStateException
- if theJInternalFrame
is not iconifiable.ActionFailedException
- if theJInternalFrame
vetoes the action.
-
validateAndfindIconifyInfo
@RunsInEDT private static Pair<Boolean,Point> validateAndfindIconifyInfo(JInternalFrame internalFrame) -
iconifyInfo
-
deiconify
De-iconifies the given
.JInternalFrame
- Parameters:
internalFrame
- the targetJInternalFrame
.- Throws:
IllegalStateException
- if theJInternalFrame
is not showing on the screen.ActionFailedException
- if theJInternalFrame
vetoes the action.
-
validateAndfindDeiconifyInfo
@RunsInEDT private static Triple<Boolean,Container, validateAndfindDeiconifyInfoPoint> (JInternalFrame internalFrame) -
deiconifyInfo
@RunsInCurrentThread private static Triple<Boolean,Container, deiconifyInfoPoint> (JInternalFrame internalFrame) -
findIconifyLocation
-
setIconProperty
-
failIfVetoed
void failIfVetoed(JInternalFrame internalFrame, JInternalFrameAction action, UnexpectedException unexpected) -
vetoFrom
-
resizeWidthTo
Resizes the
horizontally.JInternalFrame
- Parameters:
internalFrame
- the targetJInternalFrame
.width
- the width that theJInternalFrame
should have after being resized.- Throws:
IllegalStateException
- if theJInternalFrame
is not showing on the screen.IllegalStateException
- if theJInternalFrame
is not resizable by the user.
-
resizeHeightTo
Resizes the
vertically.JInternalFrame
- Parameters:
w
- the targetJInternalFrame
.height
- the height that theJInternalFrame
should have after being resized.- Throws:
IllegalStateException
- if theJInternalFrame
is not showing on the screen.IllegalStateException
- if theJInternalFrame
is not resizable by the user.
-
resizeTo
Resizes the
to the given size.JInternalFrame
- Parameters:
internalFrame
- the targetJInternalFrame
.size
- the size to resize theJInternalFrame
to.- Throws:
IllegalStateException
- if theJInternalFrame
is not showing on the screen.IllegalStateException
- if theJInternalFrame
is not resizable by the user.
-
moveTo
Moves the
to the given location.JInternalFrame
- Parameters:
internalFrame
- the targetJInternalFrame
.where
- the location to move theJInternalFrame
to.- Throws:
IllegalStateException
- if theJInternalFrame
is not showing on the screen.
-
close
Closes the given
.JInternalFrame
- Parameters:
internalFrame
- the targetJInternalFrame
.- Throws:
IllegalStateException
- if theJInternalFrame
is not showing on the screen.IllegalStateException
- if theJInternalFrame
is not closable.
-
validateAndFindCloseInfo
@RunsInEDT private static Pair<Boolean,Point> validateAndFindCloseInfo(JInternalFrame internalFrame) -
validateCanClose
-
closeInfo
-