Community
Participate
Working Groups
Add an Ant preference page for defining templates.
Created attachment 9924 [details] initial patch for templates prefrence page Initial work on the templates preference page. It isn't really ready for release as the syntax highlighting doesn't work yet. I have written a little code for the syntax highlighting, but it will be fairly obvious that I don't really know what I am doing there. Plenty of garbage code. We may want to refactor the AntEditorSourceViewerConfiguration so that it (or probably a new superclass of it) can be used in contexts like this one. Currently AntEditorSourceViewerConfiguration expects to have a reference to the Editor--which won't work for us here. Darin, if you'd give me a pointer or two here, I'll try to get it wrapped up.
syntax highlighting does not work for the Java editor either :-) so we might not sweat this fact. As well it appears that the formatting is not hitched up for the Java templates either. I believe I could add this early this afternoon.
I have released the code in its current state. I renamed the preference page.
I also moved the formatter and template pages under the editor page. Let me know what you think?
Good call on the relocation of the preference pages under editor. As far as the syntax highlighting goes, the area I was speaking of is preview pane on that displays the template one it is selected in the template. I did just confirm that this works in JavaTemplatePreferencePage which subclasses TemplatePreferencePage as we do. Try selecting the template for 'try'. If you'd like to deal with the syntax highlighting issue in another bug, let me know and I'll send you a fresh patch without the lame code which attempts to get it working. I'd rather not be a contributor of dead code :).
The Java editor Templates do not seem to be doing syntax highlighting for me. Workbench>Java>Editor>Templates>try The preview is all in black and white...no syntax coloring. Ok now I see, JDT UI has much more implemented in HEAD. I will take a look. I have spent about 1 hour getting the formatting and trying to get the syntax highlighting. I will try to spend a bit more time tonight. No need for you to send a patch...I can cut out whatever does not look promising later tonight or tomorrow morning.
Created the AbstractAntSourceViewerConfiguration. Made AntEditorSourceViewerConfiguration a subclass, created AntTemplateViewerConfiguration. Created AntTemplateVariableTextHover. Some changes to AntTemplatePreferencePage, XMLTextHover, AntEditorPreferenceConstants. I also renamed the template contexts to Ant and Ant Task: changes to plugin.properties. Other bugs we find in this area (such as the formatting is not quite correct etc) we should log as separate issues.
Please verify John-Mason.