Package org.fest.swing.driver
Class JTableHeaderDriver
java.lang.Object
org.fest.swing.driver.ComponentDriver
org.fest.swing.driver.ContainerDriver
org.fest.swing.driver.JComponentDriver
org.fest.swing.driver.JTableHeaderDriver
Understands functional testing of
JTableHeader
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 TypeMethodDescriptionvoid
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, 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.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.private void
clickColumn
(JTableHeader tableHeader, TextMatcher matcher, MouseButton button, int times) private static Point
pointAtIndex
(JTableHeader tableHeader, int columnIndex, JTableHeaderLocation location) private static Point
pointAtName
(JTableHeader tableHeader, TextMatcher matcher, JTableHeaderLocation location) showPopupMenu
(JTableHeader tableHeader, int columnIndex) Shows a pop-up menu at the given column.showPopupMenu
(JTableHeader tableHeader, String columnName) Shows a pop-up menu at the given column.showPopupMenu
(JTableHeader tableHeader, Pattern pattern) Shows a pop-up menu at the column whose name matches the given regular expression pattern.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
-
JTableHeaderDriver
Creates a newJTableHeaderDriver
.- Parameters:
robot
- the robot to use to simulate user input.
-
-
Method Details
-
clickColumn
Clicks the column under the given index.- Parameters:
tableHeader
- the targetJTableHeader
.columnIndex
- the given index.- Throws:
IllegalStateException
- if theJTableHeader
is disabled.IllegalStateException
- if theJTableHeader
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 targetJTableHeader
.columnIndex
- the given index.button
- the mouse button to use.times
- the number of times to click.- Throws:
IllegalStateException
- if theJTableHeader
is disabled.IllegalStateException
- if theJTableHeader
is not showing on the screen.IndexOutOfBoundsException
- if the index is out of bounds.
-
clickColumn
Clicks the column which name matches the given value.- Parameters:
tableHeader
- the targetJTableHeader
.columnName
- the column name to match. It can be a regular expression.- Throws:
IllegalStateException
- if theJTableHeader
is disabled.IllegalStateException
- if theJTableHeader
is not showing on the screen.LocationUnavailableException
- if a column with a matching name cannot be found.
-
clickColumn
Clicks the column which name matches the given regular expression pattern.- Parameters:
tableHeader
- the targetJTableHeader
.columnNamePattern
- the the regular expression pattern to match.- Throws:
IllegalStateException
- if theJTableHeader
is disabled.IllegalStateException
- if theJTableHeader
is not showing on the screen.NullPointerException
- if the given regular expression pattern isnull
.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 targetJTableHeader
.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 theJTableHeader
is disabled.IllegalStateException
- if theJTableHeader
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 targetJTableHeader
.columnNamePattern
- the regular expression pattern to match.button
- the mouse button to use.times
- the number of times to click.- Throws:
IllegalStateException
- if theJTableHeader
is disabled.IllegalStateException
- if theJTableHeader
is not showing on the screen.NullPointerException
- if the given regular expression pattern isnull
.LocationUnavailableException
- if a column with a matching name cannot be found.- Since:
- 1.2
-
clickColumn
@RunsInEDT private void clickColumn(JTableHeader tableHeader, TextMatcher matcher, MouseButton button, int times) -
showPopupMenu
Shows a pop-up menu at the given column.- Parameters:
tableHeader
- the targetJTableHeader
.columnIndex
- the index of the column.- Returns:
- the displayed pop-up menu.
- Throws:
IllegalStateException
- if theJTableHeader
is disabled.IllegalStateException
- if theJTableHeader
is not showing on the screen.IndexOutOfBoundsException
- if the index is out of bounds.ComponentLookupException
- if a pop-up menu cannot be found.
-
pointAtIndex
@RunsInEDT private static Point pointAtIndex(JTableHeader tableHeader, int columnIndex, JTableHeaderLocation location) -
showPopupMenu
Shows a pop-up menu at the given column.- Parameters:
tableHeader
- the targetJTableHeader
.columnName
- the name of the column. It can be a regular expression.- Returns:
- the displayed pop-up menu.
- Throws:
IllegalStateException
- if theJTableHeader
is disabled.IllegalStateException
- if theJTableHeader
is not showing on the screen.ComponentLookupException
- if a pop-up menu cannot be found.
-
showPopupMenu
Shows a pop-up menu at the column whose name matches the given regular expression pattern.- Parameters:
tableHeader
- the targetJTableHeader
.pattern
- the regular expression pattern to match.- Returns:
- the displayed pop-up menu.
- Throws:
IllegalStateException
- if theJTableHeader
is disabled.IllegalStateException
- if theJTableHeader
is not showing on the screen.NullPointerException
- if the given regular expression pattern isnull
.ComponentLookupException
- if a pop-up menu cannot be found.- Since:
- 1.2
-
pointAtName
@RunsInEDT private static Point pointAtName(JTableHeader tableHeader, TextMatcher matcher, JTableHeaderLocation location)
-