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
JTableHeaders:
- 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.JTableHeaderclickColumn(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.JTableHeaderclickColumn(String columnName) Simulates a user clicking the column which name matches the given value, in this fixture's.JTableHeaderclickColumn(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.JTableHeaderclickColumn(Pattern columnNamePattern) Simulates a user clicking the column which name matches the given regular expression pattern, in this fixture's.JTableHeaderclickColumn(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.JTableHeaderclientProperty(Object key) Returns the client property stored in this fixture's, under the given key.JTableHeaderprotected final voiddriver(JTableHeaderDriver newDriver) Sets theto be used by this fixture.JTableHeaderDriverrequireToolTip(String expected) Asserts that the toolTip in this fixture'smatches the given value.JTableHeaderrequireToolTip(Pattern pattern) Asserts that the toolTip in this fixture'smatches the given regular expression pattern.JTableHeadershowPopupMenuAt(int columnIndex) Shows a pop-up menu using this fixture'sas the invoker of the pop-up menu.JTableHeadershowPopupMenuAt(String columnName) Shows a pop-up menu using this fixture'sas the invoker of the pop-up menu.JTableHeadershowPopupMenuAt(Pattern columnNamePattern) Shows a pop-up menu using this fixture'sas the invoker of the pop-up menu.JTableHeaderprivate voidvalidateNotNull(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- theJTableHeaderto be managed by this fixture.- Throws:
NullPointerException- ifrobotisnull.NullPointerException- iftargetisnull.
-
-
Method Details
-
driver
Sets theto 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'sJTableHeaderis disabled.IllegalStateException- if this fixture'sJTableHeaderis not showing on the screen.IndexOutOfBoundsException- if the index is out of bounds.
-
showPopupMenuAt
Shows a pop-up menu using this fixture'sas 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'sJTableHeaderis disabled.IllegalStateException- if this fixture'sJTableHeaderis 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'sas 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'sJTableHeaderis disabled.IllegalStateException- if this fixture'sJTableHeaderis not showing on the screen.ComponentLookupException- if a pop-up menu cannot be found.
-
showPopupMenuAt
Shows a pop-up menu using this fixture'sas 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'sJTableHeaderis disabled.IllegalStateException- if this fixture'sJTableHeaderis 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 givenMouseClickInfoisnull.IllegalStateException- if this fixture'sJTableHeaderis disabled.IllegalStateException- if this fixture'sJTableHeaderis 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'sJTableHeaderis disabled.IllegalStateException- if this fixture'sJTableHeaderis 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'sJTableHeaderis disabled.IllegalStateException- if this fixture'sJTableHeaderis 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 givenMouseClickInfoisnull.IllegalStateException- if this fixture'sJTableHeaderis disabled.IllegalStateException- if this fixture'sJTableHeaderis 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 givenMouseClickInfoisnull.IllegalStateException- if this fixture'sJTableHeaderis disabled.IllegalStateException- if this fixture'sJTableHeaderis 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'smatches the given value.JTableHeader- Specified by:
requireToolTipin interfaceToolTipDisplayFixture- Parameters:
expected- the given value. It can be a regular expression.- Returns:
- this fixture.
- Throws:
AssertionError- if the toolTip in this fixture'sJTableHeaderdoes not match the given value.- Since:
- 1.2
-
requireToolTip
Asserts that the toolTip in this fixture'smatches the given regular expression pattern.JTableHeader- Specified by:
requireToolTipin 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'sJTableHeaderdoes 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:
clientPropertyin 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
nullif the property was not found. - Throws:
NullPointerException- if the given key isnull.- Since:
- 1.2
-