Community
Participate
Working Groups
Hello, I saw that Eclipse had implemenented a template feature, and it is very useful ... Nevertheless, it runs only for java source code, and not for other file types... For instance, we want to edit a JSP file and we want to add some template for this type of file... It seems that we couldn't use the template written by using a CTRL-Space... Is it true? Actually, it could be useful to be able to describe templates like a Clip library in Textpad, clip dedicated to a particular type of file... Best regards Xavier
for 2.0 templates are constrained to the Java editor only. we will consider generalizing templates after 2.0
Reopening for 2.1 consideration
"Unassign" PRs because of changes in staffing
*** Bug 33639 has been marked as a duplicate of this bug. ***
Progress so far: - LinkedPosition infrastructure has been moved down - package org.eclipse.jface.text.link (check both org.eclipse.jface.text and org.eclipse.text) - org.eclipse.ui.texteditor.link Everything is still moving, but I don't expect too many changes to the API here. There were some screen updating problems when I tested it with the text editor which will need fixing (probably by making use of some generic painting infrastructure, not using AnnotationPainter any longer). - A first cut of Templates has been moved down - package org.eclipse.jface.text.templates in org.eclipse.text - package org.eclipse.jface.text.templates in org.eclipse.jface.text - package org.eclipse.ui.workbench.texteditor.templates This transition is still very much incomplete. There is no contribution story, no preference page etc etc. I will attach a very crude patch to TextEditor that shows how the template stuff can be used. Feel free to play around, please attach comments to this bug report.
Created attachment 8218 [details] example of using templates in TextEditor Adds a new action bound to Ctrl+5 to the texteditor which will insert a template. Screen updating is still buggy.
Changing milestone to M9.
.
fixed > 20040330 (everything is in M8 already, besides the Java editor using the new infrastructure). -- Added the org.eclipse.ui.editors.templates extension point. You can: - add templates to existing context types (e.g. "java" and "javadoc" context types in the java editor) - define your own context types for your custom editor - define variable resolvers for an existing context type As an editor implementor, you have the choice of whether you want to allow contributed variable resolvers for the context types you define. The java editor does not pick them up currently. -- See the example template editor in the org.eclipse.ui.examples.javaeditor plug-in for an example of how you can add templates to your custom editor. You also get: - A store for contributed and (possibly) user-added templates - An almost complete skeleton of a templates preference page - content assist proposals for templates