Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » Invoking UMLUtil as Native Object fails
Invoking UMLUtil as Native Object fails [message #1765690] Tue, 13 June 2017 12:27 Go to next message
Luca Berardinelli is currently offline Luca BerardinelliFriend
Messages: 35
Registered: June 2010
Location: TU Wien
Member
Hi all,
I am trying to access the methods provided by UMLUtil during the executionn of a EGL file.

I now that java code can be invoked Native object as shown here

https://www.eclipse.org/epsilon/examples/index.php?example=org.eclipse.epsilon.examples.calljava


I copy pasted the code on this page within my EGL file and it works smoothly

var frame = new Native("javax.swing.JFrame");
frame.setBounds(100,100,200,200);
frame.title = "Opened from EOL";
frame.visible = true;

then I added the a new Native variable

var frame = new Native("javax.swing.JFrame");
var umlutil = new Native("org.eclipse.uml2.uml.util.UMLUtil");
frame.setBounds(100,100,200,200);
frame.title = "Opened from EOL";
frame.visible = true;

and EPSILON does not find the object.

My eclipse installation includes Papyrus and many other modeling tools so I suppose that the referenced object and library is included in my installation.

I need UMLUtil to invoke getBaseElement(). I know that I can do that by accessing base_<metaclass name> attribute of stereotype applications but I prefer to go through UMLUtil.

Thanks for any help.
Best,
Luca



Luca Berardinelli

[Updated on: Tue, 13 June 2017 12:38]

Report message to a moderator

Re: Invoking UMLUtil as Native Object fails [message #1765691 is a reply to message #1765690] Tue, 13 June 2017 12:49 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 1609
Registered: July 2009
Location: York, UK
Senior Member

Hi Luca,

You will need to declare UMLUtil as a "tool" using Epsilon's respective extension point as demonstrated in [1]. This is necessary due to the way Eclipse/OSGi manages classloaders (i.e. since the EOL engine plugin doesn't depend on the UML plugins, its classloader cannot access/load classes from the latter out of the box).

Cheers,
Dimitris

[1] https://www.eclipse.org/epsilon/doc/articles/call-java-from-epsilon/

[Updated on: Tue, 13 June 2017 14:37]

Report message to a moderator

Re: Invoking UMLUtil as Native Object fails [message #1772780 is a reply to message #1765691] Fri, 15 September 2017 08:16 Go to previous message
Luca Berardinelli is currently offline Luca BerardinelliFriend
Messages: 35
Registered: June 2010
Location: TU Wien
Member
Thanks a lot for your help. It solved my problems.

Cheers,
Luca


Luca Berardinelli
Previous Topic:passing arguments from Java to EOL
Next Topic:EWL in Papyrus (2017)
Goto Forum:
  


Current Time: Wed Nov 14 08:39:11 GMT 2018

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

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

Back to the top