Viewpoint configuration for StateMachine Diagrams [message #1652035] |
Thu, 05 March 2015 12:03  |
Eclipse User |
|
|
|
I am currently trying to create a simplified version of a StateMachine diagram. I've created a viewpoint configuration with a Papyrus diagram and the implementationID "PapyrusUMLStateMachineDiagram". I also set the root and owner rules to allow the StateMachine UML element. This far everything is fine and when I use this configuration I can indeed create a StateMachine diagram inside of a StateMachine UML element.
Now to my problem: I would like to remove some of the tools that are available in the diagrams palette. So naturally I created a Palette Rule for the diagram and now I'm stuck finding the right IDs for the rule.
I already looked in several places but to no avail:
- Papyrus' Eclipse Help page about Viewpoints had nothing on the matter of tool IDs
- git.eclipse.org/c/papyrus/org.eclipse.papyrus.git/tree/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/builtin/default.configuration?id=6878173ec2cfb0e7bed0eec7ec43f8db079c1f6a
In the default viewpoint configuration I found IDs for many tools but none for the tools of the StateMachine diagram.
- git.eclipse.org/c/papyrus/org.eclipse.papyrus.git/tree/extraplugins/papyrus4education/org.eclipse.papyrus.uml.diagram.education/resources/configuration/EducationUML.configuration?id=6878173ec2cfb0e7bed0eec7ec43f8db079c1f6a
The viewpoint configuration of the Papyrus4Education project only defines two Usecase diagrams at the moment. No StateMachines yet sadly.
- git.eclipse.org/c/papyrus/org.eclipse.papyrus.git/tree/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/plugin.xml?id=6878173ec2cfb0e7bed0eec7ec43f8db079c1f6a#n754
I also tried just using the IDs defined in the StateMachine diagrams plugin.xml like "createStateCreationTool" but nothing happened.
- Finally I tried out some guesses like "statemachine.tool.state" and "state.tool.state". They also did not work.
(unfortunately the forum doesn't allow me to post real links despite them leading to eclipse.org)
So the question again in short: what are the IDs of the StateMachine diagrams tools I can use to disable them via a viewpoint configuration?
|
|
|
|
|
Re: Viewpoint configuration for StateMachine Diagrams [message #1661569 is a reply to message #1658548] |
Mon, 09 March 2015 13:47   |
Eclipse User |
|
|
|
Hi Lars,
The IDs seem valid. They are not generated, so they may be (and actually are) inconsistent between diagrams. Also, the viewpoints mechanism is supposed to be generic to all Papyrus diagrams, so it is expected to work.
The rules seem to work for me, so maybe you're running into priority conflicts between rules? I've tried the following rules:
The palette disappears completely, as expected
createRegionCreationTool -> deny
The Region disappears, other elements are still present, as expected
createRegionCreationTool -> allow
* -> deny
Everything disappears (Whereas I'd expect the Region to be allowed).
createRegionCreationTool -> deny
* -> allow
The Region is removed, other elements are allowed, as expected
So there seems to be some issues with the rules priority (Maybe due to the lack of namespace in the palette entries?), but filtering a few elements seems to work as expected (Allowing specific elements doesn't seem to work properly however)
HTH,
Camille
|
|
|
Re: Viewpoint configuration for StateMachine Diagrams [message #1663187 is a reply to message #1661569] |
Tue, 10 March 2015 05:59  |
Eclipse User |
|
|
|
Hooray, the mystery has been solved!
Following your examples I tried to deny the Region tool instead of the State tool and that actually worked. So after tinkering around a bit and finally denying all tools by their ID I found that a certain group of tools could not be hidden through my viewpoint config. It were exactly the tools I played around with in the palette customization before. After dis- and enabling the "PapyrusUMLStateMachineDiagram Standard Palette" I noticed that now all tools were hidden as expected from the viewpoint. Some configuration must have been left somewhere even though I thought I had undone all the changes to the palette. Now that they have been cleared I can disable all the tools to my hearts content!
Well I guess that closes this topic. Thanks for the help Camille! And I hope I provided enough information for anyone with a similar problem.
Regards,
Lars
|
|
|
Powered by
FUDForum. Page generated in 0.60248 seconds