|Custom palette depending on diagram instance [message #1709056]
||Wed, 23 September 2015 15:37
| Rafal Filipiuk
Registered: September 2015
So I've been coding my implementation of my DiagramType using patterns, and I understand that the FeatureProvider is responsible for registering them (with addPattern()). What I need to be able to do is register patterns depending on the presence of some EObjects in my diagram instance's model file resource. For example, if an EObject of type Foo with name 'This is X' is present, I need to add a pattern as such: addPattern(new FooPattern('This is x')).
The main goal is so that when the user boots up the Diagram, the palette displays all instances of Foo as independent EClasses that, once the user creates them, will be serialized into instances of Bar.
To reiterate and clarify:
-Diagram resource (model file) has serialized instances of Foo.
-For every instance of Foo, a palette entry should exist
-Every palette entry creates instances of Bar, which are then serialized into our resource.
So essentially, I need to create patterns from an instance of a diagram, not from the diagram type. How would I do that? Is there anywhere I can regenerate the palette when opening a diagram file?
Thanks again for such prompt responses to questions.
Powered by FUDForum
. Page generated in 0.02310 seconds