Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Adding features dynamically
Adding features dynamically [message #1267239] Sat, 08 March 2014 18:05 Go to next message
Nickie woo is currently offline Nickie wooFriend
Messages: 21
Registered: February 2014
Junior Member
Hi

Is there a simple way to call the FeatureProvider to populate the toolbox/palette dynamically before starting up the diagram ?

Re: Adding features dynamically [message #1268487 is a reply to message #1267239] Mon, 10 March 2014 15:06 Go to previous messageGo to next message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1931
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Hi,

you can override getPalette in the Tool Behavior Provider. The default
implementation simply adds tools for all create features to the palette.

Michael
Re: Adding features dynamically [message #1270077 is a reply to message #1268487] Wed, 12 March 2014 13:15 Go to previous messageGo to next message
Nickie woo is currently offline Nickie wooFriend
Messages: 21
Registered: February 2014
Junior Member
Hi

But the problem is i have to pass a model to the createFeatureProvider to decide what to be included in the diagram toolbox is there any way to instantiate a custom DiagramtypeProvider for a given diagram and set it to the corresponding diagram or editor before starting it up ?
Re: Adding features dynamically [message #1270788 is a reply to message #1270077] Thu, 13 March 2014 13:48 Go to previous messageGo to next message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1931
Registered: July 2009
Location: Walldorf, Germany
Senior Member
You can pass a DiagramTypeProvider id in the DiagramEditorInput to open an
editor. Does that help in your case?

Michael
Re: Adding features dynamically [message #1271302 is a reply to message #1270788] Fri, 14 March 2014 19:39 Go to previous messageGo to next message
Nickie woo is currently offline Nickie wooFriend
Messages: 21
Registered: February 2014
Junior Member
Not quite, i still wont be able to pass any parameter to it so the FeatureProvider wont know how to generate the CreateFeatures needed when its called by the DiagramTypeProvider "SetFeatureProvider"

Right now i declare this parameter as a global variable but a possibility to pass a parameter to either the DiagramTypeProvider or FeatureProvider would be much better to understand and maintain

[Updated on: Fri, 14 March 2014 19:42]

Report message to a moderator

Re: Adding features dynamically [message #1276264 is a reply to message #1271302] Mon, 24 March 2014 10:09 Go to previous message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1931
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Yes, but you could have different DiagramTypeProviders, each creating the
right set of features.

Michael
Previous Topic:Professional Support
Next Topic:Dynamic "Refreshing" of Palette on Object Selection
Goto Forum:
  


Current Time: Fri Mar 29 04:59:57 GMT 2024

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

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

Back to the top