Example usage for com.intellij.openapi.ui TestInputDialog TestInputDialog

List of usage examples for com.intellij.openapi.ui TestInputDialog TestInputDialog

Introduction

In this page you can find the example usage for com.intellij.openapi.ui TestInputDialog TestInputDialog.

Prototype

TestInputDialog

Source Link

Usage

From source file:org.intellij.xquery.runner.ui.run.main.variables.ContextItemPanelGuiTest.java

License:Apache License

@Test
public void shouldShowDialogAfterEditorContextButtonClickedAndSetValue() {
    final String myValue = "my Content";
    final boolean[] dialogShown = { false };
    initPanel(true, null, null, true, null);
    TestInputDialog oldDialog = Messages.setTestInputDialog(new TestInputDialog() {
        @Override//www  .  jav a2s  .c  o  m
        public String show(String message) {
            dialogShown[0] = true;
            return myValue;
        }
    });

    window.button(SHOW_EDITOR_BUTTON).click();

    assertThat(dialogShown[0], is(true));
    assertThat(panel.getContextItemEditorContent(), is(myValue));
    Messages.setTestInputDialog(oldDialog);
}