org.fest.swing.driver
Class JToolBarDriver

java.lang.Object
  extended by org.fest.swing.driver.ComponentDriver
      extended by org.fest.swing.driver.ContainerDriver
          extended by org.fest.swing.driver.JComponentDriver
              extended by org.fest.swing.driver.JToolBarDriver

public class JToolBarDriver
extends JComponentDriver

Understands functional testing of JToolBars:

This class is intended for internal use only. Please use the classes in the package org.fest.swing.fixture in your tests.

Author:
Yvonne Wang, Alex Ruiz

Field Summary
 
Fields inherited from class org.fest.swing.driver.ComponentDriver
robot
 
Constructor Summary
JToolBarDriver(Robot robot)
          Creates a new JToolBarDriver.
 
Method Summary
 void floatTo(JToolBar toolBar, int x, int y)
          Drags the JToolBar to the given location, causing it to float.
 boolean isFloating(JToolBar toolBar)
          Indicates whether the given JToolBar is floating or not.
 void makeFloat(JToolBar toolBar)
          Makes the given JToolBar float.
 void unfloat(JToolBar toolBar)
          Closes a floating JToolBar, making it go back to its original container in its last known location.
 void unfloat(JToolBar toolBar, String constraint)
          Drop the JToolBar to the requested constraint position.
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JToolBarDriver

public JToolBarDriver(Robot robot)
Creates a new JToolBarDriver.

Parameters:
robot - the robot to use to simulate user input.
Method Detail

isFloating

@RunsInEDT
public boolean isFloating(JToolBar toolBar)
Indicates whether the given JToolBar is floating or not.

Parameters:
toolBar - the target JToolBar.
Returns:
true if the JToolBar is floating, false otherwise.

makeFloat

public void makeFloat(JToolBar toolBar)
Makes the given JToolBar float.

Parameters:
toolBar - the target JToolBar.
Throws:
IllegalStateException - if the JToolBar is disabled.
IllegalStateException - if the JToolBar is not showing on the screen.
IllegalStateException - if the JToolBar is not floatable.
ActionFailedException - if the JToolBar cannot be dragged.

floatTo

@RunsInEDT
public void floatTo(JToolBar toolBar,
                              int x,
                              int y)
Drags the JToolBar to the given location, causing it to float.

Parameters:
toolBar - the target JToolBar.
x - the horizontal coordinate of the location to drag the JToolBar to.
y - the vertical coordinate of the location to drag the JToolBar to.
Throws:
IllegalStateException - if the JToolBar is disabled.
IllegalStateException - if the JToolBar is not showing on the screen.
IllegalStateException - if the JToolBar is not floatable.
ActionFailedException - if the JToolBar cannot be dragged.

unfloat

@RunsInEDT
public void unfloat(JToolBar toolBar,
                              String constraint)
Drop the JToolBar to the requested constraint position. The constraint position must be one of the constants NORTH, EAST, SOUTH, or WEST.

Parameters:
toolBar - the target JToolBar.
constraint - the constraint position.
Throws:
IllegalStateException - if the JToolBar is disabled.
IllegalStateException - if the JToolBar is not showing on the screen.
IllegalArgumentException - if the constraint has an invalid value.
ActionFailedException - if the dock container cannot be found.

unfloat

@RunsInEDT
public void unfloat(JToolBar toolBar)
Closes a floating JToolBar, making it go back to its original container in its last known location.

Parameters:
toolBar - the target JToolBar.
Throws:
IllegalStateException - if the JToolBar is disabled.
IllegalStateException - if the JToolBar is not showing on the screen.


Copyright © 2007-2011 FEST (Fixtures for Easy Software Testing). All Rights Reserved.