org.fest.swing.driver
Class JScrollBarDriver

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.JScrollBarDriver

public class JScrollBarDriver
extends JComponentDriver

Understands functional testing of JScrollBars:

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
JScrollBarDriver(Robot robot)
          Creates a new JScrollBarDriver.
 
Method Summary
 void requireValue(JScrollBar scrollBar, int value)
          Asserts that the value of the JScrollBar is equal to the given one.
 void scrollBlockDown(JScrollBar scrollBar)
          Scrolls down (or right) one block (usually a page).
 void scrollBlockDown(JScrollBar scrollBar, int times)
          Scrolls down (or right) one block (usually a page,) the given number of times.
 void scrollBlockUp(JScrollBar scrollBar)
          Scrolls up (or left) one block (usually a page).
 void scrollBlockUp(JScrollBar scrollBar, int times)
          Scrolls up (or left) one block (usually a page,) the given number of times.
 void scrollTo(JScrollBar scrollBar, int position)
          Scrolls to the given position.
 void scrollToMaximum(JScrollBar scrollBar)
          Scrolls to the maximum position of the given JScrollBar.
 void scrollToMinimum(JScrollBar scrollBar)
          Scrolls to the minimum position of the given JScrollBar.
 void scrollUnitDown(JScrollBar scrollBar)
          Scrolls down (or right) one unit (usually a line).
 void scrollUnitDown(JScrollBar scrollBar, int times)
          Scrolls down (or right) one unit (usually a line,) the given number of times.
 void scrollUnitUp(JScrollBar scrollBar)
          Scrolls up (or left) one unit (usually a line).
 void scrollUnitUp(JScrollBar scrollBar, int times)
          Scrolls up (or left) one unit (usually a line,) the given number of times.
 
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

JScrollBarDriver

public JScrollBarDriver(Robot robot)
Creates a new JScrollBarDriver.

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

scrollUnitUp

public void scrollUnitUp(JScrollBar scrollBar)
Scrolls up (or left) one unit (usually a line).

Parameters:
scrollBar - the target JScrollBar.

scrollUnitUp

public void scrollUnitUp(JScrollBar scrollBar,
                         int times)
Scrolls up (or left) one unit (usually a line,) the given number of times.

Parameters:
scrollBar - the target JScrollBar.
times - the number of times to scroll up one unit.
Throws:
IllegalArgumentException - if times is less than or equal to zero.
IllegalStateException - if the JScrollBar is disabled.
IllegalStateException - if the JScrollBar is not showing on the screen.

scrollUnitDown

public void scrollUnitDown(JScrollBar scrollBar)
Scrolls down (or right) one unit (usually a line).

Parameters:
scrollBar - the target JScrollBar.

scrollUnitDown

public void scrollUnitDown(JScrollBar scrollBar,
                           int times)
Scrolls down (or right) one unit (usually a line,) the given number of times.

Parameters:
scrollBar - the target JScrollBar.
times - the number of times to scroll down one unit.
Throws:
IllegalArgumentException - if times is less than or equal to zero.
IllegalStateException - if the JScrollBar is disabled.
IllegalStateException - if the JScrollBar is not showing on the screen.

scrollBlockUp

@RunsInEDT
public void scrollBlockUp(JScrollBar scrollBar)
Scrolls up (or left) one block (usually a page).

Parameters:
scrollBar - the target JScrollBar.

scrollBlockUp

@RunsInEDT
public void scrollBlockUp(JScrollBar scrollBar,
                                    int times)
Scrolls up (or left) one block (usually a page,) the given number of times.

Parameters:
scrollBar - the target JScrollBar.
times - the number of times to scroll up one block.
Throws:
IllegalArgumentException - if times is less than or equal to zero.
IllegalStateException - if the JScrollBar is disabled.
IllegalStateException - if the JScrollBar is not showing on the screen.

scrollBlockDown

@RunsInEDT
public void scrollBlockDown(JScrollBar scrollBar)
Scrolls down (or right) one block (usually a page).

Parameters:
scrollBar - the target JScrollBar.

scrollBlockDown

@RunsInEDT
public void scrollBlockDown(JScrollBar scrollBar,
                                      int times)
Scrolls down (or right) one block (usually a page,) the given number of times.

Parameters:
scrollBar - the target JScrollBar.
times - the number of times to scroll down one block.
Throws:
IllegalArgumentException - if times is less than or equal to zero.
IllegalStateException - if the JScrollBar is disabled.
IllegalStateException - if the JScrollBar is not showing on the screen.

scrollToMaximum

@RunsInEDT
public void scrollToMaximum(JScrollBar scrollBar)
Scrolls to the maximum position of the given JScrollBar.

Parameters:
scrollBar - the target JScrollBar.
Throws:
IllegalStateException - if the JScrollBar is disabled.
IllegalStateException - if the JScrollBar is not showing on the screen.

scrollToMinimum

@RunsInEDT
public void scrollToMinimum(JScrollBar scrollBar)
Scrolls to the minimum position of the given JScrollBar.

Parameters:
scrollBar - the target JScrollBar.
Throws:
IllegalStateException - if the JScrollBar is disabled.
IllegalStateException - if the JScrollBar is not showing on the screen.

scrollTo

@RunsInEDT
public void scrollTo(JScrollBar scrollBar,
                               int position)
Scrolls to the given position.

Parameters:
scrollBar - the target JScrollBar.
position - the position to scroll to.
Throws:
IllegalStateException - if the JScrollBar is disabled.
IllegalStateException - if the JScrollBar is not showing on the screen.
IllegalArgumentException - if the given position is not within the JScrollBar bounds.

requireValue

@RunsInEDT
public void requireValue(JScrollBar scrollBar,
                                   int value)
Asserts that the value of the JScrollBar is equal to the given one.

Parameters:
scrollBar - the target JScrollBar.
value - the expected value.
Throws:
AssertionError - if the value of the JScrollBar is not equal to the given one.


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