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
JToolBars:
- 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 Containerprivate voidfloatInfo(JToolBar toolBar, JToolBarLocation location) private static booleanvoidDrags theto the given location, causing it to float.JToolBarbooleanisFloating(JToolBar toolBar) Indicates whether the givenis floating or not.JToolBarvoidMakes the givenfloat.JToolBarvoidCloses a floating, making it go back to its original container in its last known location.JToolBarvoidDrop theJToolBarto the requested constraint position.private static Pair<GenericRange<Point>,Container> unfloatInfo(JToolBar toolBar, String constraint, JToolBarLocation location) private static voidvalidateFloated(JToolBar toolBar) private static voidvalidateIsFloatable(JToolBar toolBar) private static voidvalidateIsNotFloating(JToolBar toolBar, String constraint) private static WindowwindowAncestorOf(JToolBar toolBar) Methods inherited from class org.fest.swing.driver.JComponentDriver
clientProperty, invokeAction, isVisible, isVisible, requireToolTip, requireToolTip, scrollToVisibleMethods inherited from class org.fest.swing.driver.ContainerDriver
move, resize, resizeHeight, resizeWidthMethods 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 givenis floating or not.JToolBar- Parameters:
toolBar- the targetJToolBar.- Returns:
trueif theJToolBaris floating,falseotherwise.
-
floating
-
makeFloat
Makes the givenfloat.JToolBar- Parameters:
toolBar- the targetJToolBar.- Throws:
IllegalStateException- if theJToolBaris disabled.IllegalStateException- if theJToolBaris not showing on the screen.IllegalStateException- if theJToolBaris not floatable.ActionFailedException- if theJToolBarcannot be dragged.
-
floatTo
Drags theto the given location, causing it to float.JToolBar- Parameters:
toolBar- the targetJToolBar.x- the horizontal coordinate of the location to drag theJToolBarto.y- the vertical coordinate of the location to drag theJToolBarto.- Throws:
IllegalStateException- if theJToolBaris disabled.IllegalStateException- if theJToolBaris not showing on the screen.IllegalStateException- if theJToolBaris not floatable.ActionFailedException- if theJToolBarcannot be dragged.
-
floatInfo
@RunsInEDT private static Pair<Point,Pair<Window, floatInfoPoint>> (JToolBar toolBar, JToolBarLocation location) -
validateIsFloatable
-
ancestorAndLocation
-
doFloat
-
validateFloated
-
unfloat
Drop theJToolBarto 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 theJToolBaris disabled.IllegalStateException- if theJToolBaris 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 theJToolBaris disabled.IllegalStateException- if theJToolBaris not showing on the screen.
-
windowAncestorOf
-