org.fest.swing.driver
Class JTableHeaderDriver

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

public class JTableHeaderDriver
extends JComponentDriver

Understands functional testing of JTableHeaders:

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
JTableHeaderDriver(Robot robot)
          Creates a new JTableHeaderDriver.
 
Method Summary
 void clickColumn(JTableHeader tableHeader, int columnIndex)
          Clicks the column under the given index.
 void clickColumn(JTableHeader tableHeader, int columnIndex, MouseButton button, int times)
          Clicks the column under the given index using the given mouse button the given number of times.
 void clickColumn(JTableHeader tableHeader, Pattern columnNamePattern)
          Clicks the column which name matches the given regular expression pattern.
 void clickColumn(JTableHeader tableHeader, Pattern columnNamePattern, MouseButton button, int times)
          Clicks the column which name matches the given regular expression pattern using the given mouse button the given number of times.
 void clickColumn(JTableHeader tableHeader, String columnName)
          Clicks the column which name matches the given value.
 void clickColumn(JTableHeader tableHeader, String columnName, MouseButton button, int times)
          Clicks the column which name matches the given one using the given mouse button the given number of times.
 JPopupMenu showPopupMenu(JTableHeader tableHeader, int columnIndex)
          Shows a pop-up menu at the given column.
 JPopupMenu showPopupMenu(JTableHeader tableHeader, Pattern pattern)
          Shows a pop-up menu at the column whose name matches the given regular expression pattern.
 JPopupMenu showPopupMenu(JTableHeader tableHeader, String columnName)
          Shows a pop-up menu at the given column.
 
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

JTableHeaderDriver

public JTableHeaderDriver(Robot robot)
Creates a new JTableHeaderDriver.

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

clickColumn

@RunsInEDT
public void clickColumn(JTableHeader tableHeader,
                                  int columnIndex)
Clicks the column under the given index.

Parameters:
tableHeader - the target JTableHeader.
columnIndex - the given index.
Throws:
IllegalStateException - if the JTableHeader is disabled.
IllegalStateException - if the JTableHeader is not showing on the screen.
IndexOutOfBoundsException - if the index is out of bounds.

clickColumn

@RunsInEDT
public void clickColumn(JTableHeader tableHeader,
                                  int columnIndex,
                                  MouseButton button,
                                  int times)
Clicks the column under the given index using the given mouse button the given number of times.

Parameters:
tableHeader - the target JTableHeader.
columnIndex - the given index.
button - the mouse button to use.
times - the number of times to click.
Throws:
IllegalStateException - if the JTableHeader is disabled.
IllegalStateException - if the JTableHeader is not showing on the screen.
IndexOutOfBoundsException - if the index is out of bounds.

clickColumn

@RunsInEDT
public void clickColumn(JTableHeader tableHeader,
                                  String columnName)
Clicks the column which name matches the given value.

Parameters:
tableHeader - the target JTableHeader.
columnName - the column name to match. It can be a regular expression.
Throws:
IllegalStateException - if the JTableHeader is disabled.
IllegalStateException - if the JTableHeader is not showing on the screen.
LocationUnavailableException - if a column with a matching name cannot be found.

clickColumn

@RunsInEDT
public void clickColumn(JTableHeader tableHeader,
                                  Pattern columnNamePattern)
Clicks the column which name matches the given regular expression pattern.

Parameters:
tableHeader - the target JTableHeader.
columnNamePattern - the the regular expression pattern to match.
Throws:
IllegalStateException - if the JTableHeader is disabled.
IllegalStateException - if the JTableHeader is not showing on the screen.
NullPointerException - if the given regular expression pattern is null.
LocationUnavailableException - if a column with a matching name cannot be found.
Since:
1.2

clickColumn

@RunsInEDT
public void clickColumn(JTableHeader tableHeader,
                                  String columnName,
                                  MouseButton button,
                                  int times)
Clicks the column which name matches the given one using the given mouse button the given number of times.

Parameters:
tableHeader - the target JTableHeader.
columnName - the column name to match. It can be a regular expression.
button - the mouse button to use.
times - the number of times to click.
Throws:
IllegalStateException - if the JTableHeader is disabled.
IllegalStateException - if the JTableHeader is not showing on the screen.
LocationUnavailableException - if a column with a matching name cannot be found.

clickColumn

@RunsInEDT
public void clickColumn(JTableHeader tableHeader,
                                  Pattern columnNamePattern,
                                  MouseButton button,
                                  int times)
Clicks the column which name matches the given regular expression pattern using the given mouse button the given number of times.

Parameters:
tableHeader - the target JTableHeader.
columnNamePattern - the regular expression pattern to match.
button - the mouse button to use.
times - the number of times to click.
Throws:
IllegalStateException - if the JTableHeader is disabled.
IllegalStateException - if the JTableHeader is not showing on the screen.
NullPointerException - if the given regular expression pattern is null.
LocationUnavailableException - if a column with a matching name cannot be found.
Since:
1.2

showPopupMenu

@RunsInEDT
public JPopupMenu showPopupMenu(JTableHeader tableHeader,
                                          int columnIndex)
Shows a pop-up menu at the given column.

Parameters:
tableHeader - the target JTableHeader.
columnIndex - the index of the column.
Returns:
the displayed pop-up menu.
Throws:
IllegalStateException - if the JTableHeader is disabled.
IllegalStateException - if the JTableHeader is not showing on the screen.
IndexOutOfBoundsException - if the index is out of bounds.
ComponentLookupException - if a pop-up menu cannot be found.

showPopupMenu

@RunsInEDT
public JPopupMenu showPopupMenu(JTableHeader tableHeader,
                                          String columnName)
Shows a pop-up menu at the given column.

Parameters:
tableHeader - the target JTableHeader.
columnName - the name of the column. It can be a regular expression.
Returns:
the displayed pop-up menu.
Throws:
IllegalStateException - if the JTableHeader is disabled.
IllegalStateException - if the JTableHeader is not showing on the screen.
ComponentLookupException - if a pop-up menu cannot be found.

showPopupMenu

@RunsInEDT
public JPopupMenu showPopupMenu(JTableHeader tableHeader,
                                          Pattern pattern)
Shows a pop-up menu at the column whose name matches the given regular expression pattern.

Parameters:
tableHeader - the target JTableHeader.
pattern - the regular expression pattern to match.
Returns:
the displayed pop-up menu.
Throws:
IllegalStateException - if the JTableHeader is disabled.
IllegalStateException - if the JTableHeader is not showing on the screen.
NullPointerException - if the given regular expression pattern is null.
ComponentLookupException - if a pop-up menu cannot be found.
Since:
1.2


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