Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » Native java code Tools example
Native java code Tools example [message #989552] Thu, 06 December 2012 17:25 Go to next message
Robert Wilterdink is currently offline Robert WilterdinkFriend
Messages: 5
Registered: December 2012
Junior Member
Dear all,

I want to instantiate an EData Type (org.eclipse.draw2d.geometry.Rectangle) that is defined in my ecore model. This cannot be done directly, so I believe I'm required to use an AbstractTool with corresponding extension point?

Therefore, I'm trying to invoke the example given here: http://www.eclipse.org/epsilon/doc/articles/call-java-from-epsilon

However, the SampleTool is not found for some reason.

I couldn't find the mentioned .launch script, so here is the stacktrace from my plugin:

Type 'org.eclipse.epsilon.examples.tools.SampleTool' not found (/DEV/myplugin.xml.to.cspm/epsilon/transform.etl@13:28)
	at org.eclipse.epsilon.eol.types.EolNativeType.<init>(EolNativeType.java:37)
	at org.eclipse.epsilon.eol.execute.TypeExecutor.execute(TypeExecutor.java:75)
	at org.eclipse.epsilon.eol.execute.ExecutorFactory.executeAST(ExecutorFactory.java:226)
	at org.eclipse.epsilon.eol.execute.NewExecutor.execute(NewExecutor.java:26)
	at org.eclipse.epsilon.eol.execute.ExecutorFactory.executeAST(ExecutorFactory.java:226)
	at org.eclipse.epsilon.eol.execute.AssignExecutor.execute(AssignExecutor.java:48)
...


The used ETL script (line 13 onwards):
var sampleTool = new Native("org.eclipse.epsilon.examples.tools.SampleTool");
sampleTool.name = "George";
sampleTool.sayHello().println();


My eclipse version is Indigo SR2 + Epsilon 1.0.0.

Best regards,
Robert
Re: Native java code Tools example [message #989610 is a reply to message #989552] Thu, 06 December 2012 22:57 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2163
Registered: July 2009
Location: York, UK
Senior Member

Hi Robert,

This article provides an example that demonstrates how to create a new Java tool; SampleTool is not a real tool included in the Epsilon distribution. As such, to use it you'll need to create it first by going through the steps of the article, launch a new Eclipse instance and use it from there.

Cheers,
Dimitris
Re: Native java code Tools example [message #989679 is a reply to message #989610] Fri, 07 December 2012 09:50 Go to previous messageGo to next message
Robert Wilterdink is currently offline Robert WilterdinkFriend
Messages: 5
Registered: December 2012
Junior Member
Hi Dimitris,

Let me clearify this. I downloaded the example, imported the plugin project in Eclipse & ran a new Eclipse instance (from the first Eclipse instance). The plugin is 'found', since I checked this in the installation details (Help -> About Eclipse).
However, the SampleTool is not found in the script.

Best regards,
Robert

[Updated on: Fri, 07 December 2012 09:50]

Report message to a moderator

Re: Native java code Tools example [message #989717 is a reply to message #989679] Fri, 07 December 2012 12:23 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2163
Registered: July 2009
Location: York, UK
Senior Member

Hi Robert,

This seems to be working fine for me. Could you perhaps check if you can instantiate any of the other tools (see Window->Show view...->Tools for a complete list of available tools)?

Cheers,
Dimitris
Re: Native java code Tools example [message #989724 is a reply to message #989717] Fri, 07 December 2012 12:51 Go to previous messageGo to next message
Robert Wilterdink is currently offline Robert WilterdinkFriend
Messages: 5
Registered: December 2012
Junior Member
Hmm, this is strange. The SampleTool and others (like JavaTool, MathTool, etc) are shown in this view.
However, the example ETL script (still) doesn't work for me.
Re: Native java code Tools example [message #989729 is a reply to message #989724] Fri, 07 December 2012 13:03 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2163
Registered: July 2009
Location: York, UK
Senior Member

Are you launching the .eol script through a launch configuration or through Java code?

Cheers,
Dimitris
Re: Native java code Tools example [message #989734 is a reply to message #989729] Fri, 07 December 2012 13:16 Go to previous messageGo to next message
Robert Wilterdink is currently offline Robert WilterdinkFriend
Messages: 5
Registered: December 2012
Junior Member
I'm running it from Java code, to be specific with an EtlModule.

Note, for the rest, I can succesfully transform models using this ETL/java code.
Re: Native java code Tools example [message #989739 is a reply to message #989734] Fri, 07 December 2012 13:23 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2163
Registered: July 2009
Location: York, UK
Senior Member

Have you perhaps added the following line to your Java setup as advised in the article?

context.getNativeTypeDelegates().add(new ExtensionPointToolNativeTypeDelegate());

Cheers,
Dimitris
Re: Native java code Tools example [message #990031 is a reply to message #989739] Mon, 10 December 2012 15:15 Go to previous message
Robert Wilterdink is currently offline Robert WilterdinkFriend
Messages: 5
Registered: December 2012
Junior Member
Thank you very much. This was indeed missing and all works fine now.

Best regards,
Robert
Previous Topic:[EGL] Create a folder
Next Topic:Epsilon flock
Goto Forum:
  


Current Time: Fri Apr 19 22:03:14 GMT 2024

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

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

Back to the top