public class JFileChooserFixture extends AbstractJComponentFixture<JFileChooserFixture,JFileChooser,JFileChooserDriver>
JFileChooser
s.BACKGROUND_PROPERTY, FONT_PROPERTY, FOREGROUND_PROPERTY
Constructor and Description |
---|
JFileChooserFixture(Robot robot)
Creates a new
JFileChooserFixture . |
JFileChooserFixture(Robot robot,
JFileChooser target)
Creates a new
JFileChooserFixture . |
JFileChooserFixture(Robot robot,
String fileChooserName)
Creates a new
JFileChooserFixture . |
Modifier and Type | Method and Description |
---|---|
void |
approve()
Simulates a user pressing the "Approve" button in this fixture's
JFileChooser . |
JButtonFixture |
approveButton()
Finds the "Approve" button in this fixture's
JFileChooser . |
void |
cancel()
Simulates a user pressing the "Cancel" button in this fixture's
JFileChooser . |
JButtonFixture |
cancelButton()
Finds the "Cancel" button in this fixture's
JFileChooser . |
protected JFileChooserDriver |
createDriver(Robot robot) |
JTextComponentFixture |
fileNameTextBox()
Returns a fixture that manages the field where the user can enter the name of the file to select in this fixture's
JFileChooser . |
JFileChooserFixture |
selectFile(File file)
Selects the given file in this fixture's
JFileChooser . |
JFileChooserFixture |
selectFiles(File... files)
Selects the given files in this fixture's
JFileChooser . |
JFileChooserFixture |
setCurrentDirectory(File dir)
Sets the current directory of this fixture's
JFileChooser to the given one. |
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 JFileChooserFixture(@Nonnull Robot robot)
JFileChooserFixture
.robot
- performs simulation of user events on a JFileChooser
.NullPointerException
- if robot
is null
.ComponentLookupException
- if a matching JFileChooser
could not be found.ComponentLookupException
- if more than one matching JFileChooser
is found.public JFileChooserFixture(@Nonnull Robot robot, @Nonnull JFileChooser target)
JFileChooserFixture
.robot
- performs simulation of user events on the given JFileChooser
.target
- the JFileChooser
to be managed by this fixture.NullPointerException
- if robot
is null
.NullPointerException
- if target
is null
.public JFileChooserFixture(@Nonnull Robot robot, @Nullable String fileChooserName)
JFileChooserFixture
.robot
- performs simulation of user events on a JFileChooser
.fileChooserName
- the name of the JFileChooser
to find using the given RobotFixture
.NullPointerException
- if robot
is null
.ComponentLookupException
- if a matching JFileChooser
could not be found.ComponentLookupException
- if more than one matching JFileChooser
is found.@Nonnull protected JFileChooserDriver createDriver(@Nonnull Robot robot)
createDriver
in class AbstractComponentFixture<JFileChooserFixture,JFileChooser,JFileChooserDriver>
public void approve()
JFileChooser
.ComponentLookupException
- if the "Approve" button cannot be found.IllegalStateException
- if the "Approve" button is disabled.IllegalStateException
- if the "Approve" button is not showing on the screen.@Nonnull public JButtonFixture approveButton()
JFileChooser
.ComponentLookupException
- if the "Approve" button cannot be found.public void cancel()
JFileChooser
.ComponentLookupException
- if the "Cancel" button cannot be found.IllegalStateException
- if the "Cancel" button is disabled.IllegalStateException
- if the "Cancel" button is not showing on the screen.@Nonnull public JButtonFixture cancelButton()
JFileChooser
.ComponentLookupException
- if the "Cancel" button cannot be found.@Nonnull public JTextComponentFixture fileNameTextBox()
JFileChooser
.ComponentLookupException
- if a matching textToMatch field could not be found.@Nonnull public JFileChooserFixture selectFile(@Nonnull File file)
JFileChooser
.file
- the file to select.NullPointerException
- if the given file is null
.IllegalStateException
- if this fixture's JFileChooser
is disabled.IllegalStateException
- if this fixture's JFileChooser
is not showing on the screen.IllegalArgumentException
- if this fixture's JFileChooser
can select directories only and the file to
select is not a directory.IllegalArgumentException
- if this fixture's JFileChooser
cannot select directories and the file to
select is a directory.@Nonnull public JFileChooserFixture selectFiles(@Nonnull File... files)
JFileChooser
.files
- the files to select.NullPointerException
- if the given array of files is null
.IllegalArgumentException
- if the given array of files is empty.IllegalStateException
- if this fixture's JFileChooser
is disabled.IllegalStateException
- if this fixture's JFileChooser
is not showing on the screen.IllegalStateException
- if this fixture's JFileChooser
does not support multiple selection and there
is more than one file to select.IllegalArgumentException
- if this fixture's JFileChooser
can select directories only and any of the
files to select is not a directory.IllegalArgumentException
- if this fixture's JFileChooser
cannot select directories and any of the
files to select is a directory.@Nonnull public JFileChooserFixture setCurrentDirectory(@Nonnull File dir)
JFileChooser
to the given one.dir
- the directory to set as current.IllegalStateException
- if this fixture's JFileChooser
is disabled.IllegalStateException
- if this fixture's JFileChooser
is not showing on the screen.Copyright © 2014–2020 AssertJ. All rights reserved.