Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » How to modify the class template ?
How to modify the class template ? [message #184504] Fri, 05 November 2004 09:35 Go to next message
Eclipse UserFriend
Originally posted by: gael.billard.jwaretechnologies.com

Is there a way to modify the class template. I mean the code inside a
class definition bracket. The goal is to insert a source control version
tag on class creation.

The template presented in the JDT to modify class allow to alter only
what is external to the class (not inside class definition bracket).

Ex:

file: any.java
/*
* some comments...
*/
${package_declaration} -> ex: org.myPackage;
${typecomment} -> /**
* @owner foo
* @version 1.0
*/
${type_declaration} -> public class myClass {

}

What I want is to insert a static variable after class declaration :
public class myClass {
public static String scv = "1.0";
}

I though it may be possible by altering class template but these
template is located inside a JDT jar (I didn't remember where).
Re: How to modify the class template ? [message #184546 is a reply to message #184504] Fri, 05 November 2004 11:57 Go to previous messageGo to next message
Eclipse UserFriend
Currently not possible. See e.g.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=76263

Markus

Gael wrote:

> Is there a way to modify the class template. I mean the code inside a
> class definition bracket. The goal is to insert a source control version
> tag on class creation.
>
> The template presented in the JDT to modify class allow to alter only
> what is external to the class (not inside class definition bracket).
>
> Ex:
>
> file: any.java
> /*
> * some comments...
> */
> ${package_declaration} -> ex: org.myPackage;
> ${typecomment} -> /**
> * @owner foo
> * @version 1.0
> */
> ${type_declaration} -> public class myClass {
>
> }
>
> What I want is to insert a static variable after class declaration :
> public class myClass {
> public static String scv = "1.0";
> }
>
> I though it may be possible by altering class template but these
> template is located inside a JDT jar (I didn't remember where).
Re: How to modify the class template ? [message #184680 is a reply to message #184546] Mon, 08 November 2004 05:08 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: gael.billard.jwaretechnologies.com

Thats what I though.

Thanks for reply.

But does someone know which jar contains the actual class temlate to
alter it to meet this need ?

Markus Keller a écrit :
> Currently not possible. See e.g.
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=76263
>
> Markus
>
> Gael wrote:
>
>> Is there a way to modify the class template. I mean the code inside a
>> class definition bracket. The goal is to insert a source control
>> version tag on class creation.
>>
>> The template presented in the JDT to modify class allow to alter only
>> what is external to the class (not inside class definition bracket).
>>
>> Ex:
>>
>> file: any.java
>> /*
>> * some comments...
>> */
>> ${package_declaration} -> ex: org.myPackage;
>> ${typecomment} -> /**
>> * @owner foo
>> * @version 1.0
>> */
>> ${type_declaration} -> public class myClass {
>> }
>>
>> What I want is to insert a static variable after class declaration :
>> public class myClass {
>> public static String scv = "1.0";
>> }
>>
>> I though it may be possible by altering class template but these
>> template is located inside a JDT jar (I didn't remember where).
Re: How to modify the class template ? [message #184688 is a reply to message #184680] Mon, 08 November 2004 06:27 Go to previous messageGo to next message
Eclipse UserFriend
There's no template for type bodies, since those are currently created in
code. Clients call
org.eclipse.jdt.ui.CodeGeneration.getCompilationUnitContent( ..)
and pass in the type declaration as a string.

Markus

Gael wrote:

> Thats what I though.
>
> Thanks for reply.
>
> But does someone know which jar contains the actual class temlate to
> alter it to meet this need ?
>
> Markus Keller a écrit :
>
>> Currently not possible. See e.g.
>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=76263
>>
>> Markus
>>
>> Gael wrote:
>>
>>> Is there a way to modify the class template. I mean the code inside a
>>> class definition bracket. The goal is to insert a source control
>>> version tag on class creation.
>>>
>>> The template presented in the JDT to modify class allow to alter only
>>> what is external to the class (not inside class definition bracket).
>>>
>>> Ex:
>>>
>>> file: any.java
>>> /*
>>> * some comments...
>>> */
>>> ${package_declaration} -> ex: org.myPackage;
>>> ${typecomment} -> /**
>>> * @owner foo
>>> * @version 1.0
>>> */
>>> ${type_declaration} -> public class myClass {
>>> }
>>>
>>> What I want is to insert a static variable after class declaration :
>>> public class myClass {
>>> public static String scv = "1.0";
>>> }
>>>
>>> I though it may be possible by altering class template but these
>>> template is located inside a JDT jar (I didn't remember where).
Re: How to modify the class template ? [message #184713 is a reply to message #184688] Mon, 08 November 2004 09:21 Go to previous message
Eclipse UserFriend
Originally posted by: gael.billard.jwaretechnologies.com

Too bad ! I'll wait...

Thanks for the information.

Markus Keller a écrit :
> There's no template for type bodies, since those are currently created
> in code. Clients call
> org.eclipse.jdt.ui.CodeGeneration.getCompilationUnitContent( ..)
> and pass in the type declaration as a string.
>
> Markus
>
> Gael wrote:
>
>> Thats what I though.
>>
>> Thanks for reply.
>>
>> But does someone know which jar contains the actual class temlate to
>> alter it to meet this need ?
>>
>> Markus Keller a écrit :
>>
>>> Currently not possible. See e.g.
>>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=76263
>>>
>>> Markus
>>>
>>> Gael wrote:
>>>
>>>> Is there a way to modify the class template. I mean the code inside
>>>> a class definition bracket. The goal is to insert a source control
>>>> version tag on class creation.
>>>>
>>>> The template presented in the JDT to modify class allow to alter
>>>> only what is external to the class (not inside class definition
>>>> bracket).
>>>>
>>>> Ex:
>>>>
>>>> file: any.java
>>>> /*
>>>> * some comments...
>>>> */
>>>> ${package_declaration} -> ex: org.myPackage;
>>>> ${typecomment} -> /**
>>>> * @owner foo
>>>> * @version 1.0
>>>> */
>>>> ${type_declaration} -> public class myClass {
>>>> }
>>>>
>>>> What I want is to insert a static variable after class declaration :
>>>> public class myClass {
>>>> public static String scv = "1.0";
>>>> }
>>>>
>>>> I though it may be possible by altering class template but these
>>>> template is located inside a JDT jar (I didn't remember where).
Previous Topic:JDT Template Variables
Next Topic:Missing margin in the editor
Goto Forum:
  


Current Time: Wed Jul 23 10:42:49 EDT 2025

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

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

Back to the top