Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Problems generating my gmf-editors with eclipse helios
Problems generating my gmf-editors with eclipse helios [message #558985] Wed, 15 September 2010 08:52 Go to next message
Markus Oley is currently offline Markus OleyFriend
Messages: 304
Registered: July 2009
Location: Germany
Senior Member
Hi @ all,

I want to generate my gmf-editor with helios and get the following errors:

The method getCurrentStep_3005SemanticChildren(View) is undefined for the type WorkflowDiagramUpdater

I copied the DiagramUpdater-template to my own templates and adapted it because I got an error "Can only iterate over an array or an instance of java.lang.Iterable".
So this is suspicous, too, I think.

Does anyone of you have a idea what I have to do, to get this running.
Perhaps you can give me a link to a tutorial how to migrate my editors from galileo to helios?

Thanks in advance

Best regards
Markus
Re: Problems generating my gmf-editors with eclipse helios [message #559005 is a reply to message #558985] Wed, 15 September 2010 09:57 Go to previous messageGo to next message
Gerd Kainz is currently offline Gerd KainzFriend
Messages: 23
Registered: May 2010
Junior Member
Hi Markus,

I also have this problems when using phantom nodes. See: http:// www.eclipse.org/forums/index.php?t=msg&th=174539&sta rt=0&S=69f0e047fed23b9e5107cebf416a5255

I always have to replace
for (EObject childElement : getPhantomNodesIterator(resource)) {

by
for (Iterator<EObject> iterator = getPhantomNodesIterator(resource); iterator.hasNext(); ) {
   EObject childElement = iterator.next();

in xxx.diagram.part.XXXDiagramUpdater.

For every top node without any connected links (links to phantom nodes are not counting) in the refeshSemantics method of xxx.diagram.edit.policies.XYZCanonicalEditPolicy there is a call to XXXDiagramUpdater.getXYZ_NNNSemanticChildren which is not defined there.

A workaround is to replace the loop in XXXDiagramUpdater after each code generation and uncomment the content of the refreshSemantics methods and mark the methods with @generated NOT.

Best regards,
Gerd

Re: Problems generating my gmf-editors with eclipse helios [message #559010 is a reply to message #559005] Wed, 15 September 2010 10:16 Go to previous messageGo to next message
Markus Oley is currently offline Markus OleyFriend
Messages: 304
Registered: July 2009
Location: Germany
Senior Member
Hi Gerd,

thank you for your quick answer..


The first problem (getPhantomNodesIterator(resource)) I fixed by establishing my own DiagramUpdater.xpt which I have rewritten to work_

for (java.util.Iterator semanticIterator = getPhantomNodesIterator(resource); semanticIterator.hasNext(); ) {
org.eclipse.emf.ecore.EObject childElement = (org.eclipse.emf.ecore.EObject) semanticIterator.next();
if (childElement == modelElement) {
continue;
}


So I don't have to edit it after every build.

but I tried to replace the DiagramCanonicalEditPolicy, this isn't used by gmf for this issue (added a comment, that wasn't generated).

Is it really this file to adapt? And if I want to adapt it, what exactly do I have to write
if not

List<WorkflowNodeDescriptor> childDescriptors = WorkflowDiagramUpdater
.getCurrentStep_3005SemanticChildren((View) getHost()
.getModel());


What impacts do this changes have? Is there anywhere a good tutorial on using editpolicies?

Thank you

Best regards
Markus
Re: Problems generating my gmf-editors with eclipse helios [message #559019 is a reply to message #559010] Wed, 15 September 2010 10:53 Go to previous messageGo to next message
Gerd Kainz is currently offline Gerd KainzFriend
Messages: 23
Registered: May 2010
Junior Member
Hi Markus,

I'm quite new to GMF so I can't answer your questions. I only know that refreshSemantics is currently not used and can be deleted as well, without any problems. I think this stuff is a first version of a new feature, which isn't complete yet.

Can you give me some information about where to find more information on the replacement of GMF templates?

Best regards,
Gerd
Re: Problems generating my gmf-editors with eclipse helios [message #559031 is a reply to message #559019] Wed, 15 September 2010 11:30 Go to previous messageGo to next message
Markus Oley is currently offline Markus OleyFriend
Messages: 304
Registered: July 2009
Location: Germany
Senior Member
Hi Gerd,

thank you for the hint, that this method isn't used at all.... so I try to deactivate ist...

overloading of templates is shown here:
http://www.bonitasoft.org/blog/eclipse/customize-your-gmf-ed itor-by-customizing-templates/

Didn't do it myself with this blog, I did trial and error Sad, but at first glance, it is quite good described...

Best regards
Markus
Re: Problems generating my gmf-editors with eclipse helios [message #661050 is a reply to message #558985] Tue, 22 March 2011 22:25 Go to previous messageGo to next message
Johannes Mey is currently offline Johannes MeyFriend
Messages: 1
Registered: March 2011
Junior Member
Hi,

thanks for the very helpful hints on this problem!

I stumbled over the non-existent getXYZSemanticChildren(View) and since I needed a solution without editing generated code I used template overloading. Because it took me some time to figure out a solution I wanted to share it here:

The DiagramUpdater already contains a method to switch between the existent getXYZSemanticChildren methods, so I added in DiagramUpdater.xpt:

«DEFINE getGenericSemanticChildrenMethodName FOR gmfgen::GenContainerBase»getSemanticChildren«ENDDEFINE»
«DEFINE getGenericSemanticChildrenMethodCall FOR gmfgen::GenContainerBase»«getDiagram().editorGen.diagramUpdater.getDiagramUpdaterQualifiedClassName()».«EXPAND getGenericSemanticChildrenMethodName»«ENDDEFINE»


and changed the relevant line in CanonicalUpdate.xpt to use it:

«EXPAND CodeStyle::G('java.util.List', diagramUpdater.getNodeDescriptorQualifiedClassName())» childDescriptors = «EXPAND xpt::diagram::updater::DiagramUpdater::getGenericSemanticChildrenMethodCall»((org.eclipse.gmf.runtime.notation.View) getHost().getModel());


With these changes, the generic method getSemanticChildren(View) is called, which returns an empty list if the specific method does not exist.

Best regards,
Johannes
Re: Problems generating my gmf-editors with eclipse helios [message #663381 is a reply to message #558985] Mon, 04 April 2011 19:56 Go to previous message
Aurélien Pupier is currently offline Aurélien PupierFriend
Messages: 637
Registered: July 2009
Location: Grenoble, FRANCE
Senior Member

Hi,

I don't understand the whole issue but as it seems to be a problem that occured to two people and that you have a patch perhaps you can submit a bug and provides the patch against GMF-Tooling.


BTW, Thanks for sharing the solution

Regards,


Aurélien Pupier - Red Hat
Senior Software Engineer in Fuse Tooling team
Previous Topic:GMF based Editor nested in Dialog?
Next Topic:Duplicated elements after Drag&Drop to compartment
Goto Forum:
  


Current Time: Fri Apr 19 11:07:05 GMT 2024

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

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

Back to the top