Package org.fest.swing.driver
Class JToolBarDriver
java.lang.Object
org.fest.swing.driver.ComponentDriver
org.fest.swing.driver.ContainerDriver
org.fest.swing.driver.JComponentDriver
org.fest.swing.driver.JToolBarDriver
Understands functional testing of
JToolBar
s:
- user input simulation
- state verification
- property value query
org.fest.swing.fixture
in your tests.-
Field Summary
FieldsFields inherited from class org.fest.swing.driver.ComponentDriver
robot
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionancestorAndLocation
(JToolBar toolBar) private static Container
private void
floatInfo
(JToolBar toolBar, JToolBarLocation location) private static boolean
void
Drags the
to the given location, causing it to float.JToolBar
boolean
isFloating
(JToolBar toolBar) Indicates whether the given
is floating or not.JToolBar
void
Makes the given
float.JToolBar
void
Closes a floating
, making it go back to its original container in its last known location.JToolBar
void
Drop theJToolBar
to the requested constraint position.private static Pair<GenericRange<Point>,
Container> unfloatInfo
(JToolBar toolBar, String constraint, JToolBarLocation location) private static void
validateFloated
(JToolBar toolBar) private static void
validateIsFloatable
(JToolBar toolBar) private static void
validateIsNotFloating
(JToolBar toolBar, String constraint) private static Window
windowAncestorOf
(JToolBar toolBar) 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
-
Field Details
-
location
-
-
Constructor Details
-
JToolBarDriver
Creates a newJToolBarDriver
.- Parameters:
robot
- the robot to use to simulate user input.
-
-
Method Details
-
isFloating
Indicates whether the given
is floating or not.JToolBar
- Parameters:
toolBar
- the targetJToolBar
.- Returns:
true
if theJToolBar
is floating,false
otherwise.
-
floating
-
makeFloat
Makes the given
float.JToolBar
- Parameters:
toolBar
- the targetJToolBar
.- Throws:
IllegalStateException
- if theJToolBar
is disabled.IllegalStateException
- if theJToolBar
is not showing on the screen.IllegalStateException
- if theJToolBar
is not floatable.ActionFailedException
- if theJToolBar
cannot be dragged.
-
floatTo
Drags the
to the given location, causing it to float.JToolBar
- Parameters:
toolBar
- the targetJToolBar
.x
- the horizontal coordinate of the location to drag theJToolBar
to.y
- the vertical coordinate of the location to drag theJToolBar
to.- Throws:
IllegalStateException
- if theJToolBar
is disabled.IllegalStateException
- if theJToolBar
is not showing on the screen.IllegalStateException
- if theJToolBar
is not floatable.ActionFailedException
- if theJToolBar
cannot be dragged.
-
floatInfo
@RunsInEDT private static Pair<Point,Pair<Window, floatInfoPoint>> (JToolBar toolBar, JToolBarLocation location) -
validateIsFloatable
-
ancestorAndLocation
-
doFloat
-
validateFloated
-
unfloat
Drop theJToolBar
to the requested constraint position. The constraint position must be one of the constants
,NORTH
,EAST
, orSOUTH
.WEST
- Parameters:
toolBar
- the targetJToolBar
.constraint
- the constraint position.- Throws:
IllegalStateException
- if theJToolBar
is disabled.IllegalStateException
- if theJToolBar
is not showing on the screen.IllegalArgumentException
- if the constraint has an invalid value.ActionFailedException
- if the dock container cannot be found.
-
unfloatInfo
@RunsInEDT private static Pair<GenericRange<Point>,Container> unfloatInfo(JToolBar toolBar, String constraint, JToolBarLocation location) -
validateIsNotFloating
-
dockFor
-
unfloat
Closes a floating
, making it go back to its original container in its last known location.JToolBar
- Parameters:
toolBar
- the targetJToolBar
.- Throws:
IllegalStateException
- if theJToolBar
is disabled.IllegalStateException
- if theJToolBar
is not showing on the screen.
-
windowAncestorOf
-