Example usage for com.intellij.openapi.ui DialogWrapper show

List of usage examples for com.intellij.openapi.ui DialogWrapper show

Introduction

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

Prototype

public void show() 

Source Link

Document

Show the dialog.

Usage

From source file:org.jetbrains.android.util.AndroidUtils.java

License:Apache License

public static void showStackStace(@NotNull final Project project, @NotNull Throwable[] throwables) {
    final StringBuilder messageBuilder = new StringBuilder();

    for (Throwable t : throwables) {
        if (messageBuilder.length() > 0) {
            messageBuilder.append("\n\n");
        }// ww w.j av a 2  s.  co  m
        messageBuilder.append(AndroidCommonUtils.getStackTrace(t));
    }

    final DialogWrapper wrapper = new DialogWrapper(project, false) {

        {
            init();
        }

        @Override
        protected JComponent createCenterPanel() {
            final JPanel panel = new JPanel(new BorderLayout());
            final JTextArea textArea = new JTextArea(messageBuilder.toString());
            textArea.setEditable(false);
            textArea.setRows(40);
            textArea.setColumns(70);
            panel.add(ScrollPaneFactory.createScrollPane(textArea));
            return panel;
        }
    };
    wrapper.setTitle("Stack trace");
    wrapper.show();
}

From source file:org.jetbrains.jet.plugin.versions.KotlinLibrariesNotificationProvider.java

License:Apache License

private static EditorNotificationPanel createFrameworkConfigurationNotificationPanel(final Module module) {
    EditorNotificationPanel answer = new EditorNotificationPanel();

    answer.setText("Kotlin is not configured for module '" + module.getName() + "'");
    answer.createActionLabel("Set up module '" + module.getName() + "' as JVM Kotlin module", new Runnable() {
        @Override/*w  ww.j  a  v a2s.c  o  m*/
        public void run() {
            DialogWrapper dialog = AddSupportForSingleFrameworkDialog.createDialog(module,
                    new JavaFrameworkSupportProvider());
            if (dialog != null) {
                dialog.show();
            }
        }
    });

    answer.createActionLabel("Set up module '" + module.getName() + "' as JavaScript Kotlin module",
            new Runnable() {
                @Override
                public void run() {
                    DialogWrapper dialog = AddSupportForSingleFrameworkDialog.createDialog(module,
                            new JSFrameworkSupportProvider());
                    if (dialog != null) {
                        dialog.show();
                    }
                }
            });

    return answer;
}

From source file:org.napile.idea.thermit.config.impl.configuration.AntSetPanel.java

License:Apache License

@Nullable
public AntInstallation showDialog(JComponent parent) {
    final DialogWrapper dialog = new MyDialog(parent);
    dialog.show();
    if (!dialog.isOK()) {
        return null;
    }/*from  ww w.  j av  a2  s . c om*/

    apply();
    return myForm.getSelectedAnt();
}