public class JTabbedPaneFixture extends AbstractJPopupMenuInvokerFixture<JTabbedPaneFixture,JTabbedPane,JTabbedPaneDriver>
JTabbedPane
s.BACKGROUND_PROPERTY, FONT_PROPERTY, FOREGROUND_PROPERTY
Constructor and Description |
---|
JTabbedPaneFixture(Robot robot,
JTabbedPane target)
Creates a new
JTabbedPaneFixture . |
JTabbedPaneFixture(Robot robot,
String tabbedPaneName)
Creates a new
JTabbedPaneFixture . |
Modifier and Type | Method and Description |
---|---|
protected JTabbedPaneDriver |
createDriver(Robot robot) |
JTabbedPaneFixture |
requireDisabled(Index index)
Asserts that the tab at the given index is disabled.
|
JTabbedPaneFixture |
requireEnabled(Index index)
Asserts that the tab at the given index is enabled.
|
JTabbedPaneFixture |
requireSelectedTab(Index expected)
Asserts that this fixture's
JTabbedPane has the tab at the given index selected. |
JTabbedPaneFixture |
requireTabTitles(String... titles)
Asserts that the tabs of this fixture's
JTabbedPane have the given titles. |
JTabbedPaneFixture |
requireTitle(Pattern pattern,
Index index)
Asserts that the title of the tab at the given index matches the given regular expression pattern.
|
JTabbedPaneFixture |
requireTitle(String title,
Index index)
Asserts that the title of the tab at the given index matches the given value.
|
JTabbedPaneFixture |
requireToolTipText(Pattern pattern,
Index index)
Asserts that the toolTipText of the tab at the given index matches the given regular expression pattern.
|
JTabbedPaneFixture |
requireToolTipText(String toolTipText,
Index index)
Asserts that the toolTipText of the tab at the given index matches the given value.
|
JTabbedPaneFixture |
selectTab(int index)
Simulates a user selecting the tab located at the given index.
|
JTabbedPaneFixture |
selectTab(Pattern pattern)
Simulates a user selecting the tab whose title matches the given regular expression pattern.
|
JTabbedPaneFixture |
selectTab(String title)
Simulates a user selecting the tab whose title matches the given value.
|
String[] |
tabTitles()
Returns the titles of all the tabs in this fixture's
JTabbedPane . |
showPopupMenu, showPopupMenuAt
clientProperty, requireToolTip, requireToolTip
background, click, click, click, doubleClick, driver, drop, equals, focus, font, foreground, hashCode, isEnabled, myself, pressAndReleaseKey, pressAndReleaseKeys, pressKey, pressKeyWhileRunning, releaseKey, replaceDriverWith, requireDisabled, requireEnabled, requireEnabled, requireFocused, requireNotVisible, requireShowing, requireVisible, rightClick, robot, target, targetCastedTo
public JTabbedPaneFixture(@Nonnull Robot robot, @Nonnull JTabbedPane target)
JTabbedPaneFixture
.robot
- performs simulation of user events on the given JTabbedPane
.target
- the JTabbedPane
to be managed by this fixture.NullPointerException
- if robot
is null
.NullPointerException
- if target
is null
.public JTabbedPaneFixture(@Nonnull Robot robot, @Nonnull String tabbedPaneName)
JTabbedPaneFixture
.robot
- performs simulation of user events on a JTabbedPane
.tabbedPaneName
- the name of the JTabbedPane
to find using the given Robot
.NullPointerException
- if robot
is null
.ComponentLookupException
- if a matching JTabbedPane
could not be found.ComponentLookupException
- if more than one matching JTabbedPane
is found.@Nonnull protected JTabbedPaneDriver createDriver(@Nonnull Robot robot)
createDriver
in class AbstractComponentFixture<JTabbedPaneFixture,JTabbedPane,JTabbedPaneDriver>
public String[] tabTitles()
JTabbedPane
.@Nonnull public JTabbedPaneFixture selectTab(int index)
index
- the index of the tab to select.IllegalStateException
- if this fixture's JTabbedPane
is disabled.IllegalStateException
- if this fixture's JTabbedPane
is not showing on the screen.IndexOutOfBoundsException
- if the given index is not within the JTabbedPane
bounds.@Nonnull public JTabbedPaneFixture selectTab(@Nullable String title)
title
- the title to match. It can be a regular expression.IllegalStateException
- if this fixture's JTabbedPane
is disabled.IllegalStateException
- if this fixture's JTabbedPane
is not showing on the screen.LocationUnavailableException
- if a tab matching the given title could not be found.@Nonnull public JTabbedPaneFixture selectTab(@Nonnull Pattern pattern)
pattern
- the regular expression pattern to match.IllegalStateException
- if this fixture's JTabbedPane
is disabled.IllegalStateException
- if this fixture's JTabbedPane
is not showing on the screen.NullPointerException
- if the given regular expression pattern is null
.LocationUnavailableException
- if a tab matching the given regular expression pattern could not be found.@Nonnull public JTabbedPaneFixture requireTitle(@Nullable String title, @Nonnull Index index)
title
- the expected title. It can be a regular expression.index
- the index of the tab.IndexOutOfBoundsException
- if the given index is not within the JTabbedPane
bounds.AssertionError
- if the title of the tab at the given index does not match the given one.@Nonnull public JTabbedPaneFixture requireTitle(@Nonnull Pattern pattern, @Nonnull Index index)
pattern
- the regular expression pattern to match.index
- the index of the tab.NullPointerException
- if the given regular expression pattern is null
.AssertionError
- if the title of the tab at the given index does not match the given regular expression
pattern.@Nonnull public JTabbedPaneFixture requireTabTitles(@Nonnull String... titles)
JTabbedPane
have the given titles. The tab titles are evaluated by
index order, for example, the first tab is expected to have the first title in the given array, and so on.titles
- the expected titles.AssertionError
- if the title of any of the tabs is not equal to the expected titles.@Nonnull public JTabbedPaneFixture requireSelectedTab(@Nonnull Index expected)
JTabbedPane
has the tab at the given index selected.expected
- the expected index of the selected tab.AssertionError
- if this fixture's JTabbedPane
's selected tab does not have the given index.@Nonnull public JTabbedPaneFixture requireToolTipText(@Nullable String toolTipText, @Nonnull Index index)
toolTipText
- the expected toolTipText. It can be a regular expression.index
- the index of the tab.IndexOutOfBoundsException
- if the given index is not within the JTabbedPane
bounds.AssertionError
- if the toolTipText of the tab at the given index does not match the given one.@Nonnull public JTabbedPaneFixture requireToolTipText(@Nonnull Pattern pattern, @Nonnull Index index)
pattern
- the regular expression pattern to match.index
- the index of the tab.NullPointerException
- if the given regular expression pattern is null
.AssertionError
- if the toolTipText of the tab at the given index does not match the given regular expression
pattern.@Nonnull public JTabbedPaneFixture requireEnabled(@Nonnull Index index)
index
- the index of the tab.IndexOutOfBoundsException
- if the given index is not within the JTabbedPane
bounds.AssertionError
- if the tab at the given index is not enabled.@Nonnull public JTabbedPaneFixture requireDisabled(@Nonnull Index index)
index
- the index of the tab.IndexOutOfBoundsException
- if the given index is not within the JTabbedPane
bounds.AssertionError
- if the tab at the given index is not disabled.Copyright © 2014–2019 AssertJ. All rights reserved.