use of com.intellij.openapi.editor.ex.util.LexerEditorHighlighter in project intellij-community by JetBrains.
the class LanguagePanel method updateHighlighters.
void updateHighlighters() {
final EditorImpl editor = ((EditorImpl) myPrefix.getEditor());
if (editor == null)
return;
final EditorImpl editor2 = ((EditorImpl) mySuffix.getEditor());
assert editor2 != null;
final Language language = InjectedLanguage.findLanguageById(getLanguage());
if (language == null) {
editor.setHighlighter(new LexerEditorHighlighter(new PlainSyntaxHighlighter(), editor.getColorsScheme()));
editor2.setHighlighter(new LexerEditorHighlighter(new PlainSyntaxHighlighter(), editor.getColorsScheme()));
} else {
final SyntaxHighlighter s1 = SyntaxHighlighterFactory.getSyntaxHighlighter(language, myProject, null);
final SyntaxHighlighter s2 = SyntaxHighlighterFactory.getSyntaxHighlighter(language, myProject, null);
editor.setHighlighter(new LexerEditorHighlighter(s1, editor.getColorsScheme()));
editor2.setHighlighter(new LexerEditorHighlighter(s2, editor2.getColorsScheme()));
}
}
use of com.intellij.openapi.editor.ex.util.LexerEditorHighlighter 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);
}
}
Aggregations