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

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

Introduction

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

Prototype

public void setTitle(@Nls(capitalization = Nls.Capitalization.Title) String title) 

Source Link

Usage

From source file:com.intellij.ide.actions.ViewStructureAction.java

License:Apache License

@Override
public void actionPerformed(AnActionEvent e) {
    Project project = e.getData(CommonDataKeys.PROJECT);
    if (project == null)
        return;//from   w w w .java 2 s .co  m
    final FileEditor fileEditor = e.getData(PlatformDataKeys.FILE_EDITOR);
    if (fileEditor == null)
        return;
    final VirtualFile virtualFile;

    final Editor editor = e.getData(CommonDataKeys.EDITOR);
    if (editor != null) {
        PsiDocumentManager.getInstance(project).commitDocument(editor.getDocument());
        PsiFile psiFile = PsiDocumentManager.getInstance(project).getPsiFile(editor.getDocument());
        if (psiFile == null)
            return;

        virtualFile = psiFile.getVirtualFile();
    } else {
        virtualFile = e.getData(CommonDataKeys.VIRTUAL_FILE);
    }
    String title = virtualFile == null ? fileEditor.getName() : virtualFile.getName();

    FeatureUsageTracker.getInstance().triggerFeatureUsed("navigation.popup.file.structure");

    Navigatable navigatable = e.getData(CommonDataKeys.NAVIGATABLE);
    if (Registry.is("file.structure.tree.mode")) {
        FileStructurePopup popup = createPopup(project, fileEditor);
        if (popup == null)
            return;

        popup.setTitle(title);
        popup.show();
    } else {
        DialogWrapper dialog = createDialog(editor, project, navigatable, fileEditor);
        if (dialog == null)
            return;

        dialog.setTitle(title);
        dialog.show();
    }
}

From source file:org.cordovastudio.utils.CordovaStudioUtils.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");
        }/*from w  w w.ja  v  a2s  .  co m*/
        messageBuilder.append(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.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");
        }/*from ww w  .  j  a  v  a  2s.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.idea.svn.dialogs.SvnInteractiveAuthenticationProvider.java

License:Apache License

private static void setTitle(@NotNull DialogWrapper dialog, @Nullable SVNErrorMessage errorMessage) {
    dialog.setTitle(errorMessage == null ? SvnBundle.message("dialog.title.authentication.required")
            : SvnBundle.message("dialog.title.authentication.required.was.failed"));
}