Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » additional codetemplates in eclipse?
additional codetemplates in eclipse? [message #7516] Mon, 28 April 2003 14:20 Go to next message
Eclipse UserFriend
Originally posted by: dexters.gmx.de

Hi,

i would like to know, if it is "easily" possible to create new
codetemplates for and integrate them into eclipse?
here is what i want to do:

i want to write my own codetemplate, so that i can select
e.g "new->java->entityBean" and eclipse asks me for a filename,
reads my codetemplate, "copies" the content to that file
and opens it up in a new editor.

do i have to write my own plugin for this? if so, appr. how many
classes do i have write (just to get a picture if the result is
worth the effort ;) ?

best regards,
dex
Re: additional codetemplates in eclipse? [message #7528 is a reply to message #7516] Mon, 28 April 2003 16:10 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: muelleimer.usenet.katzien.de

* dexters <dexters@gmx.de> wrote:
> e.g "new->java->entityBean" and eclipse asks me for a filename,
> do i have to write my own plugin for this? if so, appr. how many
> classes do i have write (just to get a picture if the result is
> worth the effort ;) ?

Hm, should be (It's some time since I did something like this)

* Implement something from wizard and wizardpage (two classes, max
20 methods, I uess)
* write the xml to contribute it into the right place (Wizard :).
* Deplay as plugin (using the wizards for this)

But as you are doing it, you maybe want to write a more
generic one, so that others may contribute to this wizard

Something like this:
New -> Templates -> Ask 'which one' -> 'Contribution' askes
some questions -> sets up the file...

This would be really cool :) If you would then also get the
(unfortunatelly still internal) typecomment to fill in at the right
place... But maybe we should wait for the upcoming template API :)

Jan, dreaming...
Re: additional codetemplates in eclipse? [message #8058 is a reply to message #7528] Mon, 28 April 2003 19:06 Go to previous messageGo to next message
Eclipse UserFriend
> This would be really cool :) If you would then also get the
> (unfortunatelly still internal) typecomment to fill in at the right
> place...

It's not internal anymore since 2.1! Have a look at the class CodeTemplates.

Regarding Dex's question, you can't add an new code template at the
moment. But Jan is right, having a wizard will give you even more
possibilities (to react on the configured settings and e.g. create
methods).

Martin
Re: additional codetemplates in eclipse? [message #8088 is a reply to message #8058] Mon, 28 April 2003 19:12 Go to previous message
Eclipse UserFriend
Oops, not CodeTemplates, 'org.eclipse.jdt.ui.CodeGeneration'

Martin Aeschlimann wrote:
>> This would be really cool :) If you would then also get the
>> (unfortunatelly still internal) typecomment to fill in at the right
>> place...
>
>
> It's not internal anymore since 2.1! Have a look at the class
> CodeTemplates.
>
> Regarding Dex's question, you can't add an new code template at the
> moment. But Jan is right, having a wizard will give you even more
> possibilities (to react on the configured settings and e.g. create
> methods).
>
> Martin
>
Previous Topic:Unit Testing Plugin Code
Next Topic:Eclipse 2.2 vs. Eclipse 3.0
Goto Forum:
  


Current Time: Fri Jul 18 06:15:21 EDT 2025

Powered by FUDForum. Page generated in 0.08299 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top