Search in sources :

Example 51 with EditorTextField

use of com.intellij.ui.EditorTextField in project azure-tools-for-java by Microsoft.

the class AzureSdkArtifactGroupPanel method buildCodeViewer.

private EditorTextField buildCodeViewer() {
    final Project project = ProjectManager.getInstance().getOpenProjects()[0];
    final DocumentImpl document = new DocumentImpl("", true);
    final EditorTextField viewer = new EditorTextField(document, project, XmlFileType.INSTANCE, true, false);
    viewer.addSettingsProvider(editor -> {
        // add scrolling/line number features
        editor.setHorizontalScrollbarVisible(true);
        editor.setVerticalScrollbarVisible(true);
        editor.getSettings().setLineNumbersShown(true);
    });
    return viewer;
}
Also used : Project(com.intellij.openapi.project.Project) EditorTextField(com.intellij.ui.EditorTextField) DocumentImpl(com.intellij.openapi.editor.impl.DocumentImpl)

Example 52 with EditorTextField

use of com.intellij.ui.EditorTextField in project intellij by bazelbuild.

the class BlazeAndroidBinaryRunConfigurationStateEditor method createUIComponents.

private void createUIComponents(Project project) {
    final EditorTextField editorTextField = new LanguageTextField(PlainTextLanguage.INSTANCE, project, "") {

        @Override
        protected EditorEx createEditor() {
            final EditorEx editor = super.createEditor();
            final PsiFile file = PsiDocumentManager.getInstance(project).getPsiFile(editor.getDocument());
            if (file != null) {
                DaemonCodeAnalyzer.getInstance(project).setHighlightingEnabled(file, false);
            }
            editor.putUserData(ACTIVITY_CLASS_TEXT_FIELD_KEY, BlazeAndroidBinaryRunConfigurationStateEditor.this);
            return editor;
        }
    };
    activityField = new ComponentWithBrowseButton<EditorTextField>(editorTextField, null);
}
Also used : EditorEx(com.intellij.openapi.editor.ex.EditorEx) EditorTextField(com.intellij.ui.EditorTextField) PsiFile(com.intellij.psi.PsiFile) LanguageTextField(com.intellij.ui.LanguageTextField)

Aggregations

EditorTextField (com.intellij.ui.EditorTextField)52 Document (com.intellij.openapi.editor.Document)12 NotNull (org.jetbrains.annotations.NotNull)12 DocumentEvent (com.intellij.openapi.editor.event.DocumentEvent)9 DocumentAdapter (com.intellij.openapi.editor.event.DocumentAdapter)7 EditorEx (com.intellij.openapi.editor.ex.EditorEx)6 Project (com.intellij.openapi.project.Project)5 EditorComboBoxEditor (com.intellij.ui.EditorComboBoxEditor)5 EditorComboBoxRenderer (com.intellij.ui.EditorComboBoxRenderer)5 StringComboboxEditor (com.intellij.ui.StringComboboxEditor)5 ComboBox (com.intellij.openapi.ui.ComboBox)4 Editor (com.intellij.openapi.editor.Editor)3 ExternalSystemUiAware (com.intellij.openapi.externalSystem.ExternalSystemUiAware)3 FileChooserDescriptor (com.intellij.openapi.fileChooser.FileChooserDescriptor)3 FixedSizeButton (com.intellij.openapi.ui.FixedSizeButton)3 VerticalFlowLayout (com.intellij.openapi.ui.VerticalFlowLayout)3 PsiFile (com.intellij.psi.PsiFile)3 LanguageTextField (com.intellij.ui.LanguageTextField)3 JBLabel (com.intellij.ui.components.JBLabel)3 Nullable (org.jetbrains.annotations.Nullable)3