Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » Can I add my own class path entries to JETEmitter project
Can I add my own class path entries to JETEmitter project [message #55460] Sun, 01 October 2006 07:16 Go to next message
nalaka gamage is currently offline nalaka gamageFriend
Messages: 30
Registered: July 2009
Member
Hi All,
In my own plugin, I am calling generate method of
org.eclipse.emf.codegen.ecore.generator.Generator class (which is new in
codegen.ecore 2.2.1) to generate the code for my genModel. Earlier I used
to call generate method os the
org.eclipse.emf.codegen.ecore.genmodel.GenModel. However now its
depreciated.
Now the issue is since I am using customised jet templates to generate
codes I have to add a jar file available in my plugin to the jetEmitter
project's class path so that jetemitter project get comiled correctly.
Is it possible to add new classpath entries to jetemitter project with new
org.eclipse.emf.codegen.ecore.generator.Generator class ?

I tried creating the jetemitter project myself before calling the generate
method. However I found that my jetemitter project get overridden by the
jetemiiteer project created by calling generate method. In fact I found
that jet emitter project get created as follows in the execution path;
AbstractGeneratorAdapter=> getJETEmitter() => createJETEmitter()
genBaseGeneratorAdapter => addClasspathentries()

Is there a possibility to override the createJETEmitter() method of
AbstractGeneratorAdapter class? Or is there any other solution for this?

Can anyone help me resolve this issue?
Thanks in advance

Nalaka
Re: Can I add my own class path entries to JETEmitter project [message #55487 is a reply to message #55460] Sun, 01 October 2006 12:55 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

This is a multi-part message in MIME format.
--------------010703030409020103090507
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Nalaka,

You can override createJETEMitter and you can also make your extension
use a different project by calling JETEmitter.setProjectName to
something other than .JETEmitters. The UML project overrides just the
addClasspathEntries method to add additional UML2-specific entries.

public class UML2GenBaseGeneratorAdapter
extends GenBaseGeneratorAdapter {

protected static void addUML2ClasspathEntries(JETEmitter jetEmitter)
throws JETException {
jetEmitter.addVariable("UML2_CODEGEN_ECORE", //$NON-NLS-1$
"org.eclipse.uml2.codegen.ecore"); //$NON-NLS-1$
}

public UML2GenBaseGeneratorAdapter(
GeneratorAdapterFactory generatorAdapterFactory) {
super(generatorAdapterFactory);
}

protected void *addClasspathEntries*(JETEmitter jetEmitter)
throws JETException {
super.addClasspathEntries(jetEmitter);

addUML2ClasspathEntries(jetEmitter);
}

}


Nalaka Gamage wrote:
> Hi All,
> In my own plugin, I am calling generate method of
> org.eclipse.emf.codegen.ecore.generator.Generator class (which is new
> in codegen.ecore 2.2.1) to generate the code for my genModel. Earlier
> I used to call generate method os the
> org.eclipse.emf.codegen.ecore.genmodel.GenModel. However now its
> depreciated.
> Now the issue is since I am using customised jet templates to generate
> codes I have to add a jar file available in my plugin to the
> jetEmitter project's class path so that jetemitter project get comiled
> correctly. Is it possible to add new classpath entries to jetemitter
> project with new org.eclipse.emf.codegen.ecore.generator.Generator
> class ?
>
> I tried creating the jetemitter project myself before calling the
> generate method. However I found that my jetemitter project get
> overridden by the jetemiiteer project created by calling generate
> method. In fact I found that jet emitter project get created as
> follows in the execution path; AbstractGeneratorAdapter=>
> getJETEmitter() => createJETEmitter() genBaseGeneratorAdapter =>
> addClasspathentries()
>
> Is there a possibility to override the createJETEmitter() method of
> AbstractGeneratorAdapter class? Or is there any other solution for this?
>
> Can anyone help me resolve this issue?
> Thanks in advance
>
> Nalaka
>
>


--------------010703030409020103090507
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Nalaka,<br>
<br>
You can override createJETEMitter and you can also make your extension
use a different project by calling JETEmitter.setProjectName to
something other than .JETEmitters.
Re: Can I add my own class path entries to JETEmitter project [message #55514 is a reply to message #55487] Mon, 02 October 2006 07:30 Go to previous messageGo to next message
nalaka gamage is currently offline nalaka gamageFriend
Messages: 30
Registered: July 2009
Member
Hi Merks,
Thanks for the reply which is very useful information.
I went through the source code of org.eclipse.uml2.codegen.ecore_1.2.1
plugin to get better understanding of your solution. Its clear creating a
new class extending GenBaseGeneratorAdapter and overiding the
addClasspathEntries should do the trick.
However I am bit stuck to identify how we are going to make sure that our
extended class is used instead of GenBaseGeneratorAdapter class. Do we
have to create a new adapter factory class as well? It will be great if
you can explain how we are going to integrate our extended class.

I can see that in uml2.codgen.ecore plugin, they have created their own
GenClassGeneratorAdapter class that extends
org.eclipse.emf.codegen.ecore.genmodel.generator.GenClassGen eratorAdapter
and in this class they have override addClasspathEntries as follows;

protected void addClasspathEntries(JETEmitter jetEmitter)
throws JETException {
super.addClasspathEntries(jetEmitter);
*UML2GenBaseGeneratorAdapter.addUML2ClasspathEntries(jetEmit ter);*
}

Is this the trick you are doing or this is related to some other
requirement? If so still how are we making sure that our version of
GenClassGeneratorAdapter class is used?

My requirement is simply to add new class path entry to the JETEmitter
project.
I highly appreciate your response.

Thanks
Nalaka


Ed Merks wrote:

> Nalaka,

> You can override createJETEMitter and you can also make your extension
> use a different project by calling JETEmitter.setProjectName to
> something other than .JETEmitters. The UML project overrides just the
> addClasspathEntries method to add additional UML2-specific entries.

> public class UML2GenBaseGeneratorAdapter
> extends GenBaseGeneratorAdapter {

> protected static void addUML2ClasspathEntries(JETEmitter jetEmitter)
> throws JETException {
> jetEmitter.addVariable("UML2_CODEGEN_ECORE", //$NON-NLS-1$
> "org.eclipse.uml2.codegen.ecore"); //$NON-NLS-1$
> }

> public UML2GenBaseGeneratorAdapter(
> GeneratorAdapterFactory generatorAdapterFactory) {
> super(generatorAdapterFactory);
> }

> protected void *addClasspathEntries*(JETEmitter jetEmitter)
> throws JETException {
> super.addClasspathEntries(jetEmitter);

> addUML2ClasspathEntries(jetEmitter);
> }

> }


> Nalaka Gamage wrote:
>> Hi All,
>> In my own plugin, I am calling generate method of
>> org.eclipse.emf.codegen.ecore.generator.Generator class (which is new
>> in codegen.ecore 2.2.1) to generate the code for my genModel. Earlier
>> I used to call generate method os the
>> org.eclipse.emf.codegen.ecore.genmodel.GenModel. However now its
>> depreciated.
>> Now the issue is since I am using customised jet templates to generate
>> codes I have to add a jar file available in my plugin to the
>> jetEmitter project's class path so that jetemitter project get comiled
>> correctly. Is it possible to add new classpath entries to jetemitter
>> project with new org.eclipse.emf.codegen.ecore.generator.Generator
>> class ?
>>
>> I tried creating the jetemitter project myself before calling the
>> generate method. However I found that my jetemitter project get
>> overridden by the jetemiiteer project created by calling generate
>> method. In fact I found that jet emitter project get created as
>> follows in the execution path; AbstractGeneratorAdapter=>
>> getJETEmitter() => createJETEmitter() genBaseGeneratorAdapter =>
>> addClasspathentries()
>>
>> Is there a possibility to override the createJETEmitter() method of
>> AbstractGeneratorAdapter class? Or is there any other solution for this?
>>
>> Can anyone help me resolve this issue?
>> Thanks in advance
>>
>> Nalaka
>>
>>
Re: Can I add my own class path entries to JETEmitter project [message #55540 is a reply to message #55514] Mon, 02 October 2006 11:38 Go to previous messageGo to next message
nalaka gamage is currently offline nalaka gamageFriend
Messages: 30
Registered: July 2009
Member
Hi Merks and All,

I further researched into org.eclipse.uml2.codegen.ecore_1.2.1 code base
and found that in the plugin.xml,following extension point entries
available;
<extension point="org.eclipse.emf.codegen.ecore.generatorAdapters">
<adapterFactory
modelPackage = "http://www.eclipse.org/uml2/1.1.0/GenModel"
class=" org.eclipse.uml2.codegen.ecore.genmodel.generator.GenModelGe neratorAdapterFactory "/>
<adapterFactory
modelPackage = "http://www.eclipse.org/uml2/1.1.0/GenModel"
class=" org.eclipse.uml2.codegen.ecore.genmodel.generator.UML2GenMod elGeneratorAdapterFactory "/>
</extension>

In my case, I am also calling generete method from within my own plugin. I
feel I may follow same approach (correct me If I am wrong). Still I am not
exactly sure which factory to be extended
Should I use the exact same extension aproach as above or should there be
a simpler extension approach.
May I add the extension points in *my own plugin*, in that case do I have
to overide the org.eclipse.emf.codegen.ecore.generator.Generator class as
well?
Unfortunately there is no direct factory class for GenBaseGeneratorAdapter
(which I am now extending). Therefore, In my case also do I have to go
through the GenModelGeneratorAdapterFactory class extension as
uml2.codegen.ecore_1.2.1 does?

Do you feel this extension approach is feasible?
Please correct me if I am in a wrong path?

Thanks in advance,
Nalaka

Nalaka Gamage wrote:

> Hi Merks,
> Thanks for the reply which is very useful information.
> I went through the source code of org.eclipse.uml2.codegen.ecore_1.2.1
> plugin to get better understanding of your solution. Its clear creating a
> new class extending GenBaseGeneratorAdapter and overiding the
> addClasspathEntries should do the trick.
> However I am bit stuck to identify how we are going to make sure that our
> extended class is used instead of GenBaseGeneratorAdapter class. Do we
> have to create a new adapter factory class as well? It will be great if
> you can explain how we are going to integrate our extended class.

> I can see that in uml2.codgen.ecore plugin, they have created their own
> GenClassGeneratorAdapter class that extends
> org.eclipse.emf.codegen.ecore.genmodel.generator.GenClassGen eratorAdapter
> and in this class they have override addClasspathEntries as follows;

> protected void addClasspathEntries(JETEmitter jetEmitter)
> throws JETException {
> super.addClasspathEntries(jetEmitter);
> *UML2GenBaseGeneratorAdapter.addUML2ClasspathEntries(jetEmit ter);*
> }

> Is this the trick you are doing or this is related to some other
> requirement? If so still how are we making sure that our version of
> GenClassGeneratorAdapter class is used?

> My requirement is simply to add new class path entry to the JETEmitter
> project.
> I highly appreciate your response.

> Thanks
> Nalaka


> Ed Merks wrote:

>> Nalaka,

>> You can override createJETEMitter and you can also make your extension
>> use a different project by calling JETEmitter.setProjectName to
>> something other than .JETEmitters. The UML project overrides just the
>> addClasspathEntries method to add additional UML2-specific entries.

>> public class UML2GenBaseGeneratorAdapter
>> extends GenBaseGeneratorAdapter {

>> protected static void addUML2ClasspathEntries(JETEmitter jetEmitter)
>> throws JETException {
>> jetEmitter.addVariable("UML2_CODEGEN_ECORE", //$NON-NLS-1$
>> "org.eclipse.uml2.codegen.ecore"); //$NON-NLS-1$
>> }

>> public UML2GenBaseGeneratorAdapter(
>> GeneratorAdapterFactory generatorAdapterFactory) {
>> super(generatorAdapterFactory);
>> }

>> protected void *addClasspathEntries*(JETEmitter jetEmitter)
>> throws JETException {
>> super.addClasspathEntries(jetEmitter);

>> addUML2ClasspathEntries(jetEmitter);
>> }

>> }


>> Nalaka Gamage wrote:
>>> Hi All,
>>> In my own plugin, I am calling generate method of
>>> org.eclipse.emf.codegen.ecore.generator.Generator class (which is new
>>> in codegen.ecore 2.2.1) to generate the code for my genModel. Earlier
>>> I used to call generate method os the
>>> org.eclipse.emf.codegen.ecore.genmodel.GenModel. However now its
>>> depreciated.
>>> Now the issue is since I am using customised jet templates to generate
>>> codes I have to add a jar file available in my plugin to the
>>> jetEmitter project's class path so that jetemitter project get comiled
>>> correctly. Is it possible to add new classpath entries to jetemitter
>>> project with new org.eclipse.emf.codegen.ecore.generator.Generator
>>> class ?
>>>
>>> I tried creating the jetemitter project myself before calling the
>>> generate method. However I found that my jetemitter project get
>>> overridden by the jetemiiteer project created by calling generate
>>> method. In fact I found that jet emitter project get created as
>>> follows in the execution path; AbstractGeneratorAdapter=>
>>> getJETEmitter() => createJETEmitter() genBaseGeneratorAdapter =>
>>> addClasspathentries()
>>>
>>> Is there a possibility to override the createJETEmitter() method of
>>> AbstractGeneratorAdapter class? Or is there any other solution for this?
>>>
>>> Can anyone help me resolve this issue?
>>> Thanks in advance
>>>
>>> Nalaka
>>>
>>>
Re: Can I add my own class path entries to JETEmitter project [message #55567 is a reply to message #55514] Mon, 02 October 2006 12:01 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Nalaka,

I imagine you'll need to create a specialized factory that creates your
specialized adapters for each of the adapters the factory currently
creates. How were you previously solving this problem before we
provided the adapters?


Nalaka Gamage wrote:

> Hi Merks,
> Thanks for the reply which is very useful information. I went through
> the source code of org.eclipse.uml2.codegen.ecore_1.2.1 plugin to get
> better understanding of your solution. Its clear creating a new class
> extending GenBaseGeneratorAdapter and overiding the
> addClasspathEntries should do the trick. However I am bit stuck to
> identify how we are going to make sure that our extended class is used
> instead of GenBaseGeneratorAdapter class. Do we have to create a new
> adapter factory class as well? It will be great if you can explain how
> we are going to integrate our extended class.
>
> I can see that in uml2.codgen.ecore plugin, they have created their
> own GenClassGeneratorAdapter class that extends
> org.eclipse.emf.codegen.ecore.genmodel.generator.GenClassGen eratorAdapter
> and in this class they have override addClasspathEntries as follows;
>
> protected void addClasspathEntries(JETEmitter jetEmitter)
> throws JETException {
> super.addClasspathEntries(jetEmitter);
> *UML2GenBaseGeneratorAdapter.addUML2ClasspathEntries(jetEmit ter);*
> }
>
> Is this the trick you are doing or this is related to some other
> requirement? If so still how are we making sure that our version of
> GenClassGeneratorAdapter class is used?
>
> My requirement is simply to add new class path entry to the JETEmitter
> project.
> I highly appreciate your response.
>
> Thanks
> Nalaka
>
> Ed Merks wrote:
>
>> Nalaka,
>
>
>> You can override createJETEMitter and you can also make your
>> extension use a different project by calling
>> JETEmitter.setProjectName to something other than .JETEmitters. The
>> UML project overrides just the addClasspathEntries method to add
>> additional UML2-specific entries.
>
>
>> public class UML2GenBaseGeneratorAdapter
>> extends GenBaseGeneratorAdapter {
>
>
>> protected static void addUML2ClasspathEntries(JETEmitter
>> jetEmitter)
>> throws JETException {
>> jetEmitter.addVariable("UML2_CODEGEN_ECORE", //$NON-NLS-1$
>> "org.eclipse.uml2.codegen.ecore"); //$NON-NLS-1$
>> }
>
>
>> public UML2GenBaseGeneratorAdapter(
>> GeneratorAdapterFactory generatorAdapterFactory) {
>> super(generatorAdapterFactory);
>> }
>
>
>> protected void *addClasspathEntries*(JETEmitter jetEmitter)
>> throws JETException {
>> super.addClasspathEntries(jetEmitter);
>
>
>> addUML2ClasspathEntries(jetEmitter);
>> }
>
>
>> }
>
>
>
>> Nalaka Gamage wrote:
>>
>>> Hi All,
>>> In my own plugin, I am calling generate method of
>>> org.eclipse.emf.codegen.ecore.generator.Generator class (which is
>>> new in codegen.ecore 2.2.1) to generate the code for my genModel.
>>> Earlier I used to call generate method os the
>>> org.eclipse.emf.codegen.ecore.genmodel.GenModel. However now its
>>> depreciated.
>>> Now the issue is since I am using customised jet templates to
>>> generate codes I have to add a jar file available in my plugin to
>>> the jetEmitter project's class path so that jetemitter project get
>>> comiled correctly. Is it possible to add new classpath entries to
>>> jetemitter project with new
>>> org.eclipse.emf.codegen.ecore.generator.Generator class ?
>>>
>>> I tried creating the jetemitter project myself before calling the
>>> generate method. However I found that my jetemitter project get
>>> overridden by the jetemiiteer project created by calling generate
>>> method. In fact I found that jet emitter project get created as
>>> follows in the execution path; AbstractGeneratorAdapter=>
>>> getJETEmitter() => createJETEmitter() genBaseGeneratorAdapter =>
>>> addClasspathentries()
>>>
>>> Is there a possibility to override the createJETEmitter() method of
>>> AbstractGeneratorAdapter class? Or is there any other solution for
>>> this?
>>>
>>> Can anyone help me resolve this issue?
>>> Thanks in advance
>>>
>>> Nalaka
>>>
>>>
>
>
Re: Can I add my own class path entries to JETEmitter project [message #55595 is a reply to message #55540] Mon, 02 October 2006 12:15 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Nalaka,

Probably you'll want to create a Generator with an empty registry (new
Generator(new DelegateRegistry()) and populate that registry with your
specialized GenModelGeneratorAdapterFactory.


Nalaka Gamage wrote:

>
> Hi Merks and All,
>
> I further researched into org.eclipse.uml2.codegen.ecore_1.2.1 code
> base and found that in the plugin.xml,following extension point
> entries available;
> <extension point="org.eclipse.emf.codegen.ecore.generatorAdapters">
> <adapterFactory
> modelPackage =
> "http://www.eclipse.org/uml2/1.1.0/GenModel"
> class=" org.eclipse.uml2.codegen.ecore.genmodel.generator.GenModelGe neratorAdapterFactory "/>
>
> <adapterFactory
> modelPackage =
> "http://www.eclipse.org/uml2/1.1.0/GenModel"
> class=" org.eclipse.uml2.codegen.ecore.genmodel.generator.UML2GenMod elGeneratorAdapterFactory "/>
>
> </extension>
>
> In my case, I am also calling generete method from within my own
> plugin. I feel I may follow same approach (correct me If I am wrong).
> Still I am not exactly sure which factory to be extended
> Should I use the exact same extension aproach as above or should there
> be a simpler extension approach.
> May I add the extension points in *my own plugin*, in that case do I
> have to overide the org.eclipse.emf.codegen.ecore.generator.Generator
> class as well?
> Unfortunately there is no direct factory class for
> GenBaseGeneratorAdapter (which I am now extending). Therefore, In my
> case also do I have to go through the GenModelGeneratorAdapterFactory
> class extension as uml2.codegen.ecore_1.2.1 does?
>
> Do you feel this extension approach is feasible?
> Please correct me if I am in a wrong path?
> Thanks in advance,
> Nalaka
>
> Nalaka Gamage wrote:
>
>> Hi Merks,
>> Thanks for the reply which is very useful information. I went through
>> the source code of org.eclipse.uml2.codegen.ecore_1.2.1 plugin to get
>> better understanding of your solution. Its clear creating a new class
>> extending GenBaseGeneratorAdapter and overiding the
>> addClasspathEntries should do the trick. However I am bit stuck to
>> identify how we are going to make sure that our extended class is
>> used instead of GenBaseGeneratorAdapter class. Do we have to create a
>> new adapter factory class as well? It will be great if you can
>> explain how we are going to integrate our extended class.
>
>
>> I can see that in uml2.codgen.ecore plugin, they have created their
>> own GenClassGeneratorAdapter class that extends
>> org.eclipse.emf.codegen.ecore.genmodel.generator.GenClassGen eratorAdapter
>> and in this class they have override addClasspathEntries as follows;
>
>
>> protected void addClasspathEntries(JETEmitter jetEmitter)
>> throws JETException {
>> super.addClasspathEntries(jetEmitter);
>> *UML2GenBaseGeneratorAdapter.addUML2ClasspathEntries(jetEmit ter);*
>> }
>
>
>> Is this the trick you are doing or this is related to some other
>> requirement? If so still how are we making sure that our version of
>> GenClassGeneratorAdapter class is used?
>
>
>> My requirement is simply to add new class path entry to the
>> JETEmitter project.
>> I highly appreciate your response.
>
>
>> Thanks
>> Nalaka
>
>
>
>> Ed Merks wrote:
>
>
>>> Nalaka,
>>
>
>>> You can override createJETEMitter and you can also make your
>>> extension use a different project by calling
>>> JETEmitter.setProjectName to something other than .JETEmitters. The
>>> UML project overrides just the addClasspathEntries method to add
>>> additional UML2-specific entries.
>>
>
>>> public class UML2GenBaseGeneratorAdapter
>>> extends GenBaseGeneratorAdapter {
>>
>
>>> protected static void addUML2ClasspathEntries(JETEmitter
>>> jetEmitter)
>>> throws JETException {
>>> jetEmitter.addVariable("UML2_CODEGEN_ECORE", //$NON-NLS-1$
>>> "org.eclipse.uml2.codegen.ecore"); //$NON-NLS-1$
>>> }
>>
>
>>> public UML2GenBaseGeneratorAdapter(
>>> GeneratorAdapterFactory generatorAdapterFactory) {
>>> super(generatorAdapterFactory);
>>> }
>>
>
>>> protected void *addClasspathEntries*(JETEmitter jetEmitter)
>>> throws JETException {
>>> super.addClasspathEntries(jetEmitter);
>>
>
>>> addUML2ClasspathEntries(jetEmitter);
>>> }
>>
>
>>> }
>>
>
>
>>> Nalaka Gamage wrote:
>>>
>>>> Hi All,
>>>> In my own plugin, I am calling generate method of
>>>> org.eclipse.emf.codegen.ecore.generator.Generator class (which is
>>>> new in codegen.ecore 2.2.1) to generate the code for my genModel.
>>>> Earlier I used to call generate method os the
>>>> org.eclipse.emf.codegen.ecore.genmodel.GenModel. However now its
>>>> depreciated.
>>>> Now the issue is since I am using customised jet templates to
>>>> generate codes I have to add a jar file available in my plugin to
>>>> the jetEmitter project's class path so that jetemitter project get
>>>> comiled correctly. Is it possible to add new classpath entries to
>>>> jetemitter project with new
>>>> org.eclipse.emf.codegen.ecore.generator.Generator class ?
>>>>
>>>> I tried creating the jetemitter project myself before calling the
>>>> generate method. However I found that my jetemitter project get
>>>> overridden by the jetemiiteer project created by calling generate
>>>> method. In fact I found that jet emitter project get created as
>>>> follows in the execution path; AbstractGeneratorAdapter=>
>>>> getJETEmitter() => createJETEmitter() genBaseGeneratorAdapter
>>>> => addClasspathentries()
>>>>
>>>> Is there a possibility to override the createJETEmitter() method of
>>>> AbstractGeneratorAdapter class? Or is there any other solution for
>>>> this?
>>>>
>>>> Can anyone help me resolve this issue?
>>>> Thanks in advance
>>>>
>>>> Nalaka
>>>>
>>>>
>
>
Re: Can I add my own class path entries to JETEmitter project [message #55649 is a reply to message #55567] Mon, 02 October 2006 13:11 Go to previous messageGo to next message
nalaka gamage is currently offline nalaka gamageFriend
Messages: 30
Registered: July 2009
Member
Hi Merks,

Thanks for the reply.

Earlier we were creating JETEmittersProject by calling our own method
createJETEmittersProject oursrselves before calling the generate method of
org.eclipse.emf.codegen.ecore.genmodel class.

public static void createJETEmittersProject(IProgressMonitor
progressMonitor ) throws Exception {

List classpathEntries = new ArrayList();

addVariable("EMF_CODEGEN", "org.eclipse.emf.codegen", classpathEntries);
addVariable("EMF_CODEGEN_ECORE", "org.eclipse.emf.codegen.ecore",
classpathEntries);
addVariable("EMF_COMMON", "org.eclipse.emf.common", classpathEntries);
addVariable("EMF_ECORE", "org.eclipse.emf.ecore", classpathEntries);
createProject(progressMonitor, ".JETEmitters", classpathEntries);
IWorkspace workspace = ResourcesPlugin.getWorkspace();
IProject project = workspace.getRoot().getProject(".JETEmitters");
XXXXUtil.addClasspathEntry(project, "XXXX_VARIABLE_NAME", "xxxxx.jar",
"com....pluginid.xxxx", progressMonitor); // This is our internal method
to add the additional class path entry
}


Then also we had subclass GenModelImpl class and override the
createJETEmitter method as follows;

public class XXXXGenModelImpl extends GenModelImpl {
/**
* Overrided parant class method
*/
protected JETEmitter createJETEmitter(String relativeTemplateURI)
{
ClassLoader classLoader =
XXXXOUrPlugin.getDefault().getClass().getClassLoader();
JETEmitter jetEmitter =
new JETEmitter(getTemplatePath(), relativeTemplateURI, classLoader)
{
public void initialize(IProgressMonitor progressMonitor) throws
JETException
{
addVariable("EMF_CODEGENYYYY", "org.eclipse.emf.codegen");
addVariable("EMF_CODEGEN_ECORE", "org.eclipse.emf.codegen.ecore");
addVariable("EMF_COMMON", "org.eclipse.emf.common");
addVariable("EMF_ECORE", "org.eclipse.emf.ecore");
super.initialize(progressMonitor);
}
};
return jetEmitter;
}
}


Note that here we are using the class loader obtained through our plugin
as well.

Then we had instantiated our extended gen model as follows;

GenModel genModel = new
XXXXGenModelImpl((GenModel)genModelResource.getContents().ge t(0),(ResourceImpl)genModelResource
);
...
...
genModel.generate(new SubProgressMonitor(progressMonitor, 1));

In this way the jetemitter project we had created by ourselves never got
overidden, but when we are calling generete method in newly intrdused
org.eclipse.emf.codegen.ecore.generator.Generator class our GETEmitter
project that have additional class path entries get override.

This is our original issue that we are looking for a new fix.

Thanks
Nalaka

Ed Merks wrote:

> Nalaka,

> I imagine you'll need to create a specialized factory that creates your
> specialized adapters for each of the adapters the factory currently
> creates. How were you previously solving this problem before we
> provided the adapters?


> Nalaka Gamage wrote:

>> Hi Merks,
>> Thanks for the reply which is very useful information. I went through
>> the source code of org.eclipse.uml2.codegen.ecore_1.2.1 plugin to get
>> better understanding of your solution. Its clear creating a new class
>> extending GenBaseGeneratorAdapter and overiding the
>> addClasspathEntries should do the trick. However I am bit stuck to
>> identify how we are going to make sure that our extended class is used
>> instead of GenBaseGeneratorAdapter class. Do we have to create a new
>> adapter factory class as well? It will be great if you can explain how
>> we are going to integrate our extended class.
>>
>> I can see that in uml2.codgen.ecore plugin, they have created their
>> own GenClassGeneratorAdapter class that extends
>> org.eclipse.emf.codegen.ecore.genmodel.generator.GenClassGen eratorAdapter
>> and in this class they have override addClasspathEntries as follows;
>>
>> protected void addClasspathEntries(JETEmitter jetEmitter)
>> throws JETException {
>> super.addClasspathEntries(jetEmitter);
>> *UML2GenBaseGeneratorAdapter.addUML2ClasspathEntries(jetEmit ter);*
>> }
>>
>> Is this the trick you are doing or this is related to some other
>> requirement? If so still how are we making sure that our version of
>> GenClassGeneratorAdapter class is used?
>>
>> My requirement is simply to add new class path entry to the JETEmitter
>> project.
>> I highly appreciate your response.
>>
>> Thanks
>> Nalaka
>>
>> Ed Merks wrote:
>>
>>> Nalaka,
>>
>>
>>> You can override createJETEMitter and you can also make your
>>> extension use a different project by calling
>>> JETEmitter.setProjectName to something other than .JETEmitters. The
>>> UML project overrides just the addClasspathEntries method to add
>>> additional UML2-specific entries.
>>
>>
>>> public class UML2GenBaseGeneratorAdapter
>>> extends GenBaseGeneratorAdapter {
>>
>>
>>> protected static void addUML2ClasspathEntries(JETEmitter
>>> jetEmitter)
>>> throws JETException {
>>> jetEmitter.addVariable("UML2_CODEGEN_ECORE", //$NON-NLS-1$
>>> "org.eclipse.uml2.codegen.ecore"); //$NON-NLS-1$
>>> }
>>
>>
>>> public UML2GenBaseGeneratorAdapter(
>>> GeneratorAdapterFactory generatorAdapterFactory) {
>>> super(generatorAdapterFactory);
>>> }
>>
>>
>>> protected void *addClasspathEntries*(JETEmitter jetEmitter)
>>> throws JETException {
>>> super.addClasspathEntries(jetEmitter);
>>
>>
>>> addUML2ClasspathEntries(jetEmitter);
>>> }
>>
>>
>>> }
>>
>>
>>
>>> Nalaka Gamage wrote:
>>>
>>>> Hi All,
>>>> In my own plugin, I am calling generate method of
>>>> org.eclipse.emf.codegen.ecore.generator.Generator class (which is
>>>> new in codegen.ecore 2.2.1) to generate the code for my genModel.
>>>> Earlier I used to call generate method os the
>>>> org.eclipse.emf.codegen.ecore.genmodel.GenModel. However now its
>>>> depreciated.
>>>> Now the issue is since I am using customised jet templates to
>>>> generate codes I have to add a jar file available in my plugin to
>>>> the jetEmitter project's class path so that jetemitter project get
>>>> comiled correctly. Is it possible to add new classpath entries to
>>>> jetemitter project with new
>>>> org.eclipse.emf.codegen.ecore.generator.Generator class ?
>>>>
>>>> I tried creating the jetemitter project myself before calling the
>>>> generate method. However I found that my jetemitter project get
>>>> overridden by the jetemiiteer project created by calling generate
>>>> method. In fact I found that jet emitter project get created as
>>>> follows in the execution path; AbstractGeneratorAdapter=>
>>>> getJETEmitter() => createJETEmitter() genBaseGeneratorAdapter =>
>>>> addClasspathentries()
>>>>
>>>> Is there a possibility to override the createJETEmitter() method of
>>>> AbstractGeneratorAdapter class? Or is there any other solution for
>>>> this?
>>>>
>>>> Can anyone help me resolve this issue?
>>>> Thanks in advance
>>>>
>>>> Nalaka
>>>>
>>>>
>>
>>
Re: Can I add my own class path entries to JETEmitter project [message #55676 is a reply to message #55649] Mon, 02 October 2006 13:46 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Nalaka,

I see. So our changes haven't made life simpler for you. :-( We could
probably make life a lot simpler if we added a feature similar to "Model
Plug-in Variables" (which specifies additional plugin dependencies for
the generated model project) but for specifying additional plugins to be
added to the project for compiling the dynamic templates, e.g.,
MY_UTILITIES=org.example.my.utilities would specify the variable name
and the plugin ID. If that seems useful, please open a feature request
for it. This is somewhat related to
https://bugs.eclipse.org/bugs/show_bug.cgi?id=147318 where the desire is
to be able to point to a project where the templates have already been
compiled by virtue of that project having a JET Nature.


Nalaka Gamage wrote:

> Hi Merks,
>
> Thanks for the reply.
>
> Earlier we were creating JETEmittersProject by calling our own method
> createJETEmittersProject oursrselves before calling the generate
> method of org.eclipse.emf.codegen.ecore.genmodel class.
>
> public static void createJETEmittersProject(IProgressMonitor
> progressMonitor ) throws Exception {
> List classpathEntries = new ArrayList();
> addVariable("EMF_CODEGEN", "org.eclipse.emf.codegen",
> classpathEntries);
> addVariable("EMF_CODEGEN_ECORE", "org.eclipse.emf.codegen.ecore",
> classpathEntries);
> addVariable("EMF_COMMON", "org.eclipse.emf.common", classpathEntries);
> addVariable("EMF_ECORE", "org.eclipse.emf.ecore", classpathEntries);
> createProject(progressMonitor, ".JETEmitters", classpathEntries);
> IWorkspace workspace = ResourcesPlugin.getWorkspace();
> IProject project = workspace.getRoot().getProject(".JETEmitters");
> XXXXUtil.addClasspathEntry(project, "XXXX_VARIABLE_NAME", "xxxxx.jar",
> "com....pluginid.xxxx", progressMonitor); // This is our internal
> method to add the additional class path entry
> }
>
>
> Then also we had subclass GenModelImpl class and override the
> createJETEmitter method as follows;
>
> public class XXXXGenModelImpl extends GenModelImpl {
> /**
> * Overrided parant class method
> */
> protected JETEmitter createJETEmitter(String relativeTemplateURI)
> {
> ClassLoader classLoader =
> XXXXOUrPlugin.getDefault().getClass().getClassLoader();
> JETEmitter jetEmitter = new JETEmitter(getTemplatePath(),
> relativeTemplateURI, classLoader)
> {
> public void initialize(IProgressMonitor progressMonitor) throws
> JETException
> {
> addVariable("EMF_CODEGENYYYY", "org.eclipse.emf.codegen");
> addVariable("EMF_CODEGEN_ECORE", "org.eclipse.emf.codegen.ecore");
> addVariable("EMF_COMMON", "org.eclipse.emf.common");
> addVariable("EMF_ECORE", "org.eclipse.emf.ecore");
> super.initialize(progressMonitor);
> }
> };
> return jetEmitter;
> }
> }
>
>
> Note that here we are using the class loader obtained through our
> plugin as well.
>
> Then we had instantiated our extended gen model as follows;
>
> GenModel genModel = new
> XXXXGenModelImpl((GenModel)genModelResource.getContents().ge t(0),(ResourceImpl)genModelResource
> );
> ..
> ..
> genModel.generate(new SubProgressMonitor(progressMonitor, 1));
>
> In this way the jetemitter project we had created by ourselves never
> got overidden, but when we are calling generete method in newly
> intrdused org.eclipse.emf.codegen.ecore.generator.Generator class our
> GETEmitter project that have additional class path entries get override.
>
> This is our original issue that we are looking for a new fix.
>
> Thanks
> Nalaka
>
> Ed Merks wrote:
>
>> Nalaka,
>
>
>> I imagine you'll need to create a specialized factory that creates
>> your specialized adapters for each of the adapters the factory
>> currently creates. How were you previously solving this problem
>> before we provided the adapters?
>
>
>
>> Nalaka Gamage wrote:
>
>
>>> Hi Merks,
>>> Thanks for the reply which is very useful information. I went
>>> through the source code of org.eclipse.uml2.codegen.ecore_1.2.1
>>> plugin to get better understanding of your solution. Its clear
>>> creating a new class extending GenBaseGeneratorAdapter and overiding
>>> the addClasspathEntries should do the trick. However I am bit stuck
>>> to identify how we are going to make sure that our extended class is
>>> used instead of GenBaseGeneratorAdapter class. Do we have to create
>>> a new adapter factory class as well? It will be great if you can
>>> explain how we are going to integrate our extended class.
>>>
>>> I can see that in uml2.codgen.ecore plugin, they have created their
>>> own GenClassGeneratorAdapter class that extends
>>> org.eclipse.emf.codegen.ecore.genmodel.generator.GenClassGen eratorAdapter
>>> and in this class they have override addClasspathEntries as follows;
>>>
>>> protected void addClasspathEntries(JETEmitter jetEmitter)
>>> throws JETException {
>>> super.addClasspathEntries(jetEmitter);
>>> *UML2GenBaseGeneratorAdapter.addUML2ClasspathEntries(jetEmit ter);*
>>> }
>>>
>>> Is this the trick you are doing or this is related to some other
>>> requirement? If so still how are we making sure that our version of
>>> GenClassGeneratorAdapter class is used?
>>>
>>> My requirement is simply to add new class path entry to the
>>> JETEmitter project.
>>> I highly appreciate your response.
>>>
>>> Thanks
>>> Nalaka
>>>
>>> Ed Merks wrote:
>>>
>>>> Nalaka,
>>>
>>>
>>>
>>>> You can override createJETEMitter and you can also make your
>>>> extension use a different project by calling
>>>> JETEmitter.setProjectName to something other than .JETEmitters.
>>>> The UML project overrides just the addClasspathEntries method to
>>>> add additional UML2-specific entries.
>>>
>>>
>>>
>>>> public class UML2GenBaseGeneratorAdapter
>>>> extends GenBaseGeneratorAdapter {
>>>
>>>
>>>
>>>> protected static void addUML2ClasspathEntries(JETEmitter
>>>> jetEmitter)
>>>> throws JETException {
>>>> jetEmitter.addVariable("UML2_CODEGEN_ECORE", //$NON-NLS-1$
>>>> "org.eclipse.uml2.codegen.ecore"); //$NON-NLS-1$
>>>> }
>>>
>>>
>>>
>>>> public UML2GenBaseGeneratorAdapter(
>>>> GeneratorAdapterFactory generatorAdapterFactory) {
>>>> super(generatorAdapterFactory);
>>>> }
>>>
>>>
>>>
>>>> protected void *addClasspathEntries*(JETEmitter jetEmitter)
>>>> throws JETException {
>>>> super.addClasspathEntries(jetEmitter);
>>>
>>>
>>>
>>>> addUML2ClasspathEntries(jetEmitter);
>>>> }
>>>
>>>
>>>
>>>> }
>>>
>>>
>>>
>>>
>>>> Nalaka Gamage wrote:
>>>>
>>>>> Hi All,
>>>>> In my own plugin, I am calling generate method of
>>>>> org.eclipse.emf.codegen.ecore.generator.Generator class (which is
>>>>> new in codegen.ecore 2.2.1) to generate the code for my genModel.
>>>>> Earlier I used to call generate method os the
>>>>> org.eclipse.emf.codegen.ecore.genmodel.GenModel. However now its
>>>>> depreciated.
>>>>> Now the issue is since I am using customised jet templates to
>>>>> generate codes I have to add a jar file available in my plugin to
>>>>> the jetEmitter project's class path so that jetemitter project get
>>>>> comiled correctly. Is it possible to add new classpath entries to
>>>>> jetemitter project with new
>>>>> org.eclipse.emf.codegen.ecore.generator.Generator class ?
>>>>>
>>>>> I tried creating the jetemitter project myself before calling the
>>>>> generate method. However I found that my jetemitter project get
>>>>> overridden by the jetemiiteer project created by calling generate
>>>>> method. In fact I found that jet emitter project get created as
>>>>> follows in the execution path; AbstractGeneratorAdapter=>
>>>>> getJETEmitter() => createJETEmitter() genBaseGeneratorAdapter
>>>>> => addClasspathentries()
>>>>>
>>>>> Is there a possibility to override the createJETEmitter() method
>>>>> of AbstractGeneratorAdapter class? Or is there any other solution
>>>>> for this?
>>>>>
>>>>> Can anyone help me resolve this issue?
>>>>> Thanks in advance
>>>>>
>>>>> Nalaka
>>>>>
>>>>>
>>>
>>>
>
>
Re: Can I add my own class path entries to JETEmitter project [message #56131 is a reply to message #55676] Tue, 03 October 2006 14:24 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: giacomin.vettatech.com

Nalaka,

Please let me know when you create the feature request because I'm also
interested in.

Thanks,
--
Ricardo Giacomin


"Ed Merks" <merks@ca.ibm.com> wrote in message
news:efr57l$c17$1@utils.eclipse.org...
> Nalaka,
>
> I see. So our changes haven't made life simpler for you. :-( We could
> probably make life a lot simpler if we added a feature similar to "Model
> Plug-in Variables" (which specifies additional plugin dependencies for the
> generated model project) but for specifying additional plugins to be added
> to the project for compiling the dynamic templates, e.g.,
> MY_UTILITIES=org.example.my.utilities would specify the variable name and
> the plugin ID. If that seems useful, please open a feature request for
> it. This is somewhat related to
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=147318 where the desire is
> to be able to point to a project where the templates have already been
> compiled by virtue of that project having a JET Nature.
>
>
> Nalaka Gamage wrote:
>
>> Hi Merks,
>>
>> Thanks for the reply.
>>
>> Earlier we were creating JETEmittersProject by calling our own method
>> createJETEmittersProject oursrselves before calling the generate method
>> of org.eclipse.emf.codegen.ecore.genmodel class.
>>
>> public static void createJETEmittersProject(IProgressMonitor
>> progressMonitor ) throws Exception {
>> List classpathEntries = new ArrayList();
>> addVariable("EMF_CODEGEN", "org.eclipse.emf.codegen",
>> classpathEntries);
>> addVariable("EMF_CODEGEN_ECORE", "org.eclipse.emf.codegen.ecore",
>> classpathEntries);
>> addVariable("EMF_COMMON", "org.eclipse.emf.common", classpathEntries);
>> addVariable("EMF_ECORE", "org.eclipse.emf.ecore", classpathEntries);
>> createProject(progressMonitor, ".JETEmitters", classpathEntries);
>> IWorkspace workspace = ResourcesPlugin.getWorkspace();
>> IProject project = workspace.getRoot().getProject(".JETEmitters");
>> XXXXUtil.addClasspathEntry(project, "XXXX_VARIABLE_NAME", "xxxxx.jar",
>> "com....pluginid.xxxx", progressMonitor); // This is our internal method
>> to add the additional class path entry
>> }
>>
>>
>> Then also we had subclass GenModelImpl class and override the
>> createJETEmitter method as follows;
>>
>> public class XXXXGenModelImpl extends GenModelImpl {
>> /**
>> * Overrided parant class method
>> */
>> protected JETEmitter createJETEmitter(String relativeTemplateURI)
>> {
>> ClassLoader classLoader =
>> XXXXOUrPlugin.getDefault().getClass().getClassLoader();
>> JETEmitter jetEmitter = new JETEmitter(getTemplatePath(),
>> relativeTemplateURI, classLoader)
>> {
>> public void initialize(IProgressMonitor progressMonitor) throws
>> JETException
>> {
>> addVariable("EMF_CODEGENYYYY", "org.eclipse.emf.codegen");
>> addVariable("EMF_CODEGEN_ECORE", "org.eclipse.emf.codegen.ecore");
>> addVariable("EMF_COMMON", "org.eclipse.emf.common");
>> addVariable("EMF_ECORE", "org.eclipse.emf.ecore");
>> super.initialize(progressMonitor);
>> }
>> };
>> return jetEmitter;
>> }
>> }
>>
>>
>> Note that here we are using the class loader obtained through our plugin
>> as well.
>>
>> Then we had instantiated our extended gen model as follows;
>>
>> GenModel genModel = new
>> XXXXGenModelImpl((GenModel)genModelResource.getContents().ge t(0),(ResourceImpl)genModelResource
>> );
>> ..
>> ..
>> genModel.generate(new SubProgressMonitor(progressMonitor, 1));
>>
>> In this way the jetemitter project we had created by ourselves never got
>> overidden, but when we are calling generete method in newly intrdused
>> org.eclipse.emf.codegen.ecore.generator.Generator class our GETEmitter
>> project that have additional class path entries get override.
>>
>> This is our original issue that we are looking for a new fix.
>>
>> Thanks
>> Nalaka
>>
>> Ed Merks wrote:
>>
>>> Nalaka,
>>
>>
>>> I imagine you'll need to create a specialized factory that creates your
>>> specialized adapters for each of the adapters the factory currently
>>> creates. How were you previously solving this problem before we
>>> provided the adapters?
>>
>>
>>
>>> Nalaka Gamage wrote:
>>
>>
>>>> Hi Merks,
>>>> Thanks for the reply which is very useful information. I went through
>>>> the source code of org.eclipse.uml2.codegen.ecore_1.2.1 plugin to get
>>>> better understanding of your solution. Its clear creating a new class
>>>> extending GenBaseGeneratorAdapter and overiding the addClasspathEntries
>>>> should do the trick. However I am bit stuck to identify how we are
>>>> going to make sure that our extended class is used instead of
>>>> GenBaseGeneratorAdapter class. Do we have to create a new adapter
>>>> factory class as well? It will be great if you can explain how we are
>>>> going to integrate our extended class.
>>>>
>>>> I can see that in uml2.codgen.ecore plugin, they have created their own
>>>> GenClassGeneratorAdapter class that extends
>>>> org.eclipse.emf.codegen.ecore.genmodel.generator.GenClassGen eratorAdapter
>>>> and in this class they have override addClasspathEntries as follows;
>>>>
>>>> protected void addClasspathEntries(JETEmitter jetEmitter)
>>>> throws JETException {
>>>> super.addClasspathEntries(jetEmitter);
>>>> *UML2GenBaseGeneratorAdapter.addUML2ClasspathEntries(jetEmit ter);*
>>>> }
>>>>
>>>> Is this the trick you are doing or this is related to some other
>>>> requirement? If so still how are we making sure that our version of
>>>> GenClassGeneratorAdapter class is used?
>>>>
>>>> My requirement is simply to add new class path entry to the JETEmitter
>>>> project.
>>>> I highly appreciate your response.
>>>>
>>>> Thanks
>>>> Nalaka
>>>>
>>>> Ed Merks wrote:
>>>>
>>>>> Nalaka,
>>>>
>>>>
>>>>
>>>>> You can override createJETEMitter and you can also make your extension
>>>>> use a different project by calling JETEmitter.setProjectName to
>>>>> something other than .JETEmitters. The UML project overrides just the
>>>>> addClasspathEntries method to add additional UML2-specific entries.
>>>>
>>>>
>>>>
>>>>> public class UML2GenBaseGeneratorAdapter
>>>>> extends GenBaseGeneratorAdapter {
>>>>
>>>>
>>>>
>>>>> protected static void addUML2ClasspathEntries(JETEmitter
>>>>> jetEmitter)
>>>>> throws JETException {
>>>>> jetEmitter.addVariable("UML2_CODEGEN_ECORE", //$NON-NLS-1$
>>>>> "org.eclipse.uml2.codegen.ecore"); //$NON-NLS-1$
>>>>> }
>>>>
>>>>
>>>>
>>>>> public UML2GenBaseGeneratorAdapter(
>>>>> GeneratorAdapterFactory generatorAdapterFactory) {
>>>>> super(generatorAdapterFactory);
>>>>> }
>>>>
>>>>
>>>>
>>>>> protected void *addClasspathEntries*(JETEmitter jetEmitter)
>>>>> throws JETException {
>>>>> super.addClasspathEntries(jetEmitter);
>>>>
>>>>
>>>>
>>>>> addUML2ClasspathEntries(jetEmitter);
>>>>> }
>>>>
>>>>
>>>>
>>>>> }
>>>>
>>>>
>>>>
>>>>
>>>>> Nalaka Gamage wrote:
>>>>>
>>>>>> Hi All,
>>>>>> In my own plugin, I am calling generate method of
>>>>>> org.eclipse.emf.codegen.ecore.generator.Generator class (which is new
>>>>>> in codegen.ecore 2.2.1) to generate the code for my genModel. Earlier
>>>>>> I used to call generate method os the
>>>>>> org.eclipse.emf.codegen.ecore.genmodel.GenModel. However now its
>>>>>> depreciated.
>>>>>> Now the issue is since I am using customised jet templates to
>>>>>> generate codes I have to add a jar file available in my plugin to the
>>>>>> jetEmitter project's class path so that jetemitter project get
>>>>>> comiled correctly. Is it possible to add new classpath entries to
>>>>>> jetemitter project with new
>>>>>> org.eclipse.emf.codegen.ecore.generator.Generator class ?
>>>>>>
>>>>>> I tried creating the jetemitter project myself before calling the
>>>>>> generate method. However I found that my jetemitter project get
>>>>>> overridden by the jetemiiteer project created by calling generate
>>>>>> method. In fact I found that jet emitter project get created as
>>>>>> follows in the execution path; AbstractGeneratorAdapter=>
>>>>>> getJETEmitter() => createJETEmitter() genBaseGeneratorAdapter =>
>>>>>> addClasspathentries()
>>>>>>
>>>>>> Is there a possibility to override the createJETEmitter() method of
>>>>>> AbstractGeneratorAdapter class? Or is there any other solution for
>>>>>> this?
>>>>>>
>>>>>> Can anyone help me resolve this issue?
>>>>>> Thanks in advance
>>>>>>
>>>>>> Nalaka
>>>>>>
>>>>>>
>>>>
>>>>
>>
>>
Re: Can I add my own class path entries to JETEmitter project [message #56179 is a reply to message #56131] Tue, 03 October 2006 15:24 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Ricardo,

You're more than welcome to open it yourself. I think it would be very
useful, but if the community doesn't open a feature request, then that
tells me it's not very important...


Ricardo Giacomin wrote:
> Nalaka,
>
> Please let me know when you create the feature request because I'm also
> interested in.
>
> Thanks,
>
Re: Can I add my own class path entries to JETEmitter project [message #56263 is a reply to message #56179] Wed, 04 October 2006 04:20 Go to previous message
nalaka gamage is currently offline nalaka gamageFriend
Messages: 30
Registered: July 2009
Member
Hi All,
I have added a feature request for this.
Bug 159691
https://bugs.eclipse.org/bugs/show_bug.cgi?id=159691

Regards
Nalaka

Ed Merks wrote:

> Ricardo,

> You're more than welcome to open it yourself. I think it would be very
> useful, but if the community doesn't open a feature request, then that
> tells me it's not very important...


> Ricardo Giacomin wrote:
>> Nalaka,
>>
>> Please let me know when you create the feature request because I'm also
>> interested in.
>>
>> Thanks,
>>
Re: Can I add my own class path entries to JETEmitter project [message #593143 is a reply to message #55460] Sun, 01 October 2006 12:55 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33147
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------010703030409020103090507
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Nalaka,

You can override createJETEMitter and you can also make your extension
use a different project by calling JETEmitter.setProjectName to
something other than .JETEmitters. The UML project overrides just the
addClasspathEntries method to add additional UML2-specific entries.

public class UML2GenBaseGeneratorAdapter
extends GenBaseGeneratorAdapter {

protected static void addUML2ClasspathEntries(JETEmitter jetEmitter)
throws JETException {
jetEmitter.addVariable("UML2_CODEGEN_ECORE", //$NON-NLS-1$
"org.eclipse.uml2.codegen.ecore"); //$NON-NLS-1$
}

public UML2GenBaseGeneratorAdapter(
GeneratorAdapterFactory generatorAdapterFactory) {
super(generatorAdapterFactory);
}

protected void *addClasspathEntries*(JETEmitter jetEmitter)
throws JETException {
super.addClasspathEntries(jetEmitter);

addUML2ClasspathEntries(jetEmitter);
}

}


Nalaka Gamage wrote:
> Hi All,
> In my own plugin, I am calling generate method of
> org.eclipse.emf.codegen.ecore.generator.Generator class (which is new
> in codegen.ecore 2.2.1) to generate the code for my genModel. Earlier
> I used to call generate method os the
> org.eclipse.emf.codegen.ecore.genmodel.GenModel. However now its
> depreciated.
> Now the issue is since I am using customised jet templates to generate
> codes I have to add a jar file available in my plugin to the
> jetEmitter project's class path so that jetemitter project get comiled
> correctly. Is it possible to add new classpath entries to jetemitter
> project with new org.eclipse.emf.codegen.ecore.generator.Generator
> class ?
>
> I tried creating the jetemitter project myself before calling the
> generate method. However I found that my jetemitter project get
> overridden by the jetemiiteer project created by calling generate
> method. In fact I found that jet emitter project get created as
> follows in the execution path; AbstractGeneratorAdapter=>
> getJETEmitter() => createJETEmitter() genBaseGeneratorAdapter =>
> addClasspathentries()
>
> Is there a possibility to override the createJETEmitter() method of
> AbstractGeneratorAdapter class? Or is there any other solution for this?
>
> Can anyone help me resolve this issue?
> Thanks in advance
>
> Nalaka
>
>


--------------010703030409020103090507
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Nalaka,<br>
<br>
You can override createJETEMitter and you can also make your extension
use a different project by calling JETEmitter.setProjectName to
something other than .JETEmitters.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Can I add my own class path entries to JETEmitter project [message #593153 is a reply to message #55487] Mon, 02 October 2006 07:30 Go to previous message
nalaka gamage is currently offline nalaka gamageFriend
Messages: 30
Registered: July 2009
Member
Hi Merks,
Thanks for the reply which is very useful information.
I went through the source code of org.eclipse.uml2.codegen.ecore_1.2.1
plugin to get better understanding of your solution. Its clear creating a
new class extending GenBaseGeneratorAdapter and overiding the
addClasspathEntries should do the trick.
However I am bit stuck to identify how we are going to make sure that our
extended class is used instead of GenBaseGeneratorAdapter class. Do we
have to create a new adapter factory class as well? It will be great if
you can explain how we are going to integrate our extended class.

I can see that in uml2.codgen.ecore plugin, they have created their own
GenClassGeneratorAdapter class that extends
org.eclipse.emf.codegen.ecore.genmodel.generator.GenClassGen eratorAdapter
and in this class they have override addClasspathEntries as follows;

protected void addClasspathEntries(JETEmitter jetEmitter)
throws JETException {
super.addClasspathEntries(jetEmitter);
*UML2GenBaseGeneratorAdapter.addUML2ClasspathEntries(jetEmit ter);*
}

Is this the trick you are doing or this is related to some other
requirement? If so still how are we making sure that our version of
GenClassGeneratorAdapter class is used?

My requirement is simply to add new class path entry to the JETEmitter
project.
I highly appreciate your response.

Thanks
Nalaka


Ed Merks wrote:

> Nalaka,

> You can override createJETEMitter and you can also make your extension
> use a different project by calling JETEmitter.setProjectName to
> something other than .JETEmitters. The UML project overrides just the
> addClasspathEntries method to add additional UML2-specific entries.

> public class UML2GenBaseGeneratorAdapter
> extends GenBaseGeneratorAdapter {

> protected static void addUML2ClasspathEntries(JETEmitter jetEmitter)
> throws JETException {
> jetEmitter.addVariable("UML2_CODEGEN_ECORE", //$NON-NLS-1$
> "org.eclipse.uml2.codegen.ecore"); //$NON-NLS-1$
> }

> public UML2GenBaseGeneratorAdapter(
> GeneratorAdapterFactory generatorAdapterFactory) {
> super(generatorAdapterFactory);
> }

> protected void *addClasspathEntries*(JETEmitter jetEmitter)
> throws JETException {
> super.addClasspathEntries(jetEmitter);

> addUML2ClasspathEntries(jetEmitter);
> }

> }


> Nalaka Gamage wrote:
>> Hi All,
>> In my own plugin, I am calling generate method of
>> org.eclipse.emf.codegen.ecore.generator.Generator class (which is new
>> in codegen.ecore 2.2.1) to generate the code for my genModel. Earlier
>> I used to call generate method os the
>> org.eclipse.emf.codegen.ecore.genmodel.GenModel. However now its
>> depreciated.
>> Now the issue is since I am using customised jet templates to generate
>> codes I have to add a jar file available in my plugin to the
>> jetEmitter project's class path so that jetemitter project get comiled
>> correctly. Is it possible to add new classpath entries to jetemitter
>> project with new org.eclipse.emf.codegen.ecore.generator.Generator
>> class ?
>>
>> I tried creating the jetemitter project myself before calling the
>> generate method. However I found that my jetemitter project get
>> overridden by the jetemiiteer project created by calling generate
>> method. In fact I found that jet emitter project get created as
>> follows in the execution path; AbstractGeneratorAdapter=>
>> getJETEmitter() => createJETEmitter() genBaseGeneratorAdapter =>
>> addClasspathentries()
>>
>> Is there a possibility to override the createJETEmitter() method of
>> AbstractGeneratorAdapter class? Or is there any other solution for this?
>>
>> Can anyone help me resolve this issue?
>> Thanks in advance
>>
>> Nalaka
>>
>>
Re: Can I add my own class path entries to JETEmitter project [message #593164 is a reply to message #55514] Mon, 02 October 2006 11:38 Go to previous message
nalaka gamage is currently offline nalaka gamageFriend
Messages: 30
Registered: July 2009
Member
Hi Merks and All,

I further researched into org.eclipse.uml2.codegen.ecore_1.2.1 code base
and found that in the plugin.xml,following extension point entries
available;
<extension point="org.eclipse.emf.codegen.ecore.generatorAdapters">
<adapterFactory
modelPackage = "http://www.eclipse.org/uml2/1.1.0/GenModel"
class=" org.eclipse.uml2.codegen.ecore.genmodel.generator.GenModelGe neratorAdapterFactory "/>
<adapterFactory
modelPackage = "http://www.eclipse.org/uml2/1.1.0/GenModel"
class=" org.eclipse.uml2.codegen.ecore.genmodel.generator.UML2GenMod elGeneratorAdapterFactory "/>
</extension>

In my case, I am also calling generete method from within my own plugin. I
feel I may follow same approach (correct me If I am wrong). Still I am not
exactly sure which factory to be extended
Should I use the exact same extension aproach as above or should there be
a simpler extension approach.
May I add the extension points in *my own plugin*, in that case do I have
to overide the org.eclipse.emf.codegen.ecore.generator.Generator class as
well?
Unfortunately there is no direct factory class for GenBaseGeneratorAdapter
(which I am now extending). Therefore, In my case also do I have to go
through the GenModelGeneratorAdapterFactory class extension as
uml2.codegen.ecore_1.2.1 does?

Do you feel this extension approach is feasible?
Please correct me if I am in a wrong path?

Thanks in advance,
Nalaka

Nalaka Gamage wrote:

> Hi Merks,
> Thanks for the reply which is very useful information.
> I went through the source code of org.eclipse.uml2.codegen.ecore_1.2.1
> plugin to get better understanding of your solution. Its clear creating a
> new class extending GenBaseGeneratorAdapter and overiding the
> addClasspathEntries should do the trick.
> However I am bit stuck to identify how we are going to make sure that our
> extended class is used instead of GenBaseGeneratorAdapter class. Do we
> have to create a new adapter factory class as well? It will be great if
> you can explain how we are going to integrate our extended class.

> I can see that in uml2.codgen.ecore plugin, they have created their own
> GenClassGeneratorAdapter class that extends
> org.eclipse.emf.codegen.ecore.genmodel.generator.GenClassGen eratorAdapter
> and in this class they have override addClasspathEntries as follows;

> protected void addClasspathEntries(JETEmitter jetEmitter)
> throws JETException {
> super.addClasspathEntries(jetEmitter);
> *UML2GenBaseGeneratorAdapter.addUML2ClasspathEntries(jetEmit ter);*
> }

> Is this the trick you are doing or this is related to some other
> requirement? If so still how are we making sure that our version of
> GenClassGeneratorAdapter class is used?

> My requirement is simply to add new class path entry to the JETEmitter
> project.
> I highly appreciate your response.

> Thanks
> Nalaka


> Ed Merks wrote:

>> Nalaka,

>> You can override createJETEMitter and you can also make your extension
>> use a different project by calling JETEmitter.setProjectName to
>> something other than .JETEmitters. The UML project overrides just the
>> addClasspathEntries method to add additional UML2-specific entries.

>> public class UML2GenBaseGeneratorAdapter
>> extends GenBaseGeneratorAdapter {

>> protected static void addUML2ClasspathEntries(JETEmitter jetEmitter)
>> throws JETException {
>> jetEmitter.addVariable("UML2_CODEGEN_ECORE", //$NON-NLS-1$
>> "org.eclipse.uml2.codegen.ecore"); //$NON-NLS-1$
>> }

>> public UML2GenBaseGeneratorAdapter(
>> GeneratorAdapterFactory generatorAdapterFactory) {
>> super(generatorAdapterFactory);
>> }

>> protected void *addClasspathEntries*(JETEmitter jetEmitter)
>> throws JETException {
>> super.addClasspathEntries(jetEmitter);

>> addUML2ClasspathEntries(jetEmitter);
>> }

>> }


>> Nalaka Gamage wrote:
>>> Hi All,
>>> In my own plugin, I am calling generate method of
>>> org.eclipse.emf.codegen.ecore.generator.Generator class (which is new
>>> in codegen.ecore 2.2.1) to generate the code for my genModel. Earlier
>>> I used to call generate method os the
>>> org.eclipse.emf.codegen.ecore.genmodel.GenModel. However now its
>>> depreciated.
>>> Now the issue is since I am using customised jet templates to generate
>>> codes I have to add a jar file available in my plugin to the
>>> jetEmitter project's class path so that jetemitter project get comiled
>>> correctly. Is it possible to add new classpath entries to jetemitter
>>> project with new org.eclipse.emf.codegen.ecore.generator.Generator
>>> class ?
>>>
>>> I tried creating the jetemitter project myself before calling the
>>> generate method. However I found that my jetemitter project get
>>> overridden by the jetemiiteer project created by calling generate
>>> method. In fact I found that jet emitter project get created as
>>> follows in the execution path; AbstractGeneratorAdapter=>
>>> getJETEmitter() => createJETEmitter() genBaseGeneratorAdapter =>
>>> addClasspathentries()
>>>
>>> Is there a possibility to override the createJETEmitter() method of
>>> AbstractGeneratorAdapter class? Or is there any other solution for this?
>>>
>>> Can anyone help me resolve this issue?
>>> Thanks in advance
>>>
>>> Nalaka
>>>
>>>
Re: Can I add my own class path entries to JETEmitter project [message #593170 is a reply to message #55514] Mon, 02 October 2006 12:01 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33147
Registered: July 2009
Senior Member
Nalaka,

I imagine you'll need to create a specialized factory that creates your
specialized adapters for each of the adapters the factory currently
creates. How were you previously solving this problem before we
provided the adapters?


Nalaka Gamage wrote:

> Hi Merks,
> Thanks for the reply which is very useful information. I went through
> the source code of org.eclipse.uml2.codegen.ecore_1.2.1 plugin to get
> better understanding of your solution. Its clear creating a new class
> extending GenBaseGeneratorAdapter and overiding the
> addClasspathEntries should do the trick. However I am bit stuck to
> identify how we are going to make sure that our extended class is used
> instead of GenBaseGeneratorAdapter class. Do we have to create a new
> adapter factory class as well? It will be great if you can explain how
> we are going to integrate our extended class.
>
> I can see that in uml2.codgen.ecore plugin, they have created their
> own GenClassGeneratorAdapter class that extends
> org.eclipse.emf.codegen.ecore.genmodel.generator.GenClassGen eratorAdapter
> and in this class they have override addClasspathEntries as follows;
>
> protected void addClasspathEntries(JETEmitter jetEmitter)
> throws JETException {
> super.addClasspathEntries(jetEmitter);
> *UML2GenBaseGeneratorAdapter.addUML2ClasspathEntries(jetEmit ter);*
> }
>
> Is this the trick you are doing or this is related to some other
> requirement? If so still how are we making sure that our version of
> GenClassGeneratorAdapter class is used?
>
> My requirement is simply to add new class path entry to the JETEmitter
> project.
> I highly appreciate your response.
>
> Thanks
> Nalaka
>
> Ed Merks wrote:
>
>> Nalaka,
>
>
>> You can override createJETEMitter and you can also make your
>> extension use a different project by calling
>> JETEmitter.setProjectName to something other than .JETEmitters. The
>> UML project overrides just the addClasspathEntries method to add
>> additional UML2-specific entries.
>
>
>> public class UML2GenBaseGeneratorAdapter
>> extends GenBaseGeneratorAdapter {
>
>
>> protected static void addUML2ClasspathEntries(JETEmitter
>> jetEmitter)
>> throws JETException {
>> jetEmitter.addVariable("UML2_CODEGEN_ECORE", //$NON-NLS-1$
>> "org.eclipse.uml2.codegen.ecore"); //$NON-NLS-1$
>> }
>
>
>> public UML2GenBaseGeneratorAdapter(
>> GeneratorAdapterFactory generatorAdapterFactory) {
>> super(generatorAdapterFactory);
>> }
>
>
>> protected void *addClasspathEntries*(JETEmitter jetEmitter)
>> throws JETException {
>> super.addClasspathEntries(jetEmitter);
>
>
>> addUML2ClasspathEntries(jetEmitter);
>> }
>
>
>> }
>
>
>
>> Nalaka Gamage wrote:
>>
>>> Hi All,
>>> In my own plugin, I am calling generate method of
>>> org.eclipse.emf.codegen.ecore.generator.Generator class (which is
>>> new in codegen.ecore 2.2.1) to generate the code for my genModel.
>>> Earlier I used to call generate method os the
>>> org.eclipse.emf.codegen.ecore.genmodel.GenModel. However now its
>>> depreciated.
>>> Now the issue is since I am using customised jet templates to
>>> generate codes I have to add a jar file available in my plugin to
>>> the jetEmitter project's class path so that jetemitter project get
>>> comiled correctly. Is it possible to add new classpath entries to
>>> jetemitter project with new
>>> org.eclipse.emf.codegen.ecore.generator.Generator class ?
>>>
>>> I tried creating the jetemitter project myself before calling the
>>> generate method. However I found that my jetemitter project get
>>> overridden by the jetemiiteer project created by calling generate
>>> method. In fact I found that jet emitter project get created as
>>> follows in the execution path; AbstractGeneratorAdapter=>
>>> getJETEmitter() => createJETEmitter() genBaseGeneratorAdapter =>
>>> addClasspathentries()
>>>
>>> Is there a possibility to override the createJETEmitter() method of
>>> AbstractGeneratorAdapter class? Or is there any other solution for
>>> this?
>>>
>>> Can anyone help me resolve this issue?
>>> Thanks in advance
>>>
>>> Nalaka
>>>
>>>
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Can I add my own class path entries to JETEmitter project [message #593185 is a reply to message #55540] Mon, 02 October 2006 12:15 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33147
Registered: July 2009
Senior Member
Nalaka,

Probably you'll want to create a Generator with an empty registry (new
Generator(new DelegateRegistry()) and populate that registry with your
specialized GenModelGeneratorAdapterFactory.


Nalaka Gamage wrote:

>
> Hi Merks and All,
>
> I further researched into org.eclipse.uml2.codegen.ecore_1.2.1 code
> base and found that in the plugin.xml,following extension point
> entries available;
> <extension point="org.eclipse.emf.codegen.ecore.generatorAdapters">
> <adapterFactory
> modelPackage =
> "http://www.eclipse.org/uml2/1.1.0/GenModel"
> class=" org.eclipse.uml2.codegen.ecore.genmodel.generator.GenModelGe neratorAdapterFactory "/>
>
> <adapterFactory
> modelPackage =
> "http://www.eclipse.org/uml2/1.1.0/GenModel"
> class=" org.eclipse.uml2.codegen.ecore.genmodel.generator.UML2GenMod elGeneratorAdapterFactory "/>
>
> </extension>
>
> In my case, I am also calling generete method from within my own
> plugin. I feel I may follow same approach (correct me If I am wrong).
> Still I am not exactly sure which factory to be extended
> Should I use the exact same extension aproach as above or should there
> be a simpler extension approach.
> May I add the extension points in *my own plugin*, in that case do I
> have to overide the org.eclipse.emf.codegen.ecore.generator.Generator
> class as well?
> Unfortunately there is no direct factory class for
> GenBaseGeneratorAdapter (which I am now extending). Therefore, In my
> case also do I have to go through the GenModelGeneratorAdapterFactory
> class extension as uml2.codegen.ecore_1.2.1 does?
>
> Do you feel this extension approach is feasible?
> Please correct me if I am in a wrong path?
> Thanks in advance,
> Nalaka
>
> Nalaka Gamage wrote:
>
>> Hi Merks,
>> Thanks for the reply which is very useful information. I went through
>> the source code of org.eclipse.uml2.codegen.ecore_1.2.1 plugin to get
>> better understanding of your solution. Its clear creating a new class
>> extending GenBaseGeneratorAdapter and overiding the
>> addClasspathEntries should do the trick. However I am bit stuck to
>> identify how we are going to make sure that our extended class is
>> used instead of GenBaseGeneratorAdapter class. Do we have to create a
>> new adapter factory class as well? It will be great if you can
>> explain how we are going to integrate our extended class.
>
>
>> I can see that in uml2.codgen.ecore plugin, they have created their
>> own GenClassGeneratorAdapter class that extends
>> org.eclipse.emf.codegen.ecore.genmodel.generator.GenClassGen eratorAdapter
>> and in this class they have override addClasspathEntries as follows;
>
>
>> protected void addClasspathEntries(JETEmitter jetEmitter)
>> throws JETException {
>> super.addClasspathEntries(jetEmitter);
>> *UML2GenBaseGeneratorAdapter.addUML2ClasspathEntries(jetEmit ter);*
>> }
>
>
>> Is this the trick you are doing or this is related to some other
>> requirement? If so still how are we making sure that our version of
>> GenClassGeneratorAdapter class is used?
>
>
>> My requirement is simply to add new class path entry to the
>> JETEmitter project.
>> I highly appreciate your response.
>
>
>> Thanks
>> Nalaka
>
>
>
>> Ed Merks wrote:
>
>
>>> Nalaka,
>>
>
>>> You can override createJETEMitter and you can also make your
>>> extension use a different project by calling
>>> JETEmitter.setProjectName to something other than .JETEmitters. The
>>> UML project overrides just the addClasspathEntries method to add
>>> additional UML2-specific entries.
>>
>
>>> public class UML2GenBaseGeneratorAdapter
>>> extends GenBaseGeneratorAdapter {
>>
>
>>> protected static void addUML2ClasspathEntries(JETEmitter
>>> jetEmitter)
>>> throws JETException {
>>> jetEmitter.addVariable("UML2_CODEGEN_ECORE", //$NON-NLS-1$
>>> "org.eclipse.uml2.codegen.ecore"); //$NON-NLS-1$
>>> }
>>
>
>>> public UML2GenBaseGeneratorAdapter(
>>> GeneratorAdapterFactory generatorAdapterFactory) {
>>> super(generatorAdapterFactory);
>>> }
>>
>
>>> protected void *addClasspathEntries*(JETEmitter jetEmitter)
>>> throws JETException {
>>> super.addClasspathEntries(jetEmitter);
>>
>
>>> addUML2ClasspathEntries(jetEmitter);
>>> }
>>
>
>>> }
>>
>
>
>>> Nalaka Gamage wrote:
>>>
>>>> Hi All,
>>>> In my own plugin, I am calling generate method of
>>>> org.eclipse.emf.codegen.ecore.generator.Generator class (which is
>>>> new in codegen.ecore 2.2.1) to generate the code for my genModel.
>>>> Earlier I used to call generate method os the
>>>> org.eclipse.emf.codegen.ecore.genmodel.GenModel. However now its
>>>> depreciated.
>>>> Now the issue is since I am using customised jet templates to
>>>> generate codes I have to add a jar file available in my plugin to
>>>> the jetEmitter project's class path so that jetemitter project get
>>>> comiled correctly. Is it possible to add new classpath entries to
>>>> jetemitter project with new
>>>> org.eclipse.emf.codegen.ecore.generator.Generator class ?
>>>>
>>>> I tried creating the jetemitter project myself before calling the
>>>> generate method. However I found that my jetemitter project get
>>>> overridden by the jetemiiteer project created by calling generate
>>>> method. In fact I found that jet emitter project get created as
>>>> follows in the execution path; AbstractGeneratorAdapter=>
>>>> getJETEmitter() => createJETEmitter() genBaseGeneratorAdapter
>>>> => addClasspathentries()
>>>>
>>>> Is there a possibility to override the createJETEmitter() method of
>>>> AbstractGeneratorAdapter class? Or is there any other solution for
>>>> this?
>>>>
>>>> Can anyone help me resolve this issue?
>>>> Thanks in advance
>>>>
>>>> Nalaka
>>>>
>>>>
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Can I add my own class path entries to JETEmitter project [message #593203 is a reply to message #55567] Mon, 02 October 2006 13:11 Go to previous message
nalaka gamage is currently offline nalaka gamageFriend
Messages: 30
Registered: July 2009
Member
Hi Merks,

Thanks for the reply.

Earlier we were creating JETEmittersProject by calling our own method
createJETEmittersProject oursrselves before calling the generate method of
org.eclipse.emf.codegen.ecore.genmodel class.

public static void createJETEmittersProject(IProgressMonitor
progressMonitor ) throws Exception {

List classpathEntries = new ArrayList();

addVariable("EMF_CODEGEN", "org.eclipse.emf.codegen", classpathEntries);
addVariable("EMF_CODEGEN_ECORE", "org.eclipse.emf.codegen.ecore",
classpathEntries);
addVariable("EMF_COMMON", "org.eclipse.emf.common", classpathEntries);
addVariable("EMF_ECORE", "org.eclipse.emf.ecore", classpathEntries);
createProject(progressMonitor, ".JETEmitters", classpathEntries);
IWorkspace workspace = ResourcesPlugin.getWorkspace();
IProject project = workspace.getRoot().getProject(".JETEmitters");
XXXXUtil.addClasspathEntry(project, "XXXX_VARIABLE_NAME", "xxxxx.jar",
"com....pluginid.xxxx", progressMonitor); // This is our internal method
to add the additional class path entry
}


Then also we had subclass GenModelImpl class and override the
createJETEmitter method as follows;

public class XXXXGenModelImpl extends GenModelImpl {
/**
* Overrided parant class method
*/
protected JETEmitter createJETEmitter(String relativeTemplateURI)
{
ClassLoader classLoader =
XXXXOUrPlugin.getDefault().getClass().getClassLoader();
JETEmitter jetEmitter =
new JETEmitter(getTemplatePath(), relativeTemplateURI, classLoader)
{
public void initialize(IProgressMonitor progressMonitor) throws
JETException
{
addVariable("EMF_CODEGENYYYY", "org.eclipse.emf.codegen");
addVariable("EMF_CODEGEN_ECORE", "org.eclipse.emf.codegen.ecore");
addVariable("EMF_COMMON", "org.eclipse.emf.common");
addVariable("EMF_ECORE", "org.eclipse.emf.ecore");
super.initialize(progressMonitor);
}
};
return jetEmitter;
}
}


Note that here we are using the class loader obtained through our plugin
as well.

Then we had instantiated our extended gen model as follows;

GenModel genModel = new
XXXXGenModelImpl((GenModel)genModelResource.getContents().ge t(0),(ResourceImpl)genModelResource
);
...
...
genModel.generate(new SubProgressMonitor(progressMonitor, 1));

In this way the jetemitter project we had created by ourselves never got
overidden, but when we are calling generete method in newly intrdused
org.eclipse.emf.codegen.ecore.generator.Generator class our GETEmitter
project that have additional class path entries get override.

This is our original issue that we are looking for a new fix.

Thanks
Nalaka

Ed Merks wrote:

> Nalaka,

> I imagine you'll need to create a specialized factory that creates your
> specialized adapters for each of the adapters the factory currently
> creates. How were you previously solving this problem before we
> provided the adapters?


> Nalaka Gamage wrote:

>> Hi Merks,
>> Thanks for the reply which is very useful information. I went through
>> the source code of org.eclipse.uml2.codegen.ecore_1.2.1 plugin to get
>> better understanding of your solution. Its clear creating a new class
>> extending GenBaseGeneratorAdapter and overiding the
>> addClasspathEntries should do the trick. However I am bit stuck to
>> identify how we are going to make sure that our extended class is used
>> instead of GenBaseGeneratorAdapter class. Do we have to create a new
>> adapter factory class as well? It will be great if you can explain how
>> we are going to integrate our extended class.
>>
>> I can see that in uml2.codgen.ecore plugin, they have created their
>> own GenClassGeneratorAdapter class that extends
>> org.eclipse.emf.codegen.ecore.genmodel.generator.GenClassGen eratorAdapter
>> and in this class they have override addClasspathEntries as follows;
>>
>> protected void addClasspathEntries(JETEmitter jetEmitter)
>> throws JETException {
>> super.addClasspathEntries(jetEmitter);
>> *UML2GenBaseGeneratorAdapter.addUML2ClasspathEntries(jetEmit ter);*
>> }
>>
>> Is this the trick you are doing or this is related to some other
>> requirement? If so still how are we making sure that our version of
>> GenClassGeneratorAdapter class is used?
>>
>> My requirement is simply to add new class path entry to the JETEmitter
>> project.
>> I highly appreciate your response.
>>
>> Thanks
>> Nalaka
>>
>> Ed Merks wrote:
>>
>>> Nalaka,
>>
>>
>>> You can override createJETEMitter and you can also make your
>>> extension use a different project by calling
>>> JETEmitter.setProjectName to something other than .JETEmitters. The
>>> UML project overrides just the addClasspathEntries method to add
>>> additional UML2-specific entries.
>>
>>
>>> public class UML2GenBaseGeneratorAdapter
>>> extends GenBaseGeneratorAdapter {
>>
>>
>>> protected static void addUML2ClasspathEntries(JETEmitter
>>> jetEmitter)
>>> throws JETException {
>>> jetEmitter.addVariable("UML2_CODEGEN_ECORE", //$NON-NLS-1$
>>> "org.eclipse.uml2.codegen.ecore"); //$NON-NLS-1$
>>> }
>>
>>
>>> public UML2GenBaseGeneratorAdapter(
>>> GeneratorAdapterFactory generatorAdapterFactory) {
>>> super(generatorAdapterFactory);
>>> }
>>
>>
>>> protected void *addClasspathEntries*(JETEmitter jetEmitter)
>>> throws JETException {
>>> super.addClasspathEntries(jetEmitter);
>>
>>
>>> addUML2ClasspathEntries(jetEmitter);
>>> }
>>
>>
>>> }
>>
>>
>>
>>> Nalaka Gamage wrote:
>>>
>>>> Hi All,
>>>> In my own plugin, I am calling generate method of
>>>> org.eclipse.emf.codegen.ecore.generator.Generator class (which is
>>>> new in codegen.ecore 2.2.1) to generate the code for my genModel.
>>>> Earlier I used to call generate method os the
>>>> org.eclipse.emf.codegen.ecore.genmodel.GenModel. However now its
>>>> depreciated.
>>>> Now the issue is since I am using customised jet templates to
>>>> generate codes I have to add a jar file available in my plugin to
>>>> the jetEmitter project's class path so that jetemitter project get
>>>> comiled correctly. Is it possible to add new classpath entries to
>>>> jetemitter project with new
>>>> org.eclipse.emf.codegen.ecore.generator.Generator class ?
>>>>
>>>> I tried creating the jetemitter project myself before calling the
>>>> generate method. However I found that my jetemitter project get
>>>> overridden by the jetemiiteer project created by calling generate
>>>> method. In fact I found that jet emitter project get created as
>>>> follows in the execution path; AbstractGeneratorAdapter=>
>>>> getJETEmitter() => createJETEmitter() genBaseGeneratorAdapter =>
>>>> addClasspathentries()
>>>>
>>>> Is there a possibility to override the createJETEmitter() method of
>>>> AbstractGeneratorAdapter class? Or is there any other solution for
>>>> this?
>>>>
>>>> Can anyone help me resolve this issue?
>>>> Thanks in advance
>>>>
>>>> Nalaka
>>>>
>>>>
>>
>>
Re: Can I add my own class path entries to JETEmitter project [message #593213 is a reply to message #55649] Mon, 02 October 2006 13:46 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33147
Registered: July 2009
Senior Member
Nalaka,

I see. So our changes haven't made life simpler for you. :-( We could
probably make life a lot simpler if we added a feature similar to "Model
Plug-in Variables" (which specifies additional plugin dependencies for
the generated model project) but for specifying additional plugins to be
added to the project for compiling the dynamic templates, e.g.,
MY_UTILITIES=org.example.my.utilities would specify the variable name
and the plugin ID. If that seems useful, please open a feature request
for it. This is somewhat related to
https://bugs.eclipse.org/bugs/show_bug.cgi?id=147318 where the desire is
to be able to point to a project where the templates have already been
compiled by virtue of that project having a JET Nature.


Nalaka Gamage wrote:

> Hi Merks,
>
> Thanks for the reply.
>
> Earlier we were creating JETEmittersProject by calling our own method
> createJETEmittersProject oursrselves before calling the generate
> method of org.eclipse.emf.codegen.ecore.genmodel class.
>
> public static void createJETEmittersProject(IProgressMonitor
> progressMonitor ) throws Exception {
> List classpathEntries = new ArrayList();
> addVariable("EMF_CODEGEN", "org.eclipse.emf.codegen",
> classpathEntries);
> addVariable("EMF_CODEGEN_ECORE", "org.eclipse.emf.codegen.ecore",
> classpathEntries);
> addVariable("EMF_COMMON", "org.eclipse.emf.common", classpathEntries);
> addVariable("EMF_ECORE", "org.eclipse.emf.ecore", classpathEntries);
> createProject(progressMonitor, ".JETEmitters", classpathEntries);
> IWorkspace workspace = ResourcesPlugin.getWorkspace();
> IProject project = workspace.getRoot().getProject(".JETEmitters");
> XXXXUtil.addClasspathEntry(project, "XXXX_VARIABLE_NAME", "xxxxx.jar",
> "com....pluginid.xxxx", progressMonitor); // This is our internal
> method to add the additional class path entry
> }
>
>
> Then also we had subclass GenModelImpl class and override the
> createJETEmitter method as follows;
>
> public class XXXXGenModelImpl extends GenModelImpl {
> /**
> * Overrided parant class method
> */
> protected JETEmitter createJETEmitter(String relativeTemplateURI)
> {
> ClassLoader classLoader =
> XXXXOUrPlugin.getDefault().getClass().getClassLoader();
> JETEmitter jetEmitter = new JETEmitter(getTemplatePath(),
> relativeTemplateURI, classLoader)
> {
> public void initialize(IProgressMonitor progressMonitor) throws
> JETException
> {
> addVariable("EMF_CODEGENYYYY", "org.eclipse.emf.codegen");
> addVariable("EMF_CODEGEN_ECORE", "org.eclipse.emf.codegen.ecore");
> addVariable("EMF_COMMON", "org.eclipse.emf.common");
> addVariable("EMF_ECORE", "org.eclipse.emf.ecore");
> super.initialize(progressMonitor);
> }
> };
> return jetEmitter;
> }
> }
>
>
> Note that here we are using the class loader obtained through our
> plugin as well.
>
> Then we had instantiated our extended gen model as follows;
>
> GenModel genModel = new
> XXXXGenModelImpl((GenModel)genModelResource.getContents().ge t(0),(ResourceImpl)genModelResource
> );
> ..
> ..
> genModel.generate(new SubProgressMonitor(progressMonitor, 1));
>
> In this way the jetemitter project we had created by ourselves never
> got overidden, but when we are calling generete method in newly
> intrdused org.eclipse.emf.codegen.ecore.generator.Generator class our
> GETEmitter project that have additional class path entries get override.
>
> This is our original issue that we are looking for a new fix.
>
> Thanks
> Nalaka
>
> Ed Merks wrote:
>
>> Nalaka,
>
>
>> I imagine you'll need to create a specialized factory that creates
>> your specialized adapters for each of the adapters the factory
>> currently creates. How were you previously solving this problem
>> before we provided the adapters?
>
>
>
>> Nalaka Gamage wrote:
>
>
>>> Hi Merks,
>>> Thanks for the reply which is very useful information. I went
>>> through the source code of org.eclipse.uml2.codegen.ecore_1.2.1
>>> plugin to get better understanding of your solution. Its clear
>>> creating a new class extending GenBaseGeneratorAdapter and overiding
>>> the addClasspathEntries should do the trick. However I am bit stuck
>>> to identify how we are going to make sure that our extended class is
>>> used instead of GenBaseGeneratorAdapter class. Do we have to create
>>> a new adapter factory class as well? It will be great if you can
>>> explain how we are going to integrate our extended class.
>>>
>>> I can see that in uml2.codgen.ecore plugin, they have created their
>>> own GenClassGeneratorAdapter class that extends
>>> org.eclipse.emf.codegen.ecore.genmodel.generator.GenClassGen eratorAdapter
>>> and in this class they have override addClasspathEntries as follows;
>>>
>>> protected void addClasspathEntries(JETEmitter jetEmitter)
>>> throws JETException {
>>> super.addClasspathEntries(jetEmitter);
>>> *UML2GenBaseGeneratorAdapter.addUML2ClasspathEntries(jetEmit ter);*
>>> }
>>>
>>> Is this the trick you are doing or this is related to some other
>>> requirement? If so still how are we making sure that our version of
>>> GenClassGeneratorAdapter class is used?
>>>
>>> My requirement is simply to add new class path entry to the
>>> JETEmitter project.
>>> I highly appreciate your response.
>>>
>>> Thanks
>>> Nalaka
>>>
>>> Ed Merks wrote:
>>>
>>>> Nalaka,
>>>
>>>
>>>
>>>> You can override createJETEMitter and you can also make your
>>>> extension use a different project by calling
>>>> JETEmitter.setProjectName to something other than .JETEmitters.
>>>> The UML project overrides just the addClasspathEntries method to
>>>> add additional UML2-specific entries.
>>>
>>>
>>>
>>>> public class UML2GenBaseGeneratorAdapter
>>>> extends GenBaseGeneratorAdapter {
>>>
>>>
>>>
>>>> protected static void addUML2ClasspathEntries(JETEmitter
>>>> jetEmitter)
>>>> throws JETException {
>>>> jetEmitter.addVariable("UML2_CODEGEN_ECORE", //$NON-NLS-1$
>>>> "org.eclipse.uml2.codegen.ecore"); //$NON-NLS-1$
>>>> }
>>>
>>>
>>>
>>>> public UML2GenBaseGeneratorAdapter(
>>>> GeneratorAdapterFactory generatorAdapterFactory) {
>>>> super(generatorAdapterFactory);
>>>> }
>>>
>>>
>>>
>>>> protected void *addClasspathEntries*(JETEmitter jetEmitter)
>>>> throws JETException {
>>>> super.addClasspathEntries(jetEmitter);
>>>
>>>
>>>
>>>> addUML2ClasspathEntries(jetEmitter);
>>>> }
>>>
>>>
>>>
>>>> }
>>>
>>>
>>>
>>>
>>>> Nalaka Gamage wrote:
>>>>
>>>>> Hi All,
>>>>> In my own plugin, I am calling generate method of
>>>>> org.eclipse.emf.codegen.ecore.generator.Generator class (which is
>>>>> new in codegen.ecore 2.2.1) to generate the code for my genModel.
>>>>> Earlier I used to call generate method os the
>>>>> org.eclipse.emf.codegen.ecore.genmodel.GenModel. However now its
>>>>> depreciated.
>>>>> Now the issue is since I am using customised jet templates to
>>>>> generate codes I have to add a jar file available in my plugin to
>>>>> the jetEmitter project's class path so that jetemitter project get
>>>>> comiled correctly. Is it possible to add new classpath entries to
>>>>> jetemitter project with new
>>>>> org.eclipse.emf.codegen.ecore.generator.Generator class ?
>>>>>
>>>>> I tried creating the jetemitter project myself before calling the
>>>>> generate method. However I found that my jetemitter project get
>>>>> overridden by the jetemiiteer project created by calling generate
>>>>> method. In fact I found that jet emitter project get created as
>>>>> follows in the execution path; AbstractGeneratorAdapter=>
>>>>> getJETEmitter() => createJETEmitter() genBaseGeneratorAdapter
>>>>> => addClasspathentries()
>>>>>
>>>>> Is there a possibility to override the createJETEmitter() method
>>>>> of AbstractGeneratorAdapter class? Or is there any other solution
>>>>> for this?
>>>>>
>>>>> Can anyone help me resolve this issue?
>>>>> Thanks in advance
>>>>>
>>>>> Nalaka
>>>>>
>>>>>
>>>
>>>
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Can I add my own class path entries to JETEmitter project [message #593440 is a reply to message #55676] Tue, 03 October 2006 14:24 Go to previous message
Eclipse UserFriend
Originally posted by: giacomin.vettatech.com

Nalaka,

Please let me know when you create the feature request because I'm also
interested in.

Thanks,
--
Ricardo Giacomin


"Ed Merks" <merks@ca.ibm.com> wrote in message
news:efr57l$c17$1@utils.eclipse.org...
> Nalaka,
>
> I see. So our changes haven't made life simpler for you. :-( We could
> probably make life a lot simpler if we added a feature similar to "Model
> Plug-in Variables" (which specifies additional plugin dependencies for the
> generated model project) but for specifying additional plugins to be added
> to the project for compiling the dynamic templates, e.g.,
> MY_UTILITIES=org.example.my.utilities would specify the variable name and
> the plugin ID. If that seems useful, please open a feature request for
> it. This is somewhat related to
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=147318 where the desire is
> to be able to point to a project where the templates have already been
> compiled by virtue of that project having a JET Nature.
>
>
> Nalaka Gamage wrote:
>
>> Hi Merks,
>>
>> Thanks for the reply.
>>
>> Earlier we were creating JETEmittersProject by calling our own method
>> createJETEmittersProject oursrselves before calling the generate method
>> of org.eclipse.emf.codegen.ecore.genmodel class.
>>
>> public static void createJETEmittersProject(IProgressMonitor
>> progressMonitor ) throws Exception {
>> List classpathEntries = new ArrayList();
>> addVariable("EMF_CODEGEN", "org.eclipse.emf.codegen",
>> classpathEntries);
>> addVariable("EMF_CODEGEN_ECORE", "org.eclipse.emf.codegen.ecore",
>> classpathEntries);
>> addVariable("EMF_COMMON", "org.eclipse.emf.common", classpathEntries);
>> addVariable("EMF_ECORE", "org.eclipse.emf.ecore", classpathEntries);
>> createProject(progressMonitor, ".JETEmitters", classpathEntries);
>> IWorkspace workspace = ResourcesPlugin.getWorkspace();
>> IProject project = workspace.getRoot().getProject(".JETEmitters");
>> XXXXUtil.addClasspathEntry(project, "XXXX_VARIABLE_NAME", "xxxxx.jar",
>> "com....pluginid.xxxx", progressMonitor); // This is our internal method
>> to add the additional class path entry
>> }
>>
>>
>> Then also we had subclass GenModelImpl class and override the
>> createJETEmitter method as follows;
>>
>> public class XXXXGenModelImpl extends GenModelImpl {
>> /**
>> * Overrided parant class method
>> */
>> protected JETEmitter createJETEmitter(String relativeTemplateURI)
>> {
>> ClassLoader classLoader =
>> XXXXOUrPlugin.getDefault().getClass().getClassLoader();
>> JETEmitter jetEmitter = new JETEmitter(getTemplatePath(),
>> relativeTemplateURI, classLoader)
>> {
>> public void initialize(IProgressMonitor progressMonitor) throws
>> JETException
>> {
>> addVariable("EMF_CODEGENYYYY", "org.eclipse.emf.codegen");
>> addVariable("EMF_CODEGEN_ECORE", "org.eclipse.emf.codegen.ecore");
>> addVariable("EMF_COMMON", "org.eclipse.emf.common");
>> addVariable("EMF_ECORE", "org.eclipse.emf.ecore");
>> super.initialize(progressMonitor);
>> }
>> };
>> return jetEmitter;
>> }
>> }
>>
>>
>> Note that here we are using the class loader obtained through our plugin
>> as well.
>>
>> Then we had instantiated our extended gen model as follows;
>>
>> GenModel genModel = new
>> XXXXGenModelImpl((GenModel)genModelResource.getContents().ge t(0),(ResourceImpl)genModelResource
>> );
>> ..
>> ..
>> genModel.generate(new SubProgressMonitor(progressMonitor, 1));
>>
>> In this way the jetemitter project we had created by ourselves never got
>> overidden, but when we are calling generete method in newly intrdused
>> org.eclipse.emf.codegen.ecore.generator.Generator class our GETEmitter
>> project that have additional class path entries get override.
>>
>> This is our original issue that we are looking for a new fix.
>>
>> Thanks
>> Nalaka
>>
>> Ed Merks wrote:
>>
>>> Nalaka,
>>
>>
>>> I imagine you'll need to create a specialized factory that creates your
>>> specialized adapters for each of the adapters the factory currently
>>> creates. How were you previously solving this problem before we
>>> provided the adapters?
>>
>>
>>
>>> Nalaka Gamage wrote:
>>
>>
>>>> Hi Merks,
>>>> Thanks for the reply which is very useful information. I went through
>>>> the source code of org.eclipse.uml2.codegen.ecore_1.2.1 plugin to get
>>>> better understanding of your solution. Its clear creating a new class
>>>> extending GenBaseGeneratorAdapter and overiding the addClasspathEntries
>>>> should do the trick. However I am bit stuck to identify how we are
>>>> going to make sure that our extended class is used instead of
>>>> GenBaseGeneratorAdapter class. Do we have to create a new adapter
>>>> factory class as well? It will be great if you can explain how we are
>>>> going to integrate our extended class.
>>>>
>>>> I can see that in uml2.codgen.ecore plugin, they have created their own
>>>> GenClassGeneratorAdapter class that extends
>>>> org.eclipse.emf.codegen.ecore.genmodel.generator.GenClassGen eratorAdapter
>>>> and in this class they have override addClasspathEntries as follows;
>>>>
>>>> protected void addClasspathEntries(JETEmitter jetEmitter)
>>>> throws JETException {
>>>> super.addClasspathEntries(jetEmitter);
>>>> *UML2GenBaseGeneratorAdapter.addUML2ClasspathEntries(jetEmit ter);*
>>>> }
>>>>
>>>> Is this the trick you are doing or this is related to some other
>>>> requirement? If so still how are we making sure that our version of
>>>> GenClassGeneratorAdapter class is used?
>>>>
>>>> My requirement is simply to add new class path entry to the JETEmitter
>>>> project.
>>>> I highly appreciate your response.
>>>>
>>>> Thanks
>>>> Nalaka
>>>>
>>>> Ed Merks wrote:
>>>>
>>>>> Nalaka,
>>>>
>>>>
>>>>
>>>>> You can override createJETEMitter and you can also make your extension
>>>>> use a different project by calling JETEmitter.setProjectName to
>>>>> something other than .JETEmitters. The UML project overrides just the
>>>>> addClasspathEntries method to add additional UML2-specific entries.
>>>>
>>>>
>>>>
>>>>> public class UML2GenBaseGeneratorAdapter
>>>>> extends GenBaseGeneratorAdapter {
>>>>
>>>>
>>>>
>>>>> protected static void addUML2ClasspathEntries(JETEmitter
>>>>> jetEmitter)
>>>>> throws JETException {
>>>>> jetEmitter.addVariable("UML2_CODEGEN_ECORE", //$NON-NLS-1$
>>>>> "org.eclipse.uml2.codegen.ecore"); //$NON-NLS-1$
>>>>> }
>>>>
>>>>
>>>>
>>>>> public UML2GenBaseGeneratorAdapter(
>>>>> GeneratorAdapterFactory generatorAdapterFactory) {
>>>>> super(generatorAdapterFactory);
>>>>> }
>>>>
>>>>
>>>>
>>>>> protected void *addClasspathEntries*(JETEmitter jetEmitter)
>>>>> throws JETException {
>>>>> super.addClasspathEntries(jetEmitter);
>>>>
>>>>
>>>>
>>>>> addUML2ClasspathEntries(jetEmitter);
>>>>> }
>>>>
>>>>
>>>>
>>>>> }
>>>>
>>>>
>>>>
>>>>
>>>>> Nalaka Gamage wrote:
>>>>>
>>>>>> Hi All,
>>>>>> In my own plugin, I am calling generate method of
>>>>>> org.eclipse.emf.codegen.ecore.generator.Generator class (which is new
>>>>>> in codegen.ecore 2.2.1) to generate the code for my genModel. Earlier
>>>>>> I used to call generate method os the
>>>>>> org.eclipse.emf.codegen.ecore.genmodel.GenModel. However now its
>>>>>> depreciated.
>>>>>> Now the issue is since I am using customised jet templates to
>>>>>> generate codes I have to add a jar file available in my plugin to the
>>>>>> jetEmitter project's class path so that jetemitter project get
>>>>>> comiled correctly. Is it possible to add new classpath entries to
>>>>>> jetemitter project with new
>>>>>> org.eclipse.emf.codegen.ecore.generator.Generator class ?
>>>>>>
>>>>>> I tried creating the jetemitter project myself before calling the
>>>>>> generate method. However I found that my jetemitter project get
>>>>>> overridden by the jetemiiteer project created by calling generate
>>>>>> method. In fact I found that jet emitter project get created as
>>>>>> follows in the execution path; AbstractGeneratorAdapter=>
>>>>>> getJETEmitter() => createJETEmitter() genBaseGeneratorAdapter =>
>>>>>> addClasspathentries()
>>>>>>
>>>>>> Is there a possibility to override the createJETEmitter() method of
>>>>>> AbstractGeneratorAdapter class? Or is there any other solution for
>>>>>> this?
>>>>>>
>>>>>> Can anyone help me resolve this issue?
>>>>>> Thanks in advance
>>>>>>
>>>>>> Nalaka
>>>>>>
>>>>>>
>>>>
>>>>
>>
>>
Re: Can I add my own class path entries to JETEmitter project [message #593469 is a reply to message #56131] Tue, 03 October 2006 15:24 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33147
Registered: July 2009
Senior Member
Ricardo,

You're more than welcome to open it yourself. I think it would be very
useful, but if the community doesn't open a feature request, then that
tells me it's not very important...


Ricardo Giacomin wrote:
> Nalaka,
>
> Please let me know when you create the feature request because I'm also
> interested in.
>
> Thanks,
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Can I add my own class path entries to JETEmitter project [message #593525 is a reply to message #56179] Wed, 04 October 2006 04:20 Go to previous message
nalaka gamage is currently offline nalaka gamageFriend
Messages: 30
Registered: July 2009
Member
Hi All,
I have added a feature request for this.
Bug 159691
https://bugs.eclipse.org/bugs/show_bug.cgi?id=159691

Regards
Nalaka

Ed Merks wrote:

> Ricardo,

> You're more than welcome to open it yourself. I think it would be very
> useful, but if the community doesn't open a feature request, then that
> tells me it's not very important...


> Ricardo Giacomin wrote:
>> Nalaka,
>>
>> Please let me know when you create the feature request because I'm also
>> interested in.
>>
>> Thanks,
>>
Previous Topic:Unittests for java batch constraints
Next Topic:Running EMFT Transaction Standalone
Goto Forum:
  


Current Time: Mon May 13 03:17:21 GMT 2024

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

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

Back to the top