Package org.fest.swing.fixture
Class JTableHeaderFixture
- All Implemented Interfaces:
ClientPropertyStorageFixture
,JComponentFixture
,ToolTipDisplayFixture
public class JTableHeaderFixture
extends ComponentFixture<JTableHeader>
implements JComponentFixture
Understands functional testing of
JTableHeader
s:
- user input simulation
- state verification
- property value query
-
Field Summary
FieldsFields inherited from class org.fest.swing.fixture.ComponentFixture
BACKGROUND_PROPERTY, FONT_PROPERTY, FOREGROUND_PROPERTY, robot, target
-
Constructor Summary
ConstructorsConstructorDescriptionJTableHeaderFixture
(Robot robot, JTableHeader target) Creates a newJTableHeaderFixture
. -
Method Summary
Modifier and TypeMethodDescriptionclickColumn
(int index) Simulates a user clicking the column under the given index, in this fixture's
.JTableHeader
clickColumn
(int index, MouseClickInfo mouseClickInfo) Simulates a user clicking the column under the given index, in this fixture's
, using the given mouse button, the given number of times.JTableHeader
clickColumn
(String columnName) Simulates a user clicking the column which name matches the given value, in this fixture's
.JTableHeader
clickColumn
(String columnName, MouseClickInfo mouseClickInfo) Simulates a user clicking the column which name matches the given one, in this fixture's
, using the given mouse button, the given number of times.JTableHeader
clickColumn
(Pattern columnNamePattern) Simulates a user clicking the column which name matches the given regular expression pattern, in this fixture's
.JTableHeader
clickColumn
(Pattern columnNamePattern, MouseClickInfo mouseClickInfo) Simulates a user clicking the column which name matches the given regular expression pattern, in this fixture's
, using the given mouse button, the given number of times.JTableHeader
clientProperty
(Object key) Returns the client property stored in this fixture's
, under the given key.JTableHeader
protected final void
driver
(JTableHeaderDriver newDriver) Sets the
to be used by this fixture.JTableHeaderDriver
requireToolTip
(String expected) Asserts that the toolTip in this fixture's
matches the given value.JTableHeader
requireToolTip
(Pattern pattern) Asserts that the toolTip in this fixture's
matches the given regular expression pattern.JTableHeader
showPopupMenuAt
(int columnIndex) Shows a pop-up menu using this fixture's
as the invoker of the pop-up menu.JTableHeader
showPopupMenuAt
(String columnName) Shows a pop-up menu using this fixture's
as the invoker of the pop-up menu.JTableHeader
showPopupMenuAt
(Pattern columnNamePattern) Shows a pop-up menu using this fixture's
as the invoker of the pop-up menu.JTableHeader
private void
validateNotNull
(MouseClickInfo mouseClickInfo) Methods inherited from class org.fest.swing.fixture.ComponentFixture
background, component, font, foreground, requireShowing, targetCastedTo, validateNotNull
-
Field Details
-
driver
-
-
Constructor Details
-
JTableHeaderFixture
Creates a newJTableHeaderFixture
.- Parameters:
robot
- performs simulation of user events on the givenJTableHeader
.target
- theJTableHeader
to be managed by this fixture.- Throws:
NullPointerException
- ifrobot
isnull
.NullPointerException
- iftarget
isnull
.
-
-
Method Details
-
driver
Sets the
to be used by this fixture.JTableHeaderDriver
- Parameters:
newDriver
- the newJTableHeaderDriver
.- Throws:
NullPointerException
- if the given driver isnull
.
-
clickColumn
Simulates a user clicking the column under the given index, in this fixture's
.JTableHeader
- Parameters:
index
- the index of the column to click.- Returns:
- this fixture.
- Throws:
IllegalStateException
- if this fixture'sJTableHeader
is disabled.IllegalStateException
- if this fixture'sJTableHeader
is not showing on the screen.IndexOutOfBoundsException
- if the index is out of bounds.
-
showPopupMenuAt
Shows a pop-up menu using this fixture's
as the invoker of the pop-up menu.JTableHeader
- Parameters:
columnIndex
- the index of the column where the pop-up menu will be displayed.- Returns:
- a fixture that manages the displayed pop-up menu.
- Throws:
IllegalStateException
- if this fixture'sJTableHeader
is disabled.IllegalStateException
- if this fixture'sJTableHeader
is not showing on the screen.IndexOutOfBoundsException
- if the index is out of bounds.ComponentLookupException
- if a pop-up menu cannot be found.
-
showPopupMenuAt
Shows a pop-up menu using this fixture's
as the invoker of the pop-up menu.JTableHeader
- Parameters:
columnName
- the name of the column where the pop-up menu will be displayed. It can be a regular expression.- Returns:
- a fixture that manages the displayed pop-up menu.
- Throws:
IllegalStateException
- if this fixture'sJTableHeader
is disabled.IllegalStateException
- if this fixture'sJTableHeader
is not showing on the screen.ComponentLookupException
- if a pop-up menu cannot be found.
-
showPopupMenuAt
Shows a pop-up menu using this fixture's
as the invoker of the pop-up menu. The name of the column to use must match the given regular expression pattern.JTableHeader
- Parameters:
columnNamePattern
- the regular expression pattern to match.- Returns:
- a fixture that manages the displayed pop-up menu.
- Throws:
IllegalStateException
- if this fixture'sJTableHeader
is disabled.IllegalStateException
- if this fixture'sJTableHeader
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
-
clickColumn
Simulates a user clicking the column under the given index, in this fixture's
, using the given mouse button, the given number of times.JTableHeader
- Parameters:
index
- the index of the column to click.mouseClickInfo
- specifies the mouse button to use and the number of times to click.- Returns:
- this fixture.
- Throws:
NullPointerException
- if the givenMouseClickInfo
isnull
.IllegalStateException
- if this fixture'sJTableHeader
is disabled.IllegalStateException
- if this fixture'sJTableHeader
is not showing on the screen.IndexOutOfBoundsException
- if the index is out of bounds.
-
clickColumn
Simulates a user clicking the column which name matches the given value, in this fixture's
.JTableHeader
- Parameters:
columnName
- the column name to match. It can be a regular expression.- Returns:
- this fixture.
- Throws:
IllegalStateException
- if this fixture'sJTableHeader
is disabled.IllegalStateException
- if this fixture'sJTableHeader
is not showing on the screen.LocationUnavailableException
- if a column with a matching name cannot be found.
-
clickColumn
Simulates a user clicking the column which name matches the given regular expression pattern, in this fixture's
.JTableHeader
- Parameters:
columnNamePattern
- the regular expression pattern to match.- Returns:
- this fixture.
- Throws:
IllegalStateException
- if this fixture'sJTableHeader
is disabled.IllegalStateException
- if this fixture'sJTableHeader
is not showing on the screen.NullPointerException
- if the given regular expression isnull
.LocationUnavailableException
- if a column with a matching name cannot be found.- Since:
- 1.2
-
clickColumn
Simulates a user clicking the column which name matches the given one, in this fixture's
, using the given mouse button, the given number of times.JTableHeader
- Parameters:
columnName
- the column name to match. It can be a regular expression.mouseClickInfo
- specifies the mouse button to use and the number of times to click.- Returns:
- this fixture.
- Throws:
NullPointerException
- if the givenMouseClickInfo
isnull
.IllegalStateException
- if this fixture'sJTableHeader
is disabled.IllegalStateException
- if this fixture'sJTableHeader
is not showing on the screen.LocationUnavailableException
- if a column with a matching name cannot be found.
-
clickColumn
Simulates a user clicking the column which name matches the given regular expression pattern, in this fixture's
, using the given mouse button, the given number of times.JTableHeader
- Parameters:
columnNamePattern
- the regular expression pattern to match.mouseClickInfo
- specifies the mouse button to use and the number of times to click.- Returns:
- this fixture.
- Throws:
NullPointerException
- if the givenMouseClickInfo
isnull
.IllegalStateException
- if this fixture'sJTableHeader
is disabled.IllegalStateException
- if this fixture'sJTableHeader
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
-
validateNotNull
-
requireToolTip
Asserts that the toolTip in this fixture's
matches the given value.JTableHeader
- Specified by:
requireToolTip
in interfaceToolTipDisplayFixture
- Parameters:
expected
- the given value. It can be a regular expression.- Returns:
- this fixture.
- Throws:
AssertionError
- if the toolTip in this fixture'sJTableHeader
does not match the given value.- Since:
- 1.2
-
requireToolTip
Asserts that the toolTip in this fixture's
matches the given regular expression pattern.JTableHeader
- Specified by:
requireToolTip
in interfaceToolTipDisplayFixture
- Parameters:
pattern
- the regular expression pattern to match.- Returns:
- this fixture.
- Throws:
NullPointerException
- if the given regular expression pattern isnull
.AssertionError
- if the toolTip in this fixture'sJTableHeader
does not match the given regular expression.- Since:
- 1.2
-
clientProperty
Returns the client property stored in this fixture's
, under the given key.JTableHeader
- Specified by:
clientProperty
in interfaceClientPropertyStorageFixture
- Parameters:
key
- the key to use to retrieve the client property.- Returns:
- the value of the client property stored under the given key, or
null
if the property was not found. - Throws:
NullPointerException
- if the given key isnull
.- Since:
- 1.2
-