Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Calling Java from Xpand
Calling Java from Xpand [message #504332] Fri, 18 December 2009 11:33 Go to next message
Marc Mising name is currently offline Marc Mising nameFriend
Messages: 193
Registered: July 2009
Location: Valencia, Spain
Senior Member
Hello!

I want to call a Java method placed in org.eclipse.gmf.codegen from Xpand templates. This Class is accessible because there exist an extension in the codegen plugin that allows it. I want to access to EMFUtils.

I found this entry in the news and Alex Shatalin replies with this, but I cannot get access to this Class. An error appears in the generation.

My Xpand template looks like that:
«IMPORT 'http://www.eclipse.org/gmf/2009/GenModel'»
«IMPORT 'http://www.eclipse.org/emf/2002/GenModel'»

«EXTENSION gmf::EMFUtils»

«AROUND getDiagramVisualID FOR gmfgen::GenDiagram-»
	«EXPAND xpt::Common::generatedMemberComment»
	public static void myFunction() {
		«getReferencingObjects(self)»
	}
«ENDAROUND»


And I get the following exception:
Exception (Cannot find operation (getReferencingObjects(GenContainerBase)) for the type (null):in aspects::xpt::diagram::updater::DiagramUpdater, line 26) while generating code
Cannot find operation (getReferencingObjects(GenContainerBase)) for the type (null):in aspects::xpt::diagram::updater::DiagramUpdater, line 26

What I'm doing wrong?

Thanks.
Marc

PD: Before I ask in M2T forum (link), but I think I should done here.
Re: Calling Java from Xpand [message #504335 is a reply to message #504332] Fri, 18 December 2009 11:42 Go to previous message
Marc Mising name is currently offline Marc Mising nameFriend
Messages: 193
Registered: July 2009
Location: Valencia, Spain
Senior Member
Bad boy!!!

I must to CAST the element to EObject!!!!

«getReferencingObjects(self.oclAsType(EObject))»

lol

Marc
Previous Topic:org.eclipse.ui.ide dependency
Next Topic:How to generate uml2 diagram within a gmf project programmatically ?
Goto Forum:
  


Current Time: Fri Apr 23 03:29:12 GMT 2021

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

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

Back to the top