Package org.fest.swing.fixture
Class JTreeFixture
- All Implemented Interfaces:
ClientPropertyStorageFixture,CommonComponentFixture,FocusableComponentFixture,JComponentFixture,JPopupMenuInvokerFixture,KeyboardInputSimulationFixture,MouseInputSimulationFixture,StateVerificationFixture,ToolTipDisplayFixture
public class JTreeFixture
extends ComponentFixture<JTree>
implements CommonComponentFixture, JComponentFixture, JPopupMenuInvokerFixture
Understands functional testing of
JTrees:
- user input simulation
- state verification
- property value query
s can be specified using TreePathStrings. For example, for the following
tree:
root
|
-- node1
|
-- node1.1
we can identify the node "node1.1" as follows:
root/node1/node1.1
The default path separator is "/". It can be changed by calling .
separator(String)
The conversion between the values given in tests and the values being displayed by a
renderer is performed by a JTree. This fixture uses a
JTreeCellReader by default.
BasicJTreeCellReader
-
Field Summary
FieldsFields inherited from class org.fest.swing.fixture.ComponentFixture
BACKGROUND_PROPERTY, FONT_PROPERTY, FOREGROUND_PROPERTY, robot, target -
Constructor Summary
ConstructorsConstructorDescriptionJTreeFixture(Robot robot, String treeName) Creates a new.JTreeFixtureJTreeFixture(Robot robot, JTree target) Creates a new.JTreeFixture -
Method Summary
Modifier and TypeMethodDescriptioncellReader(JTreeCellReader cellReader) Updates the implementation ofto use when comparing internal values of aJTreeCellReaderand the values expected in a test.JTreeclick()Simulates a user clicking this fixture's.JTreeclick(MouseButton button) Simulates a user clicking this fixture's.JTreeclick(MouseClickInfo mouseClickInfo) Simulates a user clicking this fixture's.JTreeClicks the given path, expanding parent nodes if necessary.clickPath(String path, MouseButton button) Clicks the given path, expanding parent nodes if necessary.clickPath(String path, MouseClickInfo mouseClickInfo) Clicks the given path, expanding parent nodes if necessary.clickRow(int row) Clicks the given row.clickRow(int row, MouseButton button) Clicks the given row.clickRow(int row, MouseClickInfo mouseClickInfo) Clicks the given row.clientProperty(Object key) Returns the client property stored in this fixture's, under the given key.JButtoncollapsePath(String path) Simulates a user collapsing the tree node at the given path.collapseRow(int row) Simulates a user collapsing the tree node at the given row.private voidSimulates a user double-clicking this fixture's.JTreedoubleClickPath(String path) Double-clicks the given path.doubleClickRow(int row) Double-clicks the given row.drag(int row) Simulates a user dragging a row from this fixture's.JTreeSimulates a user dragging an item from this fixture's.JTreeprotected final voiddriver(JTreeDriver newDriver) Sets theto be used by this fixture.JTreeDriverdrop(int row) Simulates a user dropping an item into this fixture's.JTreeSimulates a user dropping an item into this fixture's.JTreeexpandPath(String path) Simulates a user expanding the tree node at the given path.expandRow(int row) Simulates a user expanding the tree node at the given row.focus()Gives input focus to this fixture's.JTreenode(int row) Returns a fixture that manages the node specified by the given row.Returns a fixture that manages the node specified by the given path.pressAndReleaseKey(KeyPressInfo keyPressInfo) Simulates a user pressing given key with the given modifiers on this fixture's.JTreepressAndReleaseKeys(int... keyCodes) Simulates a user pressing and releasing the given keys in this fixture's.JTreepressKey(int keyCode) Simulates a user pressing the given key on this fixture's.JTreereleaseKey(int keyCode) Simulates a user releasing the given key on this fixture's.JTreeAsserts that this fixture'sis disabled.JTreeAsserts that this fixture'sis editable.JTreeAsserts that this fixture'sis enabled.JTreerequireEnabled(Timeout timeout) Asserts that this fixture'sis enabled.JTreeAsserts that this fixture'shas input focus.JTreeAsserts that this fixture's's does not have any selection.JTreeAsserts that this fixture'sis not editable.JTreeAsserts that this fixture'sis not visible.JTreerequireSelection(int... rows) Asserts that this fixture's's selected rows are equal to the given one.JTreerequireSelection(String... paths) Asserts that this fixture'sselection is equal to the given paths.JTreerequireToolTip(String expected) Asserts that the toolTip in this fixture'smatches the given value.JTreerequireToolTip(Pattern pattern) Asserts that the toolTip in this fixture'smatches the given regular expression pattern.JTreeAsserts that this fixture'sis visible.JTreeSimulates a user right-clicking this fixture's.JTreerightClickPath(String path) Right-clicks the given path, expanding parent nodes if necessary.rightClickRow(int row) Right-clicks the given row.selectPath(String path) Selects the given path, expanding parent nodes if necessary.selectPaths(String... paths) Select the given paths, expanding parent nodes if necessary.selectRow(int row) Simulates a user selecting the tree node at the given row.selectRows(int... rows) Simulates a user selecting the tree nodes at the given rows.Returns the separator to use when convertings toTreePathStrings.Updates the separator to use when convertings toTreePathStrings.Shows a pop-up menu using this fixture'sas the invoker of the pop-up menu.JTreeshowPopupMenuAt(int row) Shows a pop-up menu at the position of the node in the given row.Shows a pop-up menu at the given point using this fixture'sas the invoker of the pop-up menu.JTreeshowPopupMenuAt(String path) Shows a pop-up menu at the position of the last node in the given path.toggleRow(int row) Simulates a user toggling the open/closed state of the tree node at the given row.valueAt(int row) Returns theStringrepresentation of the given row.Returns theStringrepresentation of the node at the given path.Methods inherited from class org.fest.swing.fixture.ComponentFixture
background, component, font, foreground, requireShowing, targetCastedTo, validateNotNull
-
Field Details
-
driver
-
-
Constructor Details
-
JTreeFixture
Creates a new.JTreeFixture- Parameters:
robot- performs simulation of user events on the givenJTree.target- theJTreeto be managed by this fixture.- Throws:
NullPointerException- ifrobotisnull.NullPointerException- iftargetisnull.
-
JTreeFixture
Creates a new.JTreeFixture- Parameters:
robot- performs simulation of user events on aJTree.treeName- the name of theJTreeto find using the givenRobot.- Throws:
NullPointerException- ifrobotisnull.ComponentLookupException- if a matchingJTreecould not be found.ComponentLookupException- if more than one matchingJTreeis found.
-
-
Method Details
-
createDriver
private void createDriver() -
driver
Sets theto be used by this fixture.JTreeDriver- Parameters:
newDriver- the newJTreeDriver.- Throws:
NullPointerException- if the given driver isnull.
-
clickRow
Clicks the given row.- Parameters:
row- the given row.- Returns:
- this fixture.
- Throws:
IllegalStateException- if theJTreeis disabled.IllegalStateException- if theJTreeis not showing on the screen.IndexOutOfBoundsException- if the given row is less than zero or equal than or greater than the number of visible rows in theJTree.LocationUnavailableException- if a tree path for the given row cannot be found.- Since:
- 1.2
-
clickRow
Clicks the given row.- Parameters:
row- the given row.button- the mouse button to use.- Returns:
- this fixture.
- Throws:
NullPointerException- if the button isnull.IllegalStateException- if theJTreeis disabled.IllegalStateException- if theJTreeis not showing on the screen.IndexOutOfBoundsException- if the given row is less than zero or equal than or greater than the number of visible rows in theJTree.LocationUnavailableException- if a tree path for the given row cannot be found.- Since:
- 1.2
-
clickRow
Clicks the given row.- Parameters:
row- the given row.mouseClickInfo- specifies the mouse button to use and how many times to click.- Returns:
- this fixture.
- Throws:
NullPointerException- if the givenMouseClickInfoisnull.IllegalStateException- if theJTreeis disabled.IllegalStateException- if theJTreeis not showing on the screen.IndexOutOfBoundsException- if the given row is less than zero or equal than or greater than the number of visible rows in theJTree.LocationUnavailableException- if a tree path for the given row cannot be found.- Since:
- 1.2
-
clickPath
Clicks the given path, expanding parent nodes if necessary.- Parameters:
path- the given path.- Returns:
- this fixture.
- Throws:
IllegalStateException- if this fixture'sJTreeis disabled.IllegalStateException- if this fixture'sJTreeis not showing on the screen.LocationUnavailableException- if the given path cannot be found.
-
clickPath
Clicks the given path, expanding parent nodes if necessary.- Parameters:
path- the given path.button- the mouse button to use.- Returns:
- this fixture.
- Throws:
NullPointerException- if the button isnull.IllegalStateException- if this fixture'sJTreeis disabled.IllegalStateException- if this fixture'sJTreeis not showing on the screen.LocationUnavailableException- if the given path cannot be found.- Since:
- 1.2
-
clickPath
Clicks the given path, expanding parent nodes if necessary.- Parameters:
path- the given path.mouseClickInfo- specifies the mouse button to use and how many times to click.- Returns:
- this fixture.
- Throws:
NullPointerException- if the givenMouseClickInfoisnull.IllegalStateException- if this fixture'sJTreeis disabled.IllegalStateException- if this fixture'sJTreeis not showing on the screen.LocationUnavailableException- if the given path cannot be found.- Since:
- 1.2
-
doubleClickRow
Double-clicks the given row.- Parameters:
row- the given row.- Returns:
- this fixture.
- Throws:
IllegalStateException- if theJTreeis disabled.IllegalStateException- if theJTreeis not showing on the screen.IndexOutOfBoundsException- if the given row is less than zero or equal than or greater than the number of visible rows in theJTree.LocationUnavailableException- if a tree path for the given row cannot be found.- Since:
- 1.2
-
doubleClickPath
Double-clicks the given path.- Parameters:
path- the given path.- Returns:
- this fixture.
- Throws:
IllegalStateException- if theJTreeis disabled.IllegalStateException- if theJTreeis not showing on the screen.LocationUnavailableException- if the given path cannot be found.- Since:
- 1.2
-
rightClickRow
Right-clicks the given row.- Parameters:
row- the given row.- Returns:
- this fixture.
- Throws:
IllegalStateException- if theJTreeis disabled.IllegalStateException- if theJTreeis not showing on the screen.IndexOutOfBoundsException- if the given row is less than zero or equal than or greater than the number of visible rows in theJTree.LocationUnavailableException- if a tree path for the given row cannot be found.- Since:
- 1.2
-
rightClickPath
Right-clicks the given path, expanding parent nodes if necessary.- Parameters:
path- the given path.- Returns:
- this fixture.
- Throws:
IllegalStateException- if this fixture'sJTreeis disabled.IllegalStateException- if this fixture'sJTreeis not showing on the screen.LocationUnavailableException- if the given path cannot be found.- Since:
- 1.2
-
click
Simulates a user clicking this fixture's.JTree- Specified by:
clickin interfaceMouseInputSimulationFixture- Returns:
- this fixture.
- Throws:
IllegalStateException- if this fixture'sJTreeis disabled.IllegalStateException- if this fixture'sJTreeis not showing on the screen.
-
click
Simulates a user clicking this fixture's.JTree- Specified by:
clickin interfaceMouseInputSimulationFixture- Parameters:
button- the button to click.- Returns:
- this fixture.
- Throws:
NullPointerException- if the givenMouseButtonisnull.IllegalStateException- if this fixture'sJTreeis disabled.IllegalStateException- if this fixture'sJTreeis not showing on the screen.
-
click
Simulates a user clicking this fixture's.JTree- Specified by:
clickin interfaceMouseInputSimulationFixture- Parameters:
mouseClickInfo- specifies the button to click and the times the button should be clicked.- Returns:
- this fixture.
- Throws:
NullPointerException- if the givenMouseClickInfoisnull.IllegalStateException- if this fixture'sJTreeis disabled.IllegalStateException- if this fixture'sJTreeis not showing on the screen.
-
doubleClick
Simulates a user double-clicking this fixture's.JTree- Specified by:
doubleClickin interfaceMouseInputSimulationFixture- Returns:
- this fixture.
- Throws:
IllegalStateException- if this fixture'sJTreeis disabled.IllegalStateException- if this fixture'sJTreeis not showing on the screen.
-
rightClick
Simulates a user right-clicking this fixture's.JTree- Specified by:
rightClickin interfaceMouseInputSimulationFixture- Returns:
- this fixture.
- Throws:
IllegalStateException- if this fixture'sJTreeis disabled.IllegalStateException- if this fixture'sJTreeis not showing on the screen.
-
drag
Simulates a user dragging a row from this fixture's.JTree- Parameters:
row- the index of the row to drag.- Returns:
- this fixture.
- Throws:
IllegalStateException- if this fixture'sJTreeis disabled.IllegalStateException- if this fixture'sJTreeis not showing on the screen.IndexOutOfBoundsException- if the given row is less than zero or equal than or greater than the number of visible rows in theJTree.LocationUnavailableException- if a tree path for the given row cannot be found.
-
drag
Simulates a user dragging an item from this fixture's.JTree- Parameters:
path- the path corresponding to the item to drag.- Returns:
- this fixture.
- Throws:
IllegalStateException- if this fixture'sJTreeis disabled.IllegalStateException- if this fixture'sJTreeis not showing on the screen.LocationUnavailableException- if the given path cannot be found.
-
drop
Simulates a user dropping an item into this fixture's.JTree- Parameters:
row- the row to drop the item to.- Returns:
- this fixture.
- Throws:
IllegalStateException- if this fixture'sJTreeis disabled.IllegalStateException- if this fixture'sJTreeis not showing on the screen.IndexOutOfBoundsException- if the given row is less than zero or equal than or greater than the number of visible rows in theJTree.LocationUnavailableException- if a tree path for the given row cannot be found.ActionFailedException- if there is no drag action in effect.
-
drop
Simulates a user dropping an item into this fixture's.JTree- Parameters:
path- the path corresponding to the item relative to the drop point.- Returns:
- this fixture.
- Throws:
IllegalStateException- if this fixture'sJTreeis disabled.IllegalStateException- if this fixture'sJTreeis not showing on the screen.LocationUnavailableException- if the given path cannot be found.ActionFailedException- if there is no drag action in effect.
-
selectPath
Selects the given path, expanding parent nodes if necessary. Unlike, this method will not click the path if it is already selected.clickPath(String)- Parameters:
path- the path to select.- Returns:
- this fixture.
- Throws:
IllegalStateException- if this fixture'sJTreeis disabled.IllegalStateException- if this fixture'sJTreeis not showing on the screen.LocationUnavailableException- if the given path cannot be found.
-
selectPaths
Select the given paths, expanding parent nodes if necessary.- Parameters:
paths- the paths to select.- Returns:
- this fixture.
- Throws:
NullPointerException- if the array of rows isnull.IllegalArgumentException- if the array of rows is empty.IllegalStateException- if this fixture'sJTreeis disabled.IllegalStateException- if this fixture'sJTreeis not showing on the screen.LocationUnavailableException- if the any of the given paths cannot be found.
-
selectRow
Simulates a user selecting the tree node at the given row.- Parameters:
row- the index of the row to select.- Returns:
- this fixture.
- Throws:
IllegalStateException- if this fixture'sJTreeis disabled.IllegalStateException- if this fixture'sJTreeis not showing on the screen.IndexOutOfBoundsException- if the given row is less than zero or equal than or greater than the number of visible rows in theJTree.LocationUnavailableException- if a tree path for the given row cannot be found.
-
selectRows
Simulates a user selecting the tree nodes at the given rows.- Parameters:
rows- the indices of the rows to select.- Returns:
- this fixture.
- Throws:
NullPointerException- if the array of rows isnull.IllegalArgumentException- if the array of rows is empty.IllegalStateException- if this fixture'sJTreeis disabled.IllegalStateException- if this fixture'sJTreeis not showing on the screen.IndexOutOfBoundsException- if the given row is less than zero or equal than or greater than the number of visible rows in theJTree.LocationUnavailableException- if a tree path for any of the given rows cannot be found.
-
toggleRow
Simulates a user toggling the open/closed state of the tree node at the given row.- Parameters:
row- the index of the row to toggle.- Returns:
- this fixture.
- Throws:
IllegalStateException- if this fixture'sJTreeis disabled.IllegalStateException- if this fixture'sJTreeis not showing on the screen.IndexOutOfBoundsException- if the given row is less than zero or equal than or greater than the number of visible rows in theJTree.LocationUnavailableException- if a tree path for the given row cannot be found.ActionFailedException- if this method fails to toggle the row.
-
expandRow
Simulates a user expanding the tree node at the given row.- Parameters:
row- the index of the row to expand.- Returns:
- this fixture.
- Throws:
IllegalStateException- if this fixture'sJTreeis disabled.IllegalStateException- if this fixture'sJTreeis not showing on the screen.IndexOutOfBoundsException- if the given row is less than zero or equal than or greater than the number of visible rows in theJTree.LocationUnavailableException- if a tree path for the given row cannot be found.ActionFailedException- if this method fails to expand the row.- Since:
- 1.2
-
collapseRow
Simulates a user collapsing the tree node at the given row.- Parameters:
row- the index of the row to collapse.- Returns:
- this fixture.
- Throws:
IllegalStateException- if this fixture'sJTreeis disabled.IllegalStateException- if this fixture'sJTreeis not showing on the screen.IndexOutOfBoundsException- if the given row is less than zero or equal than or greater than the number of visible rows in theJTree.LocationUnavailableException- if a tree path for the given row cannot be found.ActionFailedException- if this method fails to collapse the row.- Since:
- 1.2
-
expandPath
Simulates a user expanding the tree node at the given path.- Parameters:
path- the path of the row to expand.- Returns:
- this fixture.
- Throws:
IllegalStateException- if this fixture'sJTreeis disabled.IllegalStateException- if this fixture'sJTreeis not showing on the screen.LocationUnavailableException- if the given path cannot be found.ActionFailedException- if this method fails to expand the path.- Since:
- 1.2
-
collapsePath
Simulates a user collapsing the tree node at the given path.- Parameters:
path- the path of the row to collapse.- Returns:
- this fixture.
- Throws:
IllegalStateException- if this fixture'sJTreeis disabled.IllegalStateException- if this fixture'sJTreeis not showing on the screen.LocationUnavailableException- if the given path cannot be found.ActionFailedException- if this method fails to collapse the path.- Since:
- 1.2
-
showPopupMenuAt
Shows a pop-up menu at the position of the node in the given row.- Parameters:
row- the index of the row invoking the pop-up menu.- Returns:
- a fixture that manages the displayed pop-up menu.
- Throws:
IllegalStateException- if this fixture'sJTreeis disabled.IllegalStateException- if this fixture'sJTreeis not showing on the screen.IndexOutOfBoundsException- if the given row is less than zero or equal than or greater than the number of visible rows in theJTree.ComponentLookupException- if a pop-up menu cannot be found.LocationUnavailableException- if a tree path for the given row cannot be found.
-
showPopupMenuAt
Shows a pop-up menu at the position of the last node in the given path. The last node in the given path will be made visible (by expanding the parent node(s)) if it is not visible.- Parameters:
path- the path of the node invoking the pop-up menu.- Returns:
- a fixture that manages the displayed pop-up menu.
- Throws:
IllegalStateException- if this fixture'sJTreeis disabled.IllegalStateException- if this fixture'sJTreeis not showing on the screen.ComponentLookupException- if a pop-up menu cannot be found.LocationUnavailableException- if the given path cannot be found.
-
focus
Gives input focus to this fixture's.JTree- Specified by:
focusin interfaceFocusableComponentFixture- Returns:
- this fixture.
- Throws:
IllegalStateException- if this fixture'sJTreeis disabled.IllegalStateException- if this fixture'sJTreeis not showing on the screen.
-
pressAndReleaseKey
Simulates a user pressing given key with the given modifiers on this fixture's. Modifiers is a mask from the availableJTreemasks.InputEvent- Specified by:
pressAndReleaseKeyin interfaceKeyboardInputSimulationFixture- Parameters:
keyPressInfo- specifies the key and modifiers to press.- Returns:
- this fixture.
- Throws:
NullPointerException- if the givenKeyPressInfoisnull.IllegalArgumentException- if the given code is not a valid key code.IllegalStateException- if this fixture'sJTreeis disabled.IllegalStateException- if this fixture'sJTreeis not showing on the screen.- See Also:
-
pressAndReleaseKeys
Simulates a user pressing and releasing the given keys in this fixture's.JTree- Specified by:
pressAndReleaseKeysin interfaceKeyboardInputSimulationFixture- Parameters:
keyCodes- the codes of the keys to press.- Returns:
- this fixture.
- Throws:
NullPointerException- if the given array of codes isnull.IllegalArgumentException- if any of the given code is not a valid key code.IllegalStateException- if this fixture'sJTreeis disabled.IllegalStateException- if this fixture'sJTreeis not showing on the screen.- See Also:
-
pressKey
Simulates a user pressing the given key on this fixture's.JTree- Specified by:
pressKeyin interfaceKeyboardInputSimulationFixture- Parameters:
keyCode- the code of the key to press.- Returns:
- this fixture.
- Throws:
IllegalArgumentException- if any of the given code is not a valid key code.IllegalStateException- if this fixture'sJTreeis disabled.IllegalStateException- if this fixture'sJTreeis not showing on the screen.- See Also:
-
releaseKey
Simulates a user releasing the given key on this fixture's.JTree- Specified by:
releaseKeyin interfaceKeyboardInputSimulationFixture- Parameters:
keyCode- the code of the key to release.- Returns:
- this fixture.
- Throws:
IllegalStateException- if this fixture'sJTreeis disabled.IllegalStateException- if this fixture'sJTreeis not showing on the screen.IllegalArgumentException- if any of the given code is not a valid key code.- See Also:
-
requireFocused
Asserts that this fixture'shas input focus.JTree- Specified by:
requireFocusedin interfaceFocusableComponentFixture- Returns:
- this fixture.
- Throws:
AssertionError- if this fixture'sJTreedoes not have input focus.
-
requireEnabled
Asserts that this fixture'sis enabled.JTree- Specified by:
requireEnabledin interfaceStateVerificationFixture- Returns:
- this fixture.
- Throws:
AssertionError- if this fixture'sJTreeis disabled.
-
requireEnabled
Asserts that this fixture'sis enabled.JTree- Specified by:
requireEnabledin interfaceStateVerificationFixture- Parameters:
timeout- the time this fixture will wait for the component to be enabled.- Returns:
- this fixture.
- Throws:
WaitTimedOutError- if this fixture'sJTreeis never enabled.
-
requireDisabled
Asserts that this fixture'sis disabled.JTree- Specified by:
requireDisabledin interfaceStateVerificationFixture- Returns:
- this fixture.
- Throws:
AssertionError- if this fixture'sJTreeis enabled.
-
requireVisible
Asserts that this fixture'sis visible.JTree- Specified by:
requireVisiblein interfaceStateVerificationFixture- Returns:
- this fixture.
- Throws:
AssertionError- if this fixture'sJTreeis not visible.
-
requireNotVisible
Asserts that this fixture'sis not visible.JTree- Specified by:
requireNotVisiblein interfaceStateVerificationFixture- Returns:
- this fixture.
- Throws:
AssertionError- if this fixture'sJTreeis visible.
-
requireEditable
Asserts that this fixture'sis editable.JTree- Returns:
- this fixture.
- Throws:
AssertionError- if this fixture'sJTreeis not editable.AssertionError- if this fixture'sJTreeis not editable.
-
requireNotEditable
Asserts that this fixture'sis not editable.JTree- Returns:
- this fixture.
- Throws:
AssertionError- if this fixture'sJTreeis editable.AssertionError- if this fixture'sJTreeis editable.
-
requireSelection
Asserts that this fixture'sselection is equal to the given paths.JTree- Parameters:
paths- the given paths, expected to be selected.- Returns:
- this fixture.
- Throws:
NullPointerException- if the array of paths isnull.LocationUnavailableException- if any of the given path cannot be found.AssertionError- if this fixture'sJTreeselection is not equal to the given paths.
-
requireSelection
Asserts that this fixture's's selected rows are equal to the given one.JTree- Parameters:
rows- the indices of the rows, expected to be selected.- Returns:
- this fixture.
- Throws:
NullPointerException- if the array of row indices isnull.AssertionError- if this fixture'sJTreeselection is not equal to the given rows.
-
requireNoSelection
Asserts that this fixture's's does not have any selection.JTree- Returns:
- this fixture.
- Throws:
AssertionError- if this fixture'sJTreehas a selection.
-
requireToolTip
Asserts that the toolTip in this fixture'smatches the given value.JTree- 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'sJTreedoes not match the given value.- Since:
- 1.2
-
requireToolTip
Asserts that the toolTip in this fixture'smatches the given regular expression pattern.JTree- 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'sJTreedoes not match the given regular expression.- Since:
- 1.2
-
clientProperty
Returns the client property stored in this fixture's, under the given key.JButton- 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
-
showPopupMenu
Shows a pop-up menu using this fixture'sas the invoker of the pop-up menu.JTree- Specified by:
showPopupMenuin interfaceJPopupMenuInvokerFixture- Returns:
- a fixture that manages the displayed pop-up menu.
- Throws:
IllegalStateException- if this fixture'sJTreeis disabled.IllegalStateException- if this fixture'sJTreeis not showing on the screen.ComponentLookupException- if a pop-up menu cannot be found.
-
showPopupMenuAt
Shows a pop-up menu at the given point using this fixture'sas the invoker of the pop-up menu.JTree- Specified by:
showPopupMenuAtin interfaceJPopupMenuInvokerFixture- Parameters:
p- the given point where to show the pop-up menu.- Returns:
- a fixture that manages the displayed pop-up menu.
- Throws:
IllegalStateException- if this fixture'sJTreeis disabled.IllegalStateException- if this fixture'sJTreeis not showing on the screen.ComponentLookupException- if a pop-up menu cannot be found.
-
separator
Returns the separator to use when convertings toTreePathStrings.- Returns:
- the separator to use when converting
s toTreePathStrings.
-
separator
Updates the separator to use when convertings toTreePathStrings. The default value is "/".- Parameters:
separator- the new separator.- Returns:
- this fixture.
- Throws:
NullPointerException- if the given separator isnull.
-
cellReader
Updates the implementation ofto use when comparing internal values of aJTreeCellReaderand the values expected in a test. The default implementation to use isJTree.BasicJTreeCellReader- Parameters:
cellReader- the newJTreeCellValueReaderto use.- Returns:
- this fixture.
- Throws:
NullPointerException- ifcellReaderisnull.
-
node
Returns a fixture that manages the node specified by the given row.- Parameters:
row- the given row.- Returns:
- a fixture that manages the node specified by the given row.
- Throws:
IndexOutOfBoundsException- if the given index is less than zero or equal than or greater than the number of visible rows in theJTree.- Since:
- 1.2
-
node
Returns a fixture that manages the node specified by the given path.- Parameters:
path- the given path.- Returns:
- a fixture that manages the node specified by the given path.
- Throws:
LocationUnavailableException- if the given path cannot be found.- Since:
- 1.2
-
valueAt
Returns theStringrepresentation of the node at the given path.- Parameters:
path- the given path.- Returns:
- the
Stringrepresentation of the node at the given path. - Throws:
LocationUnavailableException- if the given path cannot be found.- Since:
- 1.2
-
valueAt
Returns theStringrepresentation of the given row.- Parameters:
row- the given row.- Returns:
- the
Stringrepresentation of the node at the given path. - Throws:
IndexOutOfBoundsException- if the given row is less than zero or equal than or greater than the number of visible rows in theJTree.LocationUnavailableException- if a tree path for the given row cannot be found.- Since:
- 1.2
-