ColorSettingPage for annotator highlighting
I've created an annotator that highlights some elements of Java and HTML files.
Now i want to provide a ColorSettingPage so that the user can configure the display colors. This seems to work fine except for the preview part. It seems that the preview only works if you provide highlighting at lexer level.
I say this because the ColorSettingsPage interface provides a getHighlighter() that is what does the hightlighting in the preview, but i don't have any highlighter because i use an annotator.
Is there any way i can do this ?
Please sign in to leave a comment.
Yes, you can :)
provide from ColorSettingsPage
getAdditionalHighlightingTagToDescriptorMap()
a map from XML-tag-name to TAK
now you can show a textual preview (getDemoText()) and use the mapped tags there, e.g. "demo text for text attributes with key myKey1]]>"
HTH,
Yann
Cool, i completly missed that method....
Still, when using it keep getting an exception when i open the configuration window and nothing shows up:
java.util.EmptyStackException
at java.util.Stack.peek(Stack.java:79)
at java.util.Stack.pop(Stack.java:61)
at com.intellij.application.options.colors.highlighting.HighlightsExtractor.extractHighlights(HighlightsExtractor.java:2)
at com.intellij.application.options.colors.ColorAndFontPanel.a(ColorAndFontPanel.java:354)
at com.intellij.application.options.colors.ColorAndFontPanel.c(ColorAndFontPanel.java:91)
at com.intellij.application.options.colors.ColorAndFontPanel.b(ColorAndFontPanel.java:18)
at com.intellij.application.options.colors.ColorAndFontPanel.]]>(ColorAndFontPanel.java:345)
at com.intellij.application.options.colors.ColorAndFontOptions.createComponent(ColorAndFontOptions.java:25)
at com.intellij.ide.ui.search.DefaultSearchableConfigurable.createComponent(DefaultSearchableConfigurable.java:18)
at com.intellij.openapi.options.ex.SingleConfigurableEditor.createCenterPanel(SingleConfigurableEditor.java:62)
Any idea why this happens ?
just guessing, but did you miss a closing tag in your demo text?
No, i didn't, but after your comment i starting to change the demo text and i only the exception when at least one tag in the demo text matches on of the given tag returned by the getAdditionalHighlightingTagToDescriptorMap. Still have no idea why....
Can you post your source?
Sure, you can see the class here http://www.javaforge.com/sccShowFileRevision/TemplateColorSettingsPage.java?proj_id=461&tag=454&date=Jan082007+17%3A59&filename=branches%2FT5%2Fsrc%2Fmain%2Fjava%2Fcom%2Fintellij%2Ftapestry%2Flang%2FTemplateColorSettingsPage.java
Sorry to bump this, but i still can't find any solution......
It seems i only get the exception if the tag has declared attributes in the demo text. I've create an issue in JIRA as this looks like a bug (http://www.jetbrains.net/jira/browse/IDEA-11021).