Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » AbstractViewProvider.getCreationMethod getting the wrong method when creating a Diagram
AbstractViewProvider.getCreationMethod getting the wrong method when creating a Diagram [message #667235] Wed, 27 April 2011 14:54
Erik Englund is currently offline Erik EnglundFriend
Messages: 49
Registered: July 2009
This seems like a bug to me but here goes.

I have a View Factory class that extends the default Generated view provider class and implement ViewFactory. All works fine with this in terms of creating views and connections.

However, I then tried to override the creation of the root Diagram. So I added this same class to the getDiagramViewClass of my View Provider. That seems to work up until it calculates what method to call to create the Diagram. The method AbstractViewProvider.getCreationMethod first checks its cache of methods and if it fails it looks for the first method that matches the name of either "createView" OR "createDiagram". It doesn't even attempt to check if the arguments match.

The problem I'm running into is I have both a createView AND a createDiagram method in my ViewFactory, however, the View provider is incorrectly grabbing the createView method since that is the first one it encounters. Then when it goes to invoke the method I get a runtime exception because the arguments are invalid.

I have had to go the the extreme of creating another dummy class that only contains a createDiagram method to ensure that the correct method is called. This works but it still seems like something is wrong.

Previous Topic:[SOLVED] How to programmatically set the location of a label?
Next Topic:Shortcuts to read-only models
Goto Forum:

Current Time: Thu Mar 04 01:43:07 GMT 2021

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

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

Back to the top