/** * Simulates a user decrementing the value of this fixture's {@code JSpinner} one time. * * @return this fixture. * @throws IllegalStateException if this fixture's {@code JSpinner} is disabled. * @throws IllegalStateException if this fixture's {@code JSpinner} is not showing on the screen. */ @Nonnull public JSpinnerFixture decrement() { driver().decrement(target()); return this; }
@RunsInEDT @Override @Nonnull public JSpinnerFixture spinner(@Nonnull GenericTypeMatcher<? extends JSpinner> matcher) { return new JSpinnerFixture(robot(), find(matcher)); }
public StartSocketListenerDialog setPort(int port) { me().spinner("StartSocketListenerDialog.port").select(Integer.valueOf(port)); return this; }
@RunsInEDT @Override @Nonnull public JSpinnerFixture spinner(@Nullable String name) { return new JSpinnerFixture(robot(), findByName(name, JSpinner.class)); }
/** * Simulates a user incrementing the value of this fixture's {@code JSpinner} the given number of times. * * @param times how many times the value of this fixture's {@code JSpinner} should be incremented. * @return this fixture. * @throws IllegalArgumentException if {@code times} is less than or equal to zero. * @throws IllegalStateException if this fixture's {@code JSpinner} is disabled. * @throws IllegalStateException if this fixture's {@code JSpinner} is not showing on the screen. */ @Nonnull public JSpinnerFixture increment(int times) { driver().increment(target(), times); return this; }
@RunsInEDT @Override @Nonnull public JSpinnerFixture spinner() { return new JSpinnerFixture(robot(), findByType(JSpinner.class)); }
/** * Simulates a user incrementing the value of this fixture's {@code JSpinner} one time. * * @return this fixture. * @throws IllegalStateException if this fixture's {@code JSpinner} is disabled. * @throws IllegalStateException if this fixture's {@code JSpinner} is not showing on the screen. */ @Nonnull public JSpinnerFixture increment() { driver().increment(target()); return this; }
/** * Returns the text displayed by this fixture's {@code JSpinner}. This method first tries to get the text displayed in * the {@code JSpinner}'s editor, assuming it is a {@code JTextComponent}. If the text from the editor cannot be * retrieved, it will return the {@code String} representation of the value in the {@code JSpinner}'s model. * * @return the text displayed by this fixture's {@code JSpinner}. */ @Nullable public String text() { return driver().textOf(target()); } }
/** * Simulates a user decrementing the value of this fixture's {@code JSpinner} the given number of times. * * @param times how many times the value of this fixture's {@code JSpinner} should be decremented. * @return this fixture. * @throws IllegalArgumentException if {@code times} is less than or equal to zero. * @throws IllegalStateException if this fixture's {@code JSpinner} is disabled. * @throws IllegalStateException if this fixture's {@code JSpinner} is not showing on the screen. */ @Nonnull public JSpinnerFixture decrement(int times) { driver().decrement(target(), times); return this; }
/** * Verifies that the value of this fixture's {@code JSpinner} is equal to the given one. * * @param value the expected value of this fixture's {@code JSpinner}. * @return this fixture. * @throws AssertionError if the value of this fixture's {@code JSpinner} is not equal to the given one. */ @Nonnull public JSpinnerFixture requireValue(@Nonnull Object value) { driver().requireValue(target(), value); return this; }
/** * Selects the given value in this fixture's {@code JSpinner}. * * @param value the value to select. * @return this fixture. * @throws IllegalStateException if this fixture's {@code JSpinner} is disabled. * @throws IllegalStateException if this fixture's {@code JSpinner} is not showing on the screen. * @throws IllegalArgumentException if the {@code JSpinner} does not support the specified {@code value}. */ public JSpinnerFixture select(@Nonnull Object value) { driver().selectValue(target(), value); return this; }
/** * Simulates a user entering and committing the given text in this fixture's {@code JSpinner} (assuming its editor has * a {@code JTextComponent} under it). * * @param text the text to enter. * @return this fixture. * @throws IllegalStateException if this fixture's {@code JSpinner} is disabled. * @throws IllegalStateException if this fixture's {@code JSpinner} is not showing on the screen. * @throws org.assertj.swing.exception.ActionFailedException if the editor of the {@code JSpinner} is not a {@code JTextComponent} or cannot be * found. * @throws org.assertj.swing.exception.UnexpectedException if the entering the text in the {@code JSpinner}'s editor fails. */ @Nonnull public JSpinnerFixture enterTextAndCommit(String text) { driver().enterTextAndCommit(target(), text); return this; }
/** * Simulates a user entering the given text in this fixture's {@code JSpinner} (assuming its editor has a * {@code JTextComponent} under it). This method does not commit the value to the {@code JSpinner}. * * @param text the text to enter. * @return this fixture. * @throws IllegalStateException if this fixture's {@code JSpinner} is disabled. * @throws IllegalStateException if this fixture's {@code JSpinner} is not showing on the screen. * @throws org.assertj.swing.exception.ActionFailedException if the editor of the {@code JSpinner} is not a {@code JTextComponent} or cannot be * found. * @throws org.assertj.swing.exception.UnexpectedException if the entering the text in the {@code JSpinner}'s editor fails. */ @Nonnull public JSpinnerFixture enterText(@Nonnull String text) { driver().enterText(target(), text); return this; }