Search in sources :

Example 1 with XmlFileHighlighter

use of com.intellij.ide.highlighter.XmlFileHighlighter in project intellij-community by JetBrains.

the class GuiEditor method showFormSource.

public void showFormSource() {
    EditorFactory editorFactory = EditorFactory.getInstance();
    Editor editor = editorFactory.createViewer(myDocument, myProject);
    try {
        ((EditorEx) editor).setHighlighter(new LexerEditorHighlighter(new XmlFileHighlighter(), EditorColorsManager.getInstance().getGlobalScheme()));
        JComponent component = editor.getComponent();
        component.setPreferredSize(new Dimension(640, 480));
        DialogBuilder dialog = new DialogBuilder(myProject);
        dialog.title("Form - " + myFile.getPresentableName()).dimensionKey("GuiDesigner.FormSource.Dialog");
        dialog.centerPanel(component).setPreferredFocusComponent(editor.getContentComponent());
        dialog.addOkAction();
        dialog.show();
    } finally {
        editorFactory.releaseEditor(editor);
    }
}
Also used : EditorFactory(com.intellij.openapi.editor.EditorFactory) EditorEx(com.intellij.openapi.editor.ex.EditorEx) LexerEditorHighlighter(com.intellij.openapi.editor.ex.util.LexerEditorHighlighter) XmlFileHighlighter(com.intellij.ide.highlighter.XmlFileHighlighter) UIFormEditor(com.intellij.uiDesigner.editor.UIFormEditor) Editor(com.intellij.openapi.editor.Editor) DialogBuilder(com.intellij.openapi.ui.DialogBuilder)

Aggregations

XmlFileHighlighter (com.intellij.ide.highlighter.XmlFileHighlighter)1 Editor (com.intellij.openapi.editor.Editor)1 EditorFactory (com.intellij.openapi.editor.EditorFactory)1 EditorEx (com.intellij.openapi.editor.ex.EditorEx)1 LexerEditorHighlighter (com.intellij.openapi.editor.ex.util.LexerEditorHighlighter)1 DialogBuilder (com.intellij.openapi.ui.DialogBuilder)1 UIFormEditor (com.intellij.uiDesigner.editor.UIFormEditor)1