Search in sources :

Example 31 with DialogBuilder

use of com.intellij.openapi.ui.DialogBuilder in project intellij-community by JetBrains.

the class GitUtil method showPathsInDialog.

public static void showPathsInDialog(@NotNull Project project, @NotNull Collection<String> absolutePaths, @NotNull String title, @Nullable String description) {
    DialogBuilder builder = new DialogBuilder(project);
    builder.setCenterPanel(new GitSimplePathsBrowser(project, absolutePaths));
    if (description != null) {
        builder.setNorthPanel(new MultiLineLabel(description));
    }
    builder.addOkAction();
    builder.setTitle(title);
    builder.show();
}
Also used : GitSimplePathsBrowser(git4idea.util.GitSimplePathsBrowser) DialogBuilder(com.intellij.openapi.ui.DialogBuilder) MultiLineLabel(com.intellij.openapi.ui.ex.MultiLineLabel)

Example 32 with DialogBuilder

use of com.intellij.openapi.ui.DialogBuilder in project intellij-community by JetBrains.

the class TextControl method createMainComponent.

@Override
protected TextPanel createMainComponent(TextPanel boundedComponent, final Project project) {
    if (boundedComponent == null) {
        boundedComponent = new TextPanel();
    }
    boundedComponent.removeAll();
    final Function<String, Document> factory = s -> PsiDocumentManager.getInstance(project).getDocument(PsiFileFactory.getInstance(project).createFileFromText("a.txt", PlainTextLanguage.INSTANCE, "", true, false));
    final TextPanel boundedComponent1 = boundedComponent;
    final EditorTextField editorTextField = new EditorTextField(factory.fun(""), project, FileTypes.PLAIN_TEXT) {

        @Override
        protected EditorEx createEditor() {
            final EditorEx editor = super.createEditor();
            return boundedComponent1 instanceof MultiLineTextPanel ? makeBigEditor(editor, ((MultiLineTextPanel) boundedComponent1).getRowCount()) : editor;
        }

        @Override
        protected boolean isOneLineMode() {
            return false;
        }
    };
    if (boundedComponent instanceof BigTextPanel) {
        final ReferenceEditorWithBrowseButton editor = new ReferenceEditorWithBrowseButton(null, editorTextField, factory);
        boundedComponent.add(editor);
        editor.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                EditorTextField textArea = new EditorTextField(editorTextField.getDocument(), project, FileTypes.PLAIN_TEXT) {

                    @Override
                    protected EditorEx createEditor() {
                        final EditorEx editor = super.createEditor();
                        editor.setEmbeddedIntoDialogWrapper(true);
                        return makeBigEditor(editor, 5);
                    }

                    @Override
                    protected boolean isOneLineMode() {
                        return false;
                    }
                };
                DialogBuilder builder = new DialogBuilder(project);
                builder.setDimensionServiceKey("TextControl");
                builder.setCenterPanel(textArea);
                builder.setPreferredFocusComponent(textArea);
                builder.setTitle(UIBundle.message("big.text.control.window.title"));
                builder.addCloseButton();
                builder.show();
            }
        });
        return boundedComponent;
    }
    boundedComponent.add(editorTextField);
    return boundedComponent;
}
Also used : EditorTextField(com.intellij.ui.EditorTextField) PsiFileFactory(com.intellij.psi.PsiFileFactory) ActionListener(java.awt.event.ActionListener) Document(com.intellij.openapi.editor.Document) ActionEvent(java.awt.event.ActionEvent) java.awt(java.awt) DialogBuilder(com.intellij.openapi.ui.DialogBuilder) ReferenceEditorWithBrowseButton(com.intellij.ui.ReferenceEditorWithBrowseButton) Function(com.intellij.util.Function) FileTypes(com.intellij.openapi.fileTypes.FileTypes) Project(com.intellij.openapi.project.Project) EditorEx(com.intellij.openapi.editor.ex.EditorEx) UIBundle(com.intellij.ui.UIBundle) NotNull(org.jetbrains.annotations.NotNull) PlainTextLanguage(com.intellij.openapi.fileTypes.PlainTextLanguage) PsiDocumentManager(com.intellij.psi.PsiDocumentManager) javax.swing(javax.swing) EditorEx(com.intellij.openapi.editor.ex.EditorEx) ActionEvent(java.awt.event.ActionEvent) Document(com.intellij.openapi.editor.Document) ActionListener(java.awt.event.ActionListener) EditorTextField(com.intellij.ui.EditorTextField) ReferenceEditorWithBrowseButton(com.intellij.ui.ReferenceEditorWithBrowseButton) DialogBuilder(com.intellij.openapi.ui.DialogBuilder)

Example 33 with DialogBuilder

use of com.intellij.openapi.ui.DialogBuilder in project Intellij-Plugin by getgauge.

the class ExtractConceptInfoCollector method showDialog.

private void showDialog(String steps, ExtractConceptDialog form) {
    final DialogBuilder builder = new DialogBuilder(editor.getProject());
    form.setData(steps, getConceptFileNames(), builder);
    builder.setCenterPanel(form.getRootPane());
    builder.setTitle("Extract Concept");
    builder.removeAllActions();
    builder.show();
}
Also used : DialogBuilder(com.intellij.openapi.ui.DialogBuilder)

Aggregations

DialogBuilder (com.intellij.openapi.ui.DialogBuilder)33 ActionEvent (java.awt.event.ActionEvent)7 AnActionEvent (com.intellij.openapi.actionSystem.AnActionEvent)4 Project (com.intellij.openapi.project.Project)4 Module (com.intellij.openapi.module.Module)3 GradleBuildFile (com.android.tools.idea.gradle.parser.GradleBuildFile)2 Disposable (com.intellij.openapi.Disposable)2 AnAction (com.intellij.openapi.actionSystem.AnAction)2 CustomShortcutSet (com.intellij.openapi.actionSystem.CustomShortcutSet)2 EditorEx (com.intellij.openapi.editor.ex.EditorEx)2 FileChooserDescriptor (com.intellij.openapi.fileChooser.FileChooserDescriptor)2 FrameWrapper (com.intellij.openapi.ui.FrameWrapper)2 MultiLineLabel (com.intellij.openapi.ui.ex.MultiLineLabel)2 Pair (com.intellij.openapi.util.Pair)2 PsiFile (com.intellij.psi.PsiFile)2 JBTextField (com.intellij.ui.components.JBTextField)2 NotNull (org.jetbrains.annotations.NotNull)2 Nullable (org.jetbrains.annotations.Nullable)2 ApkDiffPanel (com.android.tools.idea.apk.viewer.diff.ApkDiffPanel)1 ApkDiffParser (com.android.tools.idea.apk.viewer.diff.ApkDiffParser)1