Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » [EuGENia | EGL][newbie] Standalone applications
[EuGENia | EGL][newbie] Standalone applications [message #481239] Thu, 20 August 2009 08:45 Go to next message
Orcun Dayibas is currently offline Orcun DayibasFriend
Messages: 8
Registered: July 2009
Junior Member
Hi all,

I've implemented a GMF editor using EuGENia. Besides this editor, I've
also defined an EGL transformation. In this point, what I want to do is to
merge these two artifacts into one standalone application. I mean; is it
possible to add a button (in the GMF editor) that triggers to the EGL
transformation? I also wonder how to bundle EuGENia-generated GMF editor
as an standalone eclipse product (RCP application)?
Re: [EuGENia | EGL][newbie] Standalone applications [message #481252 is a reply to message #481239] Thu, 20 August 2009 09:03 Go to previous messageGo to next message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi Orcun,

Please see comments below

Orcun wrote:
> Hi all,
>
> I've implemented a GMF editor using EuGENia. Besides this editor, I've
> also defined an EGL transformation. In this point, what I want to do is
> to merge these two artifacts into one standalone application. I mean; is
> it possible to add a button (in the GMF editor) that triggers to the EGL
> transformation?

Yes. An example of using EGL in a standalone mode is available in the
/examples/org.eclipse.epsilon.examples.standalone project in the SVN.

I also wonder how to bundle EuGENia-generated GMF editor
> as an standalone eclipse product (RCP application)?
>
To generate an RCP-compatible GMF editor, you need to select the
"Generate RCP Application" checkbox in the gmfmap->gmfgen GMF wizard.

Cheers,
Dimitris
Re: [EuGENia | EGL][newbie] Standalone applications [message #539143 is a reply to message #481252] Wed, 09 June 2010 18:35 Go to previous messageGo to next message
Endre Balogh is currently offline Endre BaloghFriend
Messages: 38
Registered: May 2010
Member
Hi Dimitris,

I am also currently trying to put a button in my diagram editor that would activate code generation. I have the following problem:
The standalone example does show how to run a simple EGLtemplate, but if I include other stuff, it dies.
e.g for the line
[% TemplateFactory.setOutputRoot('gen/'); %]
it gives
Exception in thread "main" Method 'setOutputRoot' not found

Also, this example does not seem too conclusive; the most I can imagine doing with it is creating a wizard using EWL for the context of the model itself, and use it to invoke a java class defined as a tool as in
http://www.eclipse.org/gmt/epsilon/examples/index.php?exampl e=org.eclipse.epsilon.examples.tools
which would contain the code for calling EGL. But this seems like a terrible workaround.

Is there any way to bind EGLdirectly to the metamodel, like with EVL and EWL ?

Cheers,
Endre
Re: [EuGENia | EGL][newbie] Standalone applications [message #539159 is a reply to message #539143] Wed, 09 June 2010 19:28 Go to previous messageGo to next message
Louis Rose is currently offline Louis RoseFriend
Messages: 440
Registered: July 2009
Location: York, United Kingdom
Senior Member
Hi Endre,

EGL includes two ways of processing templates: EglTemplateFactory loads and executes templates. EglFileGeneratingTemplateFactory loads, executes and produces files from templates.

The error you're encountering is because the EGL standalone example uses EglTemplateFactory which does not produce files and hence does not define the setOutputRoot method. I think a solution for you would be to use EglFileGeneratingTemplateFactory instread. More specifically, change this:

@Override
public IEolExecutableModule createModule() {
	return new EglTemplateFactoryModuleAdapter(new EglTemplateFactory());
}


to this:

@Override
public IEolExecutableModule createModule() {
	return new EglTemplateFactoryModuleAdapter(new EglFileGeneratingTemplateFactory());
}


I think that should fix the problem you're encountering, but if not, do let us know.

Cheers,
Louis.
Re: [EuGENia | EGL][newbie] Standalone applications [message #539198 is a reply to message #539159] Wed, 09 June 2010 22:33 Go to previous messageGo to next message
Endre Balogh is currently offline Endre BaloghFriend
Messages: 38
Registered: May 2010
Member
Hi Louis,

Changing EglTemplateFactory to EglFileGeneratingTemplateFactory did solve the problem. I will now try to implement my wizard-based approach.

Cheers,
Endre

L.E. Sorry for asking again, but I have no idea whatsoever how to do this... I invoke the standalone EGL example from the wizard, that's done... how could I pass the currently edited diagram file (in the spawned Eclipse instance), the metamodel file and the EGL code file (in the original eclipse instance) as parameters to the tool? java.io.File objects point to the Eclipse installation folder from the tool's java code as well (not just from EOL, which I mentioned earlier Smile )

Could the model and metamodel objects be passed directly (from memory or something), without using their files? If yes, what about the EGL code?

If this could be made to work, it would make a nice addition to your Examples Smile

The tool code is this so far:

public class CodeGenerator {
	
	public void generateCodeFromModel() throws Exception {
		new EglStandaloneExample().execute();
	}
}


I fiddled a bit with the EglStandaloneExample code trying to figure out the file handling issue, but no luck for now.

[Updated on: Wed, 09 June 2010 23:12]

Report message to a moderator

Re: [EuGENia | EGL][newbie] Standalone applications [message #539265 is a reply to message #539198] Thu, 10 June 2010 08:40 Go to previous messageGo to next message
Louis Rose is currently offline Louis RoseFriend
Messages: 440
Registered: July 2009
Location: York, United Kingdom
Senior Member
Hi Endre,

Epsilon provides InMemoryEmfModel for accessing EMF models that have not yet been saved to disk. I think this is a good fit for your case. I think there are 3 pieces to the solution:

1) Retrieve the EMF resource from your GMF diagram:

I'm not sure how best to do this (it might be best to ask on the GMF forums). One (probably inelegant) way to do this: call resolveSemanticElement on one of the edit parts generated by GMF and then call eResource on the returned EObject:

final Resource resource = yourEditPart.resolveSemanticElement().eResource;


2) Prepare an EglContext containing the resource wrapped in an InMemoryEmfModel:

final InMemoryEmfModel model = new InMemoryEmfModel("Model", resource, ThePackageOfYourMetamodel.eINSTANCE);
// e.g. FlowchartsPackage.eINSTANCE

final IEglContext context = new EglContext();
context.getModelRepository().addModel(model);



3) Execute the EglTemplate on the context containing the InMemoryEmfModel:

final EglFileGeneratingTemplateFactory factory = new EglFileGeneratingTemplateFactory(context);

final EglFileGeneratingTemplate template = factory.load(aUriOrFileToYourEglTemplate);

template.process();

// or use template.generate(...) if you want to 
// store the results of the main template to disk


I don't think I would use EglStandaloneExample because you need to populate the context. I think the above should work, but do let us know if you have any problems.

Cheers,
Louis.
Re: [EuGENia | EGL][newbie] Standalone applications [message #539482 is a reply to message #539265] Thu, 10 June 2010 22:06 Go to previous messageGo to next message
Endre Balogh is currently offline Endre BaloghFriend
Messages: 38
Registered: May 2010
Member
Hi Louis,

I've posted the question regarding retrieval of the EMF resource from the diagram in the GMF forums, and I am currently awaiting an answer. Until they give me an optimal way, could you please be more specific regarding your approach? I don't know how to retrieve a specific EditPart to invoke resolveSemanticElement() on it.

Also, you might have overlooked something in the rest of the code you provided. Contexts are created from TemplateFactories, not vice versa, i.e.
IEglContext context = new EglContext();

is undefined, while
IEglContext context = new EglContext(templateFactory);

exists.
This line
File templateFile = new File("...");
final EglFileGeneratingTemplate template = templateFactory.load(templateFile);

also gives the following compilation error: type mismatch: cannot convert from EglTemplate to EglFileGeneratingTemplate

Thanks for looking into this!
Cheers,
Endre
Re: [EuGENia | EGL][newbie] Standalone applications [message #539556 is a reply to message #539482] Fri, 11 June 2010 09:49 Go to previous messageGo to next message
Louis Rose is currently offline Louis RoseFriend
Messages: 440
Registered: July 2009
Location: York, United Kingdom
Senior Member
Hi Endre,

Endre Balogh wrote on Thu, 10 June 2010 18:06
I've posted the question regarding retrieval of the EMF resource from the diagram in the GMF forums, and I am currently awaiting an answer. Until they give me an optimal way, could you please be more specific regarding your approach? I don't know how to retrieve a specific EditPart to invoke resolveSemanticElement() on it.


Great - please do relay any useful information to us. I'd definitely be interested in the solution.

In the past, I've executed a transformation on the resource held in a GMF editor when an element of the model is changed. GMF calls the XX method of the EditPart generated for that model element's type. In the XX method, I've called resolveSemanticElement() to grab the model element being changed.

Specifically, here's an edit part I've edited in this way:
http://epsilonlabs.svn.sourceforge.net/viewvc/epsilonlabs/fp tc/trunk/plugins/org.eclipse.epsilon.fptc.system.diagram/src /org/eclipse/epsilon/fptc/system/diagram/edit/parts/BlockEdi tPart.java?revision=293&view=markup

The hand-written method is at the very bottom of the file.

Quote:
Also, you might have overlooked something in the rest of the code you provided. Contexts are created from TemplateFactories, not vice versa, i.e.
IEglContext context = new EglContext();

is undefined, while
IEglContext context = new EglContext(templateFactory);

exists.


You're right! Sorry about this - we're recently made some refactorings to EGL, and I forgot about this change. In which case, I would use the following code:

final EglFileGeneratingTemplateFactory factory = new EglFileGeneratingTemplateFactory();

factory.getContext().getModelRepository().addModel(model);


(That's pretty ugly - we should probably add an addModel method to the template factory in a future version of Epsilon).

Quote:
This line
File templateFile = new File("...");
final EglFileGeneratingTemplate template = templateFactory.load(templateFile);

also gives the following compilation error: type mismatch: cannot convert from EglTemplate to EglFileGeneratingTemplate


Whoops, sorry about that. Because you're using an EglFileGeneratingTemplateFactory, it's safe to cast the result of factory.load to an EglFileGeneratingTemplate.

Cheers,
Louis.
Re: [EuGENia | EGL][newbie] Standalone applications [message #539641 is a reply to message #539556] Fri, 11 June 2010 15:25 Go to previous messageGo to next message
Endre Balogh is currently offline Endre BaloghFriend
Messages: 38
Registered: May 2010
Member
Hi Louis,

On the GMF forums I received the following solution:
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
IDiagramWorkbenchPart diagramPart = (IDiagramWorkbenchPart)page.getActiveEditor();
MyEditPart editPart = (MyEditPart) diagramPart.getDiagramEditPart();

Here I applied your solution (I repeat it for the sake of completeness):
final Resource resource = editPart.resolveSemanticElement().eResource();
final InMemoryEmfModel model = new InMemoryEmfModel("Model", resource, MyPackage.eINSTANCE);
EglFileGeneratingTemplateFactory templateFactory = new EglFileGeneratingTemplateFactory();
templateFactory.getContext().getModelRepository().addModel(model);
File templateFile = new File(".../Generator.egl");
final EglFileGeneratingTemplate template = (EglFileGeneratingTemplate) templateFactory.load(templateFile);


I have hardcoded the location of the EGL template, which will suffice for now.
The only remaining task is to devise the correct path for the code generation. It looks as the only way to localize the resource is by using resource.getURI(), but this returns a path of the form
platform:/resource/projectName/diagramName.my_diagram

Of course, if I cut of the 'platform' prefix and pass this to the EGL template, it will just interpret it as a relative path and create the folders in its own directory.

I will further investigate on how to find the absolute path of the current workspace, since that would allow me to derive the path to the current project's 'src' folder, but if you know a quick solution, it would be more than welcome. Smile

Cheers,
Endre

L.E. The path to the current workspace is returned by ResourcesPlugin.getWorkspace().getRoot().getLocation();

[Updated on: Fri, 11 June 2010 15:29]

Report message to a moderator

Re: [EuGENia | EGL][newbie] Standalone applications [message #539651 is a reply to message #539641] Fri, 11 June 2010 16:22 Go to previous messageGo to next message
Louis Rose is currently offline Louis RoseFriend
Messages: 440
Registered: July 2009
Location: York, United Kingdom
Senior Member
Hi Endre,

Great! Glad that you've found a complete solution, and thanks so much for sharing it here.

By the way, did the following code work for your purposes?

ResourcesPlugin.getWorkspace().getRoot().getLocation()


If not, there's also a getRawLocation() method - I can never remember which is for absolute file system paths and which is for workspace or file system paths.

Cheers,
Louis.
Re: [EuGENia | EGL][newbie] Standalone applications [message #539653 is a reply to message #539651] Fri, 11 June 2010 16:38 Go to previous messageGo to next message
Endre Balogh is currently offline Endre BaloghFriend
Messages: 38
Registered: May 2010
Member
Hi Louis,

ResourcesPlugin.getWorkspace().getRoot().getLocation();


worked just fine. However, I encountered another issue, although I can't say whether it's GMF related or Epsilon specific. (I managed to solve it though.)
So the problem encountered: after successfully passing the path parameter to the template, I spawned a new Eclipse instance, created a diagram and generated the code. Everything went smoothly up to here, the code appeared nicely in the project's 'src' folder after a refresh. Then I wanted to open a Java file. The editor displayed a cannot find editor ID type message (the same that you see when you modify the metamodel, regenerate the editor and try to open an old diagram), and then the entire eclipse died with an out of memory error: perm gen. I read a bit about it, and it seems that some part of the application holds on for too many resources for too long.
The solution was to start both the original eclipse and the spawned instance with the -XX:MaxPermSize=256m JVM parameter, which gives more than enough perm gen space (don't know if both were actually necessary, but I did it just in case).
All this appeared quite strange to me, since nothing like this happened when the generation was an isolated project, with me simply copying the diagram file into it and running it on its own.
If you're interested in investigating the issue, I can send you my projects (which have grown quite a bit, but I think they are still manageable); I for one am content with the increased memory solution.

Cheers,
Endre
Re: [EuGENia | EGL][newbie] Standalone applications [message #539720 is a reply to message #539653] Sat, 12 June 2010 07:33 Go to previous message
Louis Rose is currently offline Louis RoseFriend
Messages: 440
Registered: July 2009
Location: York, United Kingdom
Senior Member
Hi Endre,

Great - I'm glad it's working!

Often I have to use an increased heap size for Eclipse too. I think the defaults selected are not very good and a lot of Eclipse users do this. Given that 256MB isn't too much memory these days, I don't think it's worth investigating much further.

Thanks for posting your experiences here - they'll be valuable to other Epsilon users.

Cheers,
Louis.
Re: [EuGENia | EGL][newbie] Standalone applications [message #574537 is a reply to message #481239] Thu, 20 August 2009 09:03 Go to previous message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi Orcun,

Please see comments below

Orcun wrote:
> Hi all,
>
> I've implemented a GMF editor using EuGENia. Besides this editor, I've
> also defined an EGL transformation. In this point, what I want to do is
> to merge these two artifacts into one standalone application. I mean; is
> it possible to add a button (in the GMF editor) that triggers to the EGL
> transformation?

Yes. An example of using EGL in a standalone mode is available in the
/examples/org.eclipse.epsilon.examples.standalone project in the SVN.

I also wonder how to bundle EuGENia-generated GMF editor
> as an standalone eclipse product (RCP application)?
>
To generate an RCP-compatible GMF editor, you need to select the
"Generate RCP Application" checkbox in the gmfmap->gmfgen GMF wizard.

Cheers,
Dimitris
Re: [EuGENia | EGL][newbie] Standalone applications [message #589899 is a reply to message #481252] Wed, 09 June 2010 18:35 Go to previous message
Endre Balogh is currently offline Endre BaloghFriend
Messages: 38
Registered: May 2010
Member
Hi Dimitris,

I am also currently trying to put a button in my diagram editor that would activate code generation. I have the following problem:
The standalone example does show how to run a simple EGLtemplate, but if I include other stuff, it dies.
e.g for the line
[% TemplateFactory.setOutputRoot('gen/'); %]
it gives
Exception in thread "main" Method 'setOutputRoot' not found

Also, this example does not seem too conclusive; the most I can imagine doing with it is creating a wizard using EWL for the context of the model itself, and use it to invoke a java class defined as a tool as in
http://www.eclipse.org/gmt/epsilon/examples/index.php?exampl e=org.eclipse.epsilon.examples.tools
which would contain the code for calling EGL. But this seems like a terrible workaround.

Is there any way to bind EGLdirectly to the metamodel, like with EVL and EWL ?

Cheers,
Endre
Re: [EuGENia | EGL][newbie] Standalone applications [message #589910 is a reply to message #539143] Wed, 09 June 2010 19:28 Go to previous message
Louis Rose is currently offline Louis RoseFriend
Messages: 440
Registered: July 2009
Location: York, United Kingdom
Senior Member
Hi Endre,

EGL includes two ways of processing templates: EglTemplateFactory loads and executes templates. EglFileGeneratingTemplateFactory loads, executes and produces files from templates.

The error you're encountering is because the EGL standalone example uses EglTemplateFactory which does not produce files and hence does not define the setOutputRoot method. I think a solution for you would be to use EglFileGeneratingTemplateFactory instread. More specifically, change this:

@Override
public IEolExecutableModule createModule() {
return new EglTemplateFactoryModuleAdapter(new EglTemplateFactory());
}

to this:

@Override
public IEolExecutableModule createModule() {
return new EglTemplateFactoryModuleAdapter(new EglFileGeneratingTemplateFactory());
}

I think that should fix the problem you're encountering, but if not, do let us know.

Cheers,
Louis.
Re: [EuGENia | EGL][newbie] Standalone applications [message #589927 is a reply to message #539159] Wed, 09 June 2010 22:33 Go to previous message
Endre Balogh is currently offline Endre BaloghFriend
Messages: 38
Registered: May 2010
Member
Hi Louis,

Changing EglTemplateFactory to EglFileGeneratingTemplateFactory did solve the problem. I will now try to implement my wizard-based approach.

Cheers,
Endre
Re: [EuGENia | EGL][newbie] Standalone applications [message #589934 is a reply to message #589927] Thu, 10 June 2010 08:40 Go to previous message
Louis Rose is currently offline Louis RoseFriend
Messages: 440
Registered: July 2009
Location: York, United Kingdom
Senior Member
Hi Endre,

Epsilon provides InMemoryEmfModel for accessing EMF models that have not yet been saved to disk. I think this is a good fit for your case. I think there are 3 pieces to the solution:

1) Retrieve the EMF resource from your GMF diagram:

I'm not sure how best to do this (it might be best to ask on the GMF forums). One (probably inelegant) way to do this: call resolveSemanticElement on one of the edit parts generated by GMF and then call eResource on the returned EObject:

final Resource resource = yourEditPart.resolveSemanticElement().eResource;

2) Prepare an EglContext containing the resource wrapped in an InMemoryEmfModel:

final InMemoryEmfModel model = new InMemoryEmfModel("Model", resource, ThePackageOfYourMetamodel.eINSTANCE);
// e.g. FlowchartsPackage.eINSTANCE

final IEglContext context = new EglContext();
context.getModelRepository().addModel(model);



3) Execute the EglTemplate on the context containing the InMemoryEmfModel:

final EglFileGeneratingTemplateFactory factory = new EglFileGeneratingTemplateFactory(context);

final EglFileGeneratingTemplate template = factory.load(aUriOrFileToYourEglTemplate);

template.process();

// or use template.generate(...) if you want to
// store the results of the main template to disk


I don't think I would use EglStandaloneExample because you need to populate the context. I think the above should work, but do let us know if you have any problems.

Cheers,
Louis.
Re: [EuGENia | EGL][newbie] Standalone applications [message #590006 is a reply to message #589934] Thu, 10 June 2010 22:06 Go to previous message
Endre Balogh is currently offline Endre BaloghFriend
Messages: 38
Registered: May 2010
Member
Hi Louis,

I've posted the question regarding retrieval of the EMF resource from the diagram in the GMF forums, and I am currently awaiting an answer. Until they give me an optimal way, could you please be more specific regarding your approach? I don't know how to retrieve a specific EditPart to invoke resolveSemanticElement() on it.

Also, you might have overlooked something in the rest of the code you provided. Contexts are created from TemplateFactories, not vice versa, i.e.
IEglContext context = new EglContext();
is undefined, while
IEglContext context = new EglContext(templateFactory);
exists.
This line
File templateFile = new File("...");
final EglFileGeneratingTemplate template = templateFactory.load(templateFile);
also gives the following compilation error: type mismatch: cannot convert from EglTemplate to EglFileGeneratingTemplate

Thanks for looking into this!
Cheers,
Endre
Re: [EuGENia | EGL][newbie] Standalone applications [message #590013 is a reply to message #590006] Fri, 11 June 2010 09:49 Go to previous message
Louis Rose is currently offline Louis RoseFriend
Messages: 440
Registered: July 2009
Location: York, United Kingdom
Senior Member
Hi Endre,

Endre Balogh wrote on Thu, 10 June 2010 18:06
> I've posted the question regarding retrieval of the EMF resource from the diagram in the GMF forums, and I am currently awaiting an answer. Until they give me an optimal way, could you please be more specific regarding your approach? I don't know how to retrieve a specific EditPart to invoke resolveSemanticElement() on it.


Great - please do relay any useful information to us. I'd definitely be interested in the solution.

In the past, I've executed a transformation on the resource held in a GMF editor when an element of the model is changed. GMF calls the XX method of the EditPart generated for that model element's type. In the XX method, I've called resolveSemanticElement() to grab the model element being changed.

Specifically, here's an edit part I've edited in this way:
http://epsilonlabs.svn.sourceforge.net/viewvc/epsilonlabs/fp tc/trunk/plugins/org.eclipse.epsilon.fptc.system.diagram/src /org/eclipse/epsilon/fptc/system/diagram/edit/parts/BlockEdi tPart.java?revision=293&view=markup

The hand-written method is at the very bottom of the file.

Quote:
> Also, you might have overlooked something in the rest of the code you provided. Contexts are created from TemplateFactories, not vice versa, i.e.
> IEglContext context = new EglContext();
> is undefined, while
> IEglContext context = new EglContext(templateFactory);
> exists.


You're right! Sorry about this - we're recently made some refactorings to EGL, and I forgot about this change. In which case, I would use the following code:

final EglFileGeneratingTemplateFactory factory = new EglFileGeneratingTemplateFactory();

factory.getContext().getModelRepository().addModel(model);

(That's pretty ugly - we should probably add an addModel method to the template factory in a future version of Epsilon).

Quote:
> This line
> File templateFile = new File("...");
> final EglFileGeneratingTemplate template = templateFactory.load(templateFile);
> also gives the following compilation error: type mismatch: cannot convert from EglTemplate to EglFileGeneratingTemplate


Whoops, sorry about that. Because you're using an EglFileGeneratingTemplateFactory, it's safe to cast the result of factory.load to an EglFileGeneratingTemplate.

Cheers,
Louis.
Re: [EuGENia | EGL][newbie] Standalone applications [message #590027 is a reply to message #539556] Fri, 11 June 2010 15:25 Go to previous message
Endre Balogh is currently offline Endre BaloghFriend
Messages: 38
Registered: May 2010
Member
Hi Louis,

On the GMF forums I received the following solution:

IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActi vePage();
IDiagramWorkbenchPart diagramPart = (IDiagramWorkbenchPart)page.getActiveEditor();
MyEditPart editPart = (MyEditPart) diagramPart.getDiagramEditPart();
Here I applied your solution (I repeat it for the sake of completeness):
final Resource resource = editPart.resolveSemanticElement().eResource();
final InMemoryEmfModel model = new InMemoryEmfModel("Model", resource, MyPackage.eINSTANCE);
EglFileGeneratingTemplateFactory templateFactory = new EglFileGeneratingTemplateFactory();
templateFactory.getContext().getModelRepository().addModel(m odel);
File templateFile = new File(".../Generator.egl");
final EglFileGeneratingTemplate template = (EglFileGeneratingTemplate) templateFactory.load(templateFile);

I have hardcoded the location of the EGL template, which will suffice for now.
The only remaining task is to devise the correct path for the code generation. It looks as the only way to localize the resource is by using resource.getURI(), but this returns a path of the form
platform:/resource/projectName/diagramName.my_diagram
Of course, if I cut of the 'platform' prefix and pass this to the EGL template, it will just interpret it as a relative path and create the folders in its own directory.

I will further investigate on how to find the absolute path of the current workspace, since that would allow me to derive the path to the current project's 'src' folder, but if you know a quick solution, it would be more than welcome. :)

Cheers,
Endre
Re: [EuGENia | EGL][newbie] Standalone applications [message #590035 is a reply to message #590027] Fri, 11 June 2010 16:22 Go to previous message
Louis Rose is currently offline Louis RoseFriend
Messages: 440
Registered: July 2009
Location: York, United Kingdom
Senior Member
Hi Endre,

Great! Glad that you've found a complete solution, and thanks so much for sharing it here.

By the way, did the following code work for your purposes?

ResourcesPlugin.getWorkspace().getRoot().getLocation()

If not, there's also a getRawLocation() method - I can never remember which is for absolute file system paths and which is for workspace or file system paths.

Cheers,
Louis.
Previous Topic:EWL wizard
Next Topic:Re: [EuGENia | EGL][newbie] Standalone applications
Goto Forum:
  


Current Time: Thu Apr 25 16:50:50 GMT 2024

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

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

Back to the top