|
Re: code generation in VE [message #123070 is a reply to message #123017] |
Thu, 13 April 2006 14:08 |
Eclipse User |
|
|
|
Originally posted by: richkulp.us.NO_SPAM.ibm.com
In VE there is an underlying EMF Ecore model. When something is dropped
from the palette, commands are created through the GEF editparts. These
commands update the EMF model. Now the code generation part of VE has
added parts of itself as listeners (call Adapters in EMF). Since changes
to the EMF model are changes to features of the EMF model the listeners
get notified of feature changes. These codegen listeners then hear this
change and they go and make the appropriate change in the source code to
match how the model was changed.
We use the IDocument interface from the TextEditor. We just change it.
The jdt text editor listens for such changes and responds with the
changes showing up in the code.
We also listen to the IDocument too. If we hear changes that we didn't
make ourselves we parse those changes, see how they would change the EMF
model, and then go and change the EMF model. Since the GEF editparts are
also listening for changes to the EMF model it refreshes itself whenever
the EMF model changes.
We use jet only for some precompiled code patterns. We don't dynamically
use jet to create the code, just use precompiled jet templates for
creating small snippets of code.
There is no tutorial. What I gave here is only a general overview. The
actual implementation is far more complex because it has to handle many
different coding patterns and class hierarchies among other things.
mithun wrote:
> Hello, I want to know how VE handles code generation after listening to
> model dropped off the gef pallete on graphical viewers?.
> And also how to both texteditor and graphical editor in sync.
> Does it uses jet?
> link to some tutorial for doing so would be appreciated.
>
> thank you.
>
> -- mithun
>
--
Thanks,
Rich Kulp
|
|
|
|
Re: code generation in VE [message #612630 is a reply to message #123017] |
Thu, 13 April 2006 14:08 |
Eclipse User |
|
|
|
Originally posted by: richkulp.us.NO_SPAM.ibm.com
In VE there is an underlying EMF Ecore model. When something is dropped
from the palette, commands are created through the GEF editparts. These
commands update the EMF model. Now the code generation part of VE has
added parts of itself as listeners (call Adapters in EMF). Since changes
to the EMF model are changes to features of the EMF model the listeners
get notified of feature changes. These codegen listeners then hear this
change and they go and make the appropriate change in the source code to
match how the model was changed.
We use the IDocument interface from the TextEditor. We just change it.
The jdt text editor listens for such changes and responds with the
changes showing up in the code.
We also listen to the IDocument too. If we hear changes that we didn't
make ourselves we parse those changes, see how they would change the EMF
model, and then go and change the EMF model. Since the GEF editparts are
also listening for changes to the EMF model it refreshes itself whenever
the EMF model changes.
We use jet only for some precompiled code patterns. We don't dynamically
use jet to create the code, just use precompiled jet templates for
creating small snippets of code.
There is no tutorial. What I gave here is only a general overview. The
actual implementation is far more complex because it has to handle many
different coding patterns and class hierarchies among other things.
mithun wrote:
> Hello, I want to know how VE handles code generation after listening to
> model dropped off the gef pallete on graphical viewers?.
> And also how to both texteditor and graphical editor in sync.
> Does it uses jet?
> link to some tutorial for doing so would be appreciated.
>
> thank you.
>
> -- mithun
>
--
Thanks,
Rich Kulp
|
|
|
|
Powered by
FUDForum. Page generated in 0.03404 seconds