Home » Archived » Visual Editor (VE) » Another code generation for SWT/JFACE
Another code generation for SWT/JFACE [message #102733] |
Thu, 18 August 2005 09:53 |
Eclipse User |
|
|
|
Originally posted by: cocktail.cs.tu-berlin.de
Hi,
I'm rather new to eclipse, VE ... and read several papers about eclipse
plugin development and - of course - also the tutorial to extend the ve -
thats quite a lot of new stuff.
Well - my goal is to get the VE to generate code based on SWT/JFace for a
special extension of Java which of course looks a little bit different to
standard java.
Can anybody give me one (or more) hints where or how to start such a
project? I'm not interested in extending the palette - i want to modify
nearly all of the generated code.
thanks in advance,
Karsten
|
|
| |
Re: Another code generation for SWT/JFACE [message #102835 is a reply to message #102760] |
Thu, 18 August 2005 21:27 |
Eclipse User |
|
|
|
Originally posted by: remus.gmx.org
Gili Mendel wrote:
> Karsten Meier wrote:
>> Hi,
>>
>> I'm rather new to eclipse, VE ... and read several papers about eclipse
>> plugin development and - of course - also the tutorial to extend the ve -
>> thats quite a lot of new stuff.
>>
>> Well - my goal is to get the VE to generate code based on SWT/JFace for a
>> special extension of Java which of course looks a little bit different to
>> standard java.
>>
>> Can anybody give me one (or more) hints where or how to start such a
>> project? I'm not interested in extending the palette - i want to modify
>> nearly all of the generated code.
>>
>> thanks in advance,
>> Karsten
>
> It will be easier for you to start with a simple "Hello World" kind of
> modification, so that you can get some hands on familiarity with the
> how/where things are.
eh - perhaps the explanation was not clear enough. I think i'm above the
"Hello World" level. With the help of several papers I wrote some small
plugins for eclipse and extended the swing palette (the tutorial to do this
was quite helpful).
But nowhere i found any hint in how to extend/modify the way VE, or better
the swt-extension, generates code. Of course browsing the whole VE Code
would explain something but a small hint of one of you experts would help a
lot.
ciao,
Karsten
|
|
|
Re: Another code generation for SWT/JFACE [message #102929 is a reply to message #102835] |
Fri, 19 August 2005 23:25 |
Srimanth Messages: 225 Registered: July 2009 |
Senior Member |
|
|
Hi Karsten,
I think what Gili was referring to was something like the "Custom code
generation for the text property" section in the paper for extending the
Visual Editor
( http://dev.eclipse.org/viewcvs/indextools.cgi/%7Echeckout%7E /org.eclipse.ve.examples/org.eclipse.ve.example.customwidget /WebContent/index.html),
not 'Hello World' SWT apps.
Regards,
Sri.
Karsten Meier wrote:
> Gili Mendel wrote:
>
>
>>Karsten Meier wrote:
>>
>>>Hi,
>>>
>>>I'm rather new to eclipse, VE ... and read several papers about eclipse
>>>plugin development and - of course - also the tutorial to extend the ve -
>>>thats quite a lot of new stuff.
>>>
>>>Well - my goal is to get the VE to generate code based on SWT/JFace for a
>>>special extension of Java which of course looks a little bit different to
>>>standard java.
>>>
>>>Can anybody give me one (or more) hints where or how to start such a
>>>project? I'm not interested in extending the palette - i want to modify
>>>nearly all of the generated code.
>>>
>>>thanks in advance,
>>>Karsten
>>
>>It will be easier for you to start with a simple "Hello World" kind of
>>modification, so that you can get some hands on familiarity with the
>>how/where things are.
>
>
> eh - perhaps the explanation was not clear enough. I think i'm above the
> "Hello World" level. With the help of several papers I wrote some small
> plugins for eclipse and extended the swing palette (the tutorial to do this
> was quite helpful).
> But nowhere i found any hint in how to extend/modify the way VE, or better
> the swt-extension, generates code. Of course browsing the whole VE Code
> would explain something but a small hint of one of you experts would help a
> lot.
>
> ciao,
> Karsten
>
>
>
>
|
|
|
Re: Another code generation for SWT/JFACE [message #103335 is a reply to message #102929] |
Wed, 24 August 2005 14:09 |
Eclipse User |
|
|
|
Originally posted by: remus.gmx.org
Hi,
> Hi Karsten,
> I think what Gili was referring to was something like the "Custom code
> generation for the text property" section in the paper for extending the
> Visual Editor
>
( http://dev.eclipse.org/viewcvs/indextools.cgi/%7Echeckout%7E /org.eclipse.ve.examples/org.eclipse.ve.example.customwidget /WebContent/index.html),
> not 'Hello World' SWT apps.
ok - thanks. I misunderstood gili.
Well I know this document and it is quite helpful to extend ve with new
widgets. Of course I will need this part also. But my first problem is to
modify the way the visual class will be generated.
To understand the way (...).ve.swt does this i also studied the code there.
But what i found was not very helpful:
SWT (and swing and ...) all use the "newStyleExtension" to extend the
slection tree in the "new visual class wizard" - but they all just
reference a special Class in the core plugin.
Look here (example from ve.swt):
<extension point="org.eclipse.ve.java.core.newStyleComponent">
(...)
<visualElement
(...)
contributor=" org.eclipse.ve.internal.java.codegen.wizards.contributors.Sh ellSourceContributor "
name="%NewStyleComponent.Shell">
</visualElement>
</extension>
The ShellSourceContributer just give a name for a code template, that of
course also resides in that core plugin. What is so astonishing: The
core-Plugin contains classes for other (specialized) extensions - here
SWT-Shell. For Swing it is the same situation.
The Problem now: I want to do exactly what SWT does: give a special template
for the visual class - and i would be very happy.
Is there a way to do this _without_ modifying the ve-core?
Hope someone could help.
Thanks,
Karsten
|
|
|
Re: Another code generation for SWT/JFACE [message #103342 is a reply to message #103335] |
Wed, 24 August 2005 14:22 |
Eclipse User |
|
|
|
Originally posted by: richkulp.us.NO_SPAM.ibm.com
You would use the same extension point, but supply your own contributor.
The contributor replies in the getTemplateLocation() method with the
javajet template which is used to extend the code created by the base
NewClassWizard.
The javajet template has all of the template of code to add.
Now how these javajets all work is different story. :-) I don't know how
that works.
--
Thanks,
Rich Kulp
|
|
|
Re: Another code generation for SWT/JFACE [message #103353 is a reply to message #103335] |
Wed, 24 August 2005 14:40 |
Eclipse User |
|
|
|
Originally posted by: remus.gmx.org
Oh - i forgot to give the used versions:
eclipse 3.0.2
ve 1.0.2
greetings,
Karsten
On Wed, 24 Aug 2005 16:09:41 +0200, Karsten Meier <remus@gmx.org>
wrote:
>Hi,
>
>> Hi Karsten,
>> I think what Gili was referring to was something like the "Custom code
>> generation for the text property" section in the paper for extending the
>> Visual Editor
>>
>( http://dev.eclipse.org/viewcvs/indextools.cgi/%7Echeckout%7E /org.eclipse.ve.examples/org.eclipse.ve.example.customwidget /WebContent/index.html),
>> not 'Hello World' SWT apps.
>
>ok - thanks. I misunderstood gili.
>
>Well I know this document and it is quite helpful to extend ve with new
>widgets. Of course I will need this part also. But my first problem is to
>modify the way the visual class will be generated.
>
>To understand the way (...).ve.swt does this i also studied the code there.
>But what i found was not very helpful:
>SWT (and swing and ...) all use the "newStyleExtension" to extend the
>slection tree in the "new visual class wizard" - but they all just
>reference a special Class in the core plugin.
>Look here (example from ve.swt):
>
><extension point="org.eclipse.ve.java.core.newStyleComponent">
>(...)
> <visualElement
> (...)
>contributor=" org.eclipse.ve.internal.java.codegen.wizards.contributors.Sh ellSourceContributor "
> name="%NewStyleComponent.Shell">
> </visualElement>
></extension>
>
>The ShellSourceContributer just give a name for a code template, that of
>course also resides in that core plugin. What is so astonishing: The
>core-Plugin contains classes for other (specialized) extensions - here
>SWT-Shell. For Swing it is the same situation.
>
>The Problem now: I want to do exactly what SWT does: give a special template
>for the visual class - and i would be very happy.
>
>Is there a way to do this _without_ modifying the ve-core?
>
>Hope someone could help.
>
>Thanks,
>Karsten
>
|
|
|
Re: Another code generation for SWT/JFACE [message #103364 is a reply to message #103342] |
Wed, 24 August 2005 14:53 |
Eclipse User |
|
|
|
Originally posted by: remus.gmx.org
On Wed, 24 Aug 2005 10:22:09 -0400, Rich Kulp
<richkulp@us.NO_SPAM.ibm.com> wrote:
>You would use the same extension point, but supply your own contributor.
>The contributor replies in the getTemplateLocation() method with the
>javajet template which is used to extend the code created by the base
>NewClassWizard.
:-)
Well, nice idea - i had the same. This contributor is quite easy and
the jjet doesnt look very complicated (there are enough examples).
But: this contributor is never loaded. Even my whole plugin is not
loaded when the "new visual class wizard" is finished.
There has to be something importent i miss. Because i thought that
something from the "custom widget tutorial" will help my plugin also
contains nearly all of the things described there. Everything worked -
except this starting point.
Thanks so far,
Karsten
|
|
|
Re: Another code generation for SWT/JFACE [message #103389 is a reply to message #103364] |
Wed, 24 August 2005 18:11 |
Eclipse User |
|
|
|
Originally posted by: richkulp.us.NO_SPAM.ibm.com
You need to select the style in the style tree before your contributor
will get loaded. For example, if you never select Swing->Frame, then the
Swing frame contributor will not get loaded.
--
Thanks,
Rich Kulp
|
|
|
Re: Another code generation for SWT/JFACE [message #103484 is a reply to message #103389] |
Thu, 25 August 2005 05:29 |
Eclipse User |
|
|
|
Originally posted by: remus.gmx.org
On Wed, 24 Aug 2005 14:11:20 -0400, Rich Kulp
<richkulp@us.NO_SPAM.ibm.com> wrote:
>You need to select the style in the style tree before your contributor
>will get loaded. For example, if you never select Swing->Frame, then the
>Swing frame contributor will not get loaded.
You are joking, right?
Of course i selected my style - how else should i know that the wizard
is _not_ generating what i want.
Btw: in this case an empty java class is generated.
greetings,
Karsten
|
|
|
Re: Another code generation for SWT/JFACE [message #103599 is a reply to message #103484] |
Thu, 25 August 2005 11:50 |
Eclipse User |
|
|
|
Originally posted by: remus.gmx.org
Hi,
i tried it all again with a fresh generated plugin and: it works now!
Dont ask me why my first try failed!
Thanks so far,
Karsten
On Thu, 25 Aug 2005 07:29:27 +0200, Karsten Meier <remus@gmx.org>
wrote:
>On Wed, 24 Aug 2005 14:11:20 -0400, Rich Kulp
><richkulp@us.NO_SPAM.ibm.com> wrote:
>
>>You need to select the style in the style tree before your contributor
>>will get loaded. For example, if you never select Swing->Frame, then the
>>Swing frame contributor will not get loaded.
>
>You are joking, right?
>
>Of course i selected my style - how else should i know that the wizard
>is _not_ generating what i want.
>Btw: in this case an empty java class is generated.
>
>greetings,
>Karsten
|
|
| |
Re: Another code generation for SWT/JFACE [message #610334 is a reply to message #102760] |
Thu, 18 August 2005 21:27 |
Eclipse User |
|
|
|
Originally posted by: remus.gmx.org
Gili Mendel wrote:
> Karsten Meier wrote:
>> Hi,
>>
>> I'm rather new to eclipse, VE ... and read several papers about eclipse
>> plugin development and - of course - also the tutorial to extend the ve -
>> thats quite a lot of new stuff.
>>
>> Well - my goal is to get the VE to generate code based on SWT/JFace for a
>> special extension of Java which of course looks a little bit different to
>> standard java.
>>
>> Can anybody give me one (or more) hints where or how to start such a
>> project? I'm not interested in extending the palette - i want to modify
>> nearly all of the generated code.
>>
>> thanks in advance,
>> Karsten
>
> It will be easier for you to start with a simple "Hello World" kind of
> modification, so that you can get some hands on familiarity with the
> how/where things are.
eh - perhaps the explanation was not clear enough. I think i'm above the
"Hello World" level. With the help of several papers I wrote some small
plugins for eclipse and extended the swing palette (the tutorial to do this
was quite helpful).
But nowhere i found any hint in how to extend/modify the way VE, or better
the swt-extension, generates code. Of course browsing the whole VE Code
would explain something but a small hint of one of you experts would help a
lot.
ciao,
Karsten
|
|
|
Re: Another code generation for SWT/JFACE [message #610341 is a reply to message #102835] |
Fri, 19 August 2005 23:25 |
Srimanth Messages: 225 Registered: July 2009 |
Senior Member |
|
|
Hi Karsten,
I think what Gili was referring to was something like the "Custom code
generation for the text property" section in the paper for extending the
Visual Editor
( http://dev.eclipse.org/viewcvs/indextools.cgi/%7Echeckout%7E /org.eclipse.ve.examples/org.eclipse.ve.example.customwidget /WebContent/index.html),
not 'Hello World' SWT apps.
Regards,
Sri.
Karsten Meier wrote:
> Gili Mendel wrote:
>
>
>>Karsten Meier wrote:
>>
>>>Hi,
>>>
>>>I'm rather new to eclipse, VE ... and read several papers about eclipse
>>>plugin development and - of course - also the tutorial to extend the ve -
>>>thats quite a lot of new stuff.
>>>
>>>Well - my goal is to get the VE to generate code based on SWT/JFace for a
>>>special extension of Java which of course looks a little bit different to
>>>standard java.
>>>
>>>Can anybody give me one (or more) hints where or how to start such a
>>>project? I'm not interested in extending the palette - i want to modify
>>>nearly all of the generated code.
>>>
>>>thanks in advance,
>>>Karsten
>>
>>It will be easier for you to start with a simple "Hello World" kind of
>>modification, so that you can get some hands on familiarity with the
>>how/where things are.
>
>
> eh - perhaps the explanation was not clear enough. I think i'm above the
> "Hello World" level. With the help of several papers I wrote some small
> plugins for eclipse and extended the swing palette (the tutorial to do this
> was quite helpful).
> But nowhere i found any hint in how to extend/modify the way VE, or better
> the swt-extension, generates code. Of course browsing the whole VE Code
> would explain something but a small hint of one of you experts would help a
> lot.
>
> ciao,
> Karsten
>
>
>
>
|
|
|
Re: Another code generation for SWT/JFACE [message #610369 is a reply to message #102929] |
Wed, 24 August 2005 14:09 |
Eclipse User |
|
|
|
Originally posted by: remus.gmx.org
Hi,
> Hi Karsten,
> I think what Gili was referring to was something like the "Custom code
> generation for the text property" section in the paper for extending the
> Visual Editor
>
( http://dev.eclipse.org/viewcvs/indextools.cgi/%7Echeckout%7E /org.eclipse.ve.examples/org.eclipse.ve.example.customwidget /WebContent/index.html),
> not 'Hello World' SWT apps.
ok - thanks. I misunderstood gili.
Well I know this document and it is quite helpful to extend ve with new
widgets. Of course I will need this part also. But my first problem is to
modify the way the visual class will be generated.
To understand the way (...).ve.swt does this i also studied the code there.
But what i found was not very helpful:
SWT (and swing and ...) all use the "newStyleExtension" to extend the
slection tree in the "new visual class wizard" - but they all just
reference a special Class in the core plugin.
Look here (example from ve.swt):
<extension point="org.eclipse.ve.java.core.newStyleComponent">
(...)
<visualElement
(...)
contributor=" org.eclipse.ve.internal.java.codegen.wizards.contributors.Sh ellSourceContributor "
name="%NewStyleComponent.Shell">
</visualElement>
</extension>
The ShellSourceContributer just give a name for a code template, that of
course also resides in that core plugin. What is so astonishing: The
core-Plugin contains classes for other (specialized) extensions - here
SWT-Shell. For Swing it is the same situation.
The Problem now: I want to do exactly what SWT does: give a special template
for the visual class - and i would be very happy.
Is there a way to do this _without_ modifying the ve-core?
Hope someone could help.
Thanks,
Karsten
|
|
|
Re: Another code generation for SWT/JFACE [message #610370 is a reply to message #103335] |
Wed, 24 August 2005 14:22 |
Eclipse User |
|
|
|
Originally posted by: richkulp.us.NO_SPAM.ibm.com
You would use the same extension point, but supply your own contributor.
The contributor replies in the getTemplateLocation() method with the
javajet template which is used to extend the code created by the base
NewClassWizard.
The javajet template has all of the template of code to add.
Now how these javajets all work is different story. :-) I don't know how
that works.
--
Thanks,
Rich Kulp
|
|
|
Re: Another code generation for SWT/JFACE [message #610371 is a reply to message #103335] |
Wed, 24 August 2005 14:40 |
Eclipse User |
|
|
|
Originally posted by: remus.gmx.org
Oh - i forgot to give the used versions:
eclipse 3.0.2
ve 1.0.2
greetings,
Karsten
On Wed, 24 Aug 2005 16:09:41 +0200, Karsten Meier <remus@gmx.org>
wrote:
>Hi,
>
>> Hi Karsten,
>> I think what Gili was referring to was something like the "Custom code
>> generation for the text property" section in the paper for extending the
>> Visual Editor
>>
>( http://dev.eclipse.org/viewcvs/indextools.cgi/%7Echeckout%7E /org.eclipse.ve.examples/org.eclipse.ve.example.customwidget /WebContent/index.html),
>> not 'Hello World' SWT apps.
>
>ok - thanks. I misunderstood gili.
>
>Well I know this document and it is quite helpful to extend ve with new
>widgets. Of course I will need this part also. But my first problem is to
>modify the way the visual class will be generated.
>
>To understand the way (...).ve.swt does this i also studied the code there.
>But what i found was not very helpful:
>SWT (and swing and ...) all use the "newStyleExtension" to extend the
>slection tree in the "new visual class wizard" - but they all just
>reference a special Class in the core plugin.
>Look here (example from ve.swt):
>
><extension point="org.eclipse.ve.java.core.newStyleComponent">
>(...)
> <visualElement
> (...)
>contributor=" org.eclipse.ve.internal.java.codegen.wizards.contributors.Sh ellSourceContributor "
> name="%NewStyleComponent.Shell">
> </visualElement>
></extension>
>
>The ShellSourceContributer just give a name for a code template, that of
>course also resides in that core plugin. What is so astonishing: The
>core-Plugin contains classes for other (specialized) extensions - here
>SWT-Shell. For Swing it is the same situation.
>
>The Problem now: I want to do exactly what SWT does: give a special template
>for the visual class - and i would be very happy.
>
>Is there a way to do this _without_ modifying the ve-core?
>
>Hope someone could help.
>
>Thanks,
>Karsten
>
|
|
|
Re: Another code generation for SWT/JFACE [message #610372 is a reply to message #103342] |
Wed, 24 August 2005 14:53 |
Eclipse User |
|
|
|
Originally posted by: remus.gmx.org
On Wed, 24 Aug 2005 10:22:09 -0400, Rich Kulp
<richkulp@us.NO_SPAM.ibm.com> wrote:
>You would use the same extension point, but supply your own contributor.
>The contributor replies in the getTemplateLocation() method with the
>javajet template which is used to extend the code created by the base
>NewClassWizard.
:-)
Well, nice idea - i had the same. This contributor is quite easy and
the jjet doesnt look very complicated (there are enough examples).
But: this contributor is never loaded. Even my whole plugin is not
loaded when the "new visual class wizard" is finished.
There has to be something importent i miss. Because i thought that
something from the "custom widget tutorial" will help my plugin also
contains nearly all of the things described there. Everything worked -
except this starting point.
Thanks so far,
Karsten
|
|
|
Re: Another code generation for SWT/JFACE [message #610374 is a reply to message #103364] |
Wed, 24 August 2005 18:11 |
Eclipse User |
|
|
|
Originally posted by: richkulp.us.NO_SPAM.ibm.com
You need to select the style in the style tree before your contributor
will get loaded. For example, if you never select Swing->Frame, then the
Swing frame contributor will not get loaded.
--
Thanks,
Rich Kulp
|
|
|
Re: Another code generation for SWT/JFACE [message #610381 is a reply to message #103389] |
Thu, 25 August 2005 05:29 |
Eclipse User |
|
|
|
Originally posted by: remus.gmx.org
On Wed, 24 Aug 2005 14:11:20 -0400, Rich Kulp
<richkulp@us.NO_SPAM.ibm.com> wrote:
>You need to select the style in the style tree before your contributor
>will get loaded. For example, if you never select Swing->Frame, then the
>Swing frame contributor will not get loaded.
You are joking, right?
Of course i selected my style - how else should i know that the wizard
is _not_ generating what i want.
Btw: in this case an empty java class is generated.
greetings,
Karsten
|
|
|
Re: Another code generation for SWT/JFACE [message #610388 is a reply to message #103484] |
Thu, 25 August 2005 11:50 |
Eclipse User |
|
|
|
Originally posted by: remus.gmx.org
Hi,
i tried it all again with a fresh generated plugin and: it works now!
Dont ask me why my first try failed!
Thanks so far,
Karsten
On Thu, 25 Aug 2005 07:29:27 +0200, Karsten Meier <remus@gmx.org>
wrote:
>On Wed, 24 Aug 2005 14:11:20 -0400, Rich Kulp
><richkulp@us.NO_SPAM.ibm.com> wrote:
>
>>You need to select the style in the style tree before your contributor
>>will get loaded. For example, if you never select Swing->Frame, then the
>>Swing frame contributor will not get loaded.
>
>You are joking, right?
>
>Of course i selected my style - how else should i know that the wizard
>is _not_ generating what i want.
>Btw: in this case an empty java class is generated.
>
>greetings,
>Karsten
|
|
|
Goto Forum:
Current Time: Thu Apr 25 16:13:22 GMT 2024
Powered by FUDForum. Page generated in 0.04272 seconds
|