[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools.emf] Re: Refresh model / Dynamic Template Questions

Charles,

The converted templates will appear in the project .JETEmitters.  This project
will likely be filtered from the view by default, so you must change the
"Filter...->.* files" in the navigator dropdown menu.  (Sometimes the converted
files under src will be missing the very first time and you'll need to exit the
workbench and start up again.)  If your templates contain errors, they will show
up as errors in the resulting .java files.  If it gets past this and is able to
load them, there may be runtime errors in your customizations.  These will be
logged so you should check the workspace/.metadata/.log for errors.  Checking the
log is always a good idea when reporting problems...


Charles Chan wrote:

> Hi, Dave, thanks for the answer. I am able to refresh the model now. :)
> However, I still cannot customize the template. Basically, files are not
> generated if I use my customized template.
>
> Thanks,
> Charles
>
> Dave Steinberg wrote:
>
> > Charles Chan wrote:
> > > 1. How do I refresh the EMF model with an updated Rose model? What I would
> > > like to do is to drive our development process with the Rose model. The
> > > EMF editor plugin is not as intuitive (graphical) as the Rose one.
>
> > Hi Charles,
>
> > Right-click on your .genmodel file in the Navigator or Package Explorer
> > view, and select Reload... from the pop-up menu.  The EMF wizard will run
> > again, but with all of your previous settings filled in by default.  Just
> > hit the Finish button to update the core and generator models.
>
> > > 2. I would like to make some changes to the templates. So what I have done
> > > is:
> > >    a. Copy the templates directory from the emf.ecore directory to my
> > > directory, say: C:temptemplates
> > >    b. Change the genmodel properties: Dynamic Templates to True, and
> > > Template Directory to C:temptemplates
> > >
> > >    When I regenerate the code, the running dialog shows the EMF is
> > > compiling some JET templates but then it stops without any error (there's
> > > a warning about unused import on Properties.java) and NO files are
> > > generated.
>
> > You'll need to keep the structure of the template sub-directories intact.
> > So, for instance, if you're copying Class.javajet, you'll need to copy it
> > into C:temptemplatesmodelClass.javajet.  You only need to copy the
> > templates you wish to change; the others will be picked up from their usual
> > place.
>
> > As an aside, it often makes sense to put your templates in a subdirectory of
> > a project, making them accessible to you in Eclipse.  You can use a
> > workspace-relative path as the value for Template Directory.  For example,
> > if you put them in a sub-directory of "MyProject" called "templates", you
> > can enter "/MyProject/templates".
>
> > Hope this helps.
>
> > Cheers,
> > Dave