List of usage examples for com.intellij.openapi.options.colors ColorSettingsPage getAdditionalHighlightingTagToDescriptorMap
@Nullable Map<String, TextAttributesKey> getAdditionalHighlightingTagToDescriptorMap();
From source file:com.intellij.application.options.colors.SimpleEditorPreview.java
License:Apache License
public SimpleEditorPreview(final ColorAndFontOptions options, final ColorSettingsPage page, final boolean navigatable) { myOptions = options;//from w ww. j a va2s.c o m myPage = page; String text = page.getDemoText(); HighlightsExtractor extractant2 = new HighlightsExtractor( page.getAdditionalHighlightingTagToDescriptorMap()); List<HighlightData> highlights = new ArrayList<HighlightData>(); String stripped = extractant2.extractHighlights(text, highlights); myHighlightData = highlights.toArray(new HighlightData[highlights.size()]); int selectedLine = -1; myEditor = (EditorEx) FontEditorPreview.createPreviewEditor(stripped, 10, 3, selectedLine, myOptions, false); FontEditorPreview.installTrafficLights(myEditor); myBlinkingAlarm = new Alarm().setActivationComponent(myEditor.getComponent()); if (navigatable) { addMouseMotionListener(myEditor, page.getHighlighter(), myHighlightData, false); CaretListener listener = new CaretAdapter() { @Override public void caretPositionChanged(CaretEvent e) { navigate(myEditor, true, e.getNewPosition(), page.getHighlighter(), myHighlightData, false); } }; myEditor.getCaretModel().addCaretListener(listener); } }