Package javax.swing

Examples of javax.swing.JOptionPane


  static JOptionPane messageWithOptions(final Object... options) {
    return execute(new GuiQuery<JOptionPane>() {
      @Override
      protected JOptionPane executeInEDT() {
        Object initialValue = options[0];
        JOptionPane optionPane = new JOptionPane(MESSAGE, QUESTION_MESSAGE, YES_NO_OPTION, ICON, options, initialValue);
        optionPane.setInitialValue(initialValue);
        return optionPane;
      }
    });
  }
View Full Code Here


  @RunsInEDT
  static JOptionPane messageWithValue(final Object message) {
    return execute(new GuiQuery<JOptionPane>() {
      @Override
      protected JOptionPane executeInEDT() {
        return new JOptionPane(message);
      }
    });
  }
View Full Code Here

  @RunsInEDT
  static JOptionPane messageOfType(final int type) {
    return execute(new GuiQuery<JOptionPane>() {
      @Override
      protected JOptionPane executeInEDT() {
        return new JOptionPane(MESSAGE, type);
      }
    });
  }
View Full Code Here

    @RunsInEDT
    public JOptionPane createNew() {
      return GuiActionRunner.execute(new GuiQuery<JOptionPane>() {
        @Override
        protected JOptionPane executeInEDT() {
          JOptionPane optionPane = new JOptionPane();
          optionPane.setMessage(message);
          optionPane.setMessageType(messageType);
          optionPane.setName(name);
          optionPane.setOptionType(optionType);
          return optionPane;
        }
      });
    }
View Full Code Here

* @author Alex Ruiz
*/
public class JOptionPaneDriver_requireOptions_Test extends JOptionPaneDriver_TestCase {
  @Test
  public void should_pass_if_options_are_equal_to_expected() {
    JOptionPane optionPane = messageWithOptions("First", "Second");
    pack(optionPane, title());
    driver.requireOptions(optionPane, array("First", "Second"));
  }
View Full Code Here

    pack(optionPane, title());
    driver.requireOptions(optionPane, array("First", "Second"));
  }

  public void should_fail_if_options_are_not_equal_to_expected() {
    JOptionPane optionPane = messageWithOptions("First", "Second");
    pack(optionPane, title());
    try {
      driver.requireOptions(optionPane, array("Third"));
      failWhenExpectingException();
    } catch (AssertionError e) {
View Full Code Here

* @author Alex Ruiz
*/
public class JOptionPaneDriver_noButton_Test extends JOptionPaneDriver_TestCase {
  @Test
  public void should_find_No_button() {
    JOptionPane optionPane = confirmMessage();
    launch(optionPane, title());
    JButton button = driver.noButton(optionPane);
    assertThatButtonHasText(button, "OptionPane.noButtonText");
  }
View Full Code Here

* @author Alex Ruiz
*/
public class JOptionPaneDriver_requireInfomationMessage_Test extends JOptionPaneDriver_TestCase {
  @Test
  public void should_pass_if_error_type_is_equal_to_expected() {
    JOptionPane optionPane = informationMessage();
    pack(optionPane, title());
    driver.requireInformationMessage(optionPane);
  }
View Full Code Here

    driver.requireInformationMessage(optionPane);
  }

  @Test
  public void should_fail_if_error_type_is_not_equal_to_expected() {
    JOptionPane optionPane = errorMessage();
    pack(optionPane, title());
    try {
      driver.requireInformationMessage(optionPane);
      failWhenExpectingException();
    } catch (AssertionError e) {
View Full Code Here

* @author Alex Ruiz
*/
public class JOptionPaneDriver_title_Test extends JOptionPaneDriver_TestCase {
  @Test
  public void should_return_title() {
    JOptionPane optionPane = informationMessage();
    pack(optionPane, title());
    assertThat(driver.title(optionPane)).isEqualTo(title());
  }
View Full Code Here

TOP

Related Classes of javax.swing.JOptionPane

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.