Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » Calling Java from Xpand
Calling Java from Xpand [message #504332] Fri, 18 December 2009 06:33 Go to next message
Eclipse UserFriend
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 06:42 Go to previous message
Eclipse UserFriend
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: Sun Jul 06 11:21:16 EDT 2025

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

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

Back to the top