how to add my own templates to eclipse in play! framework editor - eclipse

I've noticed that the play plugin for eclipse adds a play editor,
along with several useful templates
I'd like to add my own ones, but I couldn't find the way to do it
I go to window, preferences, web, html files, templates and I can add
templates to eclipse html editor, but I couldn't find a similar option
for play editor

Check out the source code for the play plugin :
https://github.com/playframework/playclipse/tree/master/source/templates
You might want to fork it and add your templates to that file. That is what I would do. But I do not have enough Eclipse development knowledge to help you further than point the direction.

I had a lok at the source, it seems like the template editor tags are defined here
https://github.com/playframework/playclipse/blob/master/source/src/org/playframework/playclipse/editors/html/HTMLEditor.java
looks like there's no support for creating your own templates thru eclipse...

Related

Play 2.0 with Eclipse 3.6, Scala template editing

I´m new to Play and Scala world, so I´m needing some help to figure out how can I edit the scala template files using Eclipse. I already installed scala ide 2.9 but when I try to edit the index.scala.html, the contents of the file aren´t editable...
Please can anyone help me?
I experienced this just recently, too, but lucky for you I made the full migration from IntelliJ to Eclipse.
There is some setting up you need to do with the Scala templates, but one of the easiest ways to get it done is following these steps:
Step 1: Add file extensions
http://help.eclipse.org/helios/index.jsp?topic=%2Forg.eclipse.platform.doc.user%2Ftasks%2Ftasks-51.xhtml
Be sure that your file extensions are properly added to the file associations.
Step 2:
Look at the associated editor. In the image above you'll see that the only associated editor with *.htm is Web Browser. So you'll need to hit the "Add..." button to add the Scala editor. Don't forget to set it as default :)
Step 3:
Right-click on your Scala template and be sure that you are choosing the right editor. You can also use this to switch between editors.
Hope this helps!

eclipse rcp :how to translate third-part plugin?

I am working on a eclipse rcp application.it use some third-part plugins, how can I translate text in these plugins?
In general internationalization is easy in eclipse. You can look for *.properties files which contains the strings which are used in the plugin. You can then define an own property file with your translation.
If no property files exist the plugin is not foreseen to be translated. In this case code changes are necessary.
See this howto for an example

Add functionality to all Eclipse TextEditors

I need to add some functionality to eclipse text editors. The goal is to get a Graphics Context or add a SWT Canvas to any and all Eclipse AbstractTextEditors and package these modifications within a plug-in (so by installing the plugin I provide, the editor modification will work for the Java Editor, XML Editor, plain text editor, etc.). Are there any extension points that would suffice for this purpose, or is my best bet with a fragment? Any help is appreciated.
I would recommend looking at the source code for AbstractTextEditor to see if an extension point exists for this purpose. If an extension point exists, it will be evident in that class source.
I would wager that such extension point does not exist. You are left with opening an enhancement request and in the meantime patching the plugin containing AbstractTextEditor plugin to alter the source of that file. A fragment isn't going to do the trick. Another alternative to consider is to learn and apply a bytecode weaving framework such as AspectJ (http://eclipse.org/ajdt/).

Is there a mustache template syntax highlighter or plugin for Eclipse?

I'm looking for a Mustache template syntax highlighter / plugin in Eclipse
Does one exist? I don't seem to be finding anything on google, and I don't know how to write my own for Eclipse.
Although not perfect, you can use Eclipse and set MUSTACHE template files to HTML.
Go to Eclipse->Preferences->General->Content_Types
Edit CONTENT_TYPE to add a file association of .mustache
Go to Eclipse->Preferences->General->Editor->File_Associations
You should see the default HTML editors already set. If not, add a .mustache editor of your choice. I used HTML_EDITOR.
Although it won't syntax highlight the {{ }}, it's still easier to read.
There doesn't seem to be any plugin for supporting mustache Editors and views (see Eclipse MarketPlace).
That leaves only for now using an external supported editor (i.e. outside of Eclipse)

Eclipse plugins for working with Apache Wicket projects

Are there any widely adopted, currently maintained Eclipse plugins for working with Apache Wicket projects? If so, where are they? Who maintains them? What do they do?
Take a look at Qwickie (eclipse plugin): https://github.com/count-negative/qwickie
The standard used to be wicket bench, but it has been discontinued and you can find a fork named stump.
I don't know stump, but wicket bench mainly had a refactoring listener (if you rename a java class, the HTML is also renamed) and some wizards (create a Panel with associated markup etc).
I haven't used bench in years, as it was rather buggy in newer eclipse versions. But I have made pretty good experiences using a custom set of eclipse HTML templates that you can download from this location: http://www.wicket-praxis.de/blog/wp-content/uploads/2010/01/wicket-template.xml
(German) description on this page: http://www.wicket-praxis.de/blog/download/
You can install these as HTML Code Templates in Eclipse:
Window -> Preferences -> Web -> HTML Files -> Editor -> Templates -> Import...
and that will enable wicket-specific template shortcuts in the HTML editor.
It's too bad you don't use IntelliJ IDEA. It has an excellent plugin called WicketForge.
Not right on the question, but not completely off it, either.
I have released a tool that can be used as an eclipse save action. It generates Java interfaces with constants for ids in wicket templates and resource keys from translation files, so that you don't need to use strings for component ids and translation keys, but can use these generated constants.
It can be integrated in eclipse quite simply as an annotation processor. After a save of a component the interfaces will be generated and built. See its readme:
https://github.com/neurolabs/wicket-id-bindings-generator
I'm maintaining it on github (feel free to fork/contribute) and am using it in all of my wicket projects.