Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Initializing ViewProviders programmatically ?
Initializing ViewProviders programmatically ? [message #485019] Thu, 10 September 2009 09:22 Go to next message
Michael Matzen is currently offline Michael MatzenFriend
Messages: 13
Registered: July 2009
Junior Member
Hi all,

i am currently modifying diagrams by executing transformations on their
model data during runtime, e.g adding some states.
The transformation itself is written in Xtend and is working quite well.

But i've got a problem when executing those transformations on a diagram
that has just been opened:
The diagram refuses to create diagram elements for the newly created
model elements.
When a new element is created from the user, e.g by dragging an element
from the toolbar, it's working fine.

I've tracked the problem up to this point but i can't figure out how to
fix it:

When opening a diagram the extension point 'ViewServiceProvider' is read
and creates a corresponding provider class and registers in the
ViewService. But the provider is not fully initialized here, in detail
the attribute 'provider' is null.
So every time i execute a transformation which results in a 'Create
View' command, the command cannot be executed because the 'canExecute()'
method returns false (because the provider is null).

So is there any way of initializing view providers ?
This needs to be very generic, because the only thing i now is that the
current diagram is a gmf DiagramEditor and that there is a
ViewServiceProvider somewhere.

Cheers,
Michael
Re: Initializing ViewProviders programmatically ? [message #485062 is a reply to message #485019] Thu, 10 September 2009 12:08 Go to previous messageGo to next message
Alex Shatalin is currently offline Alex ShatalinFriend
Messages: 141
Registered: July 2009
Senior Member
Hello Michael,

The problem is in a constraint specified for generated ViewProvider in plugin.xml
You have to remove this constraint (as a result ViewProvider will ba always
created, but you'll get rid of this problem for now).
In future we are going to correct provider constraints to fix this problem.

-----------------
Alex Shatalin
Re: Initializing ViewProviders programmatically ? [message #485066 is a reply to message #485062] Thu, 10 September 2009 13:05 Go to previous messageGo to next message
Michael Matzen is currently offline Michael MatzenFriend
Messages: 13
Registered: July 2009
Junior Member
Hi Alex,

ahh that explains why i couldn't fix it :)

After removing the semanticHints for the provider it does work for this
diagram editor, but i think i will wait for the bugzilla ticket to get
fixed.

Thanks,
Michael
Re: Initializing ViewProviders programmatically ? [message #501754 is a reply to message #485019] Thu, 03 December 2009 17:04 Go to previous message
Dénes Harmath is currently offline Dénes HarmathFriend
Messages: 157
Registered: July 2009
Senior Member
I ran into the same issue which caused that shortcuts couldn't be created, so I thank you for the solution!
Where's the bug? I couldn't find it, but would happily vote for it, since it caused lots of struggling...

[Updated on: Thu, 03 December 2009 17:06]

Report message to a moderator

Previous Topic:Changing Validation Icons
Next Topic:Background issue after upgrade
Goto Forum:
  


Current Time: Wed Apr 14 09:29:40 GMT 2021

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

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

Back to the top