Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Viewpoint configuration for StateMachine Diagrams
Viewpoint configuration for StateMachine Diagrams [message #1652035] Thu, 05 March 2015 17:03 Go to next message
Lars Donner is currently offline Lars DonnerFriend
Messages: 3
Registered: March 2015
Junior Member
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 #1653912 is a reply to message #1652035] Fri, 06 March 2015 12:49 Go to previous messageGo to next message
Camille Letavernier is currently offline Camille LetavernierFriend
Messages: 952
Registered: February 2011
Senior Member
Hi,

The Viewpoints model of Papyrus has indeed little tooling support. Here are the StateMachine diagram tool IDs:

createRegionCreationTool
createStateCreationTool
createInitialCreationTool
createFinalStateCreationTool
createShallowHistoryCreationTool
createDeepHistoryCreationTool
createForkCreationTool
createJoinCreationTool
createChoiceCreationTool
createJunctionCreationTool
createEntryPointCreationTool
createExitPointCreationTool
createTerminateCreationTool
createConnectionPointReferenceCreationTool
createStateMachineCommentCreationTool
createConstraintCreationTool
createTransitionCreationTool
createCommentlinkCreationTool
createContextLink3CreationTool


HTH,
Camille


Camille Letavernier
Re: Viewpoint configuration for StateMachine Diagrams [message #1658548 is a reply to message #1653912] Sun, 08 March 2015 11:40 Go to previous messageGo to next message
Lars Donner is currently offline Lars DonnerFriend
Messages: 3
Registered: March 2015
Junior Member
Hi,
thanks for the reply!
Unfortunately those IDs don't seem to work with the Viewpoint Palette Rues as mentioned in bullet 4 in the original post. I tried to disallow the 'createStateCreationTool' but when creating a new diagram with that configuration, the State tool remained in the palette. I made sure the configuration was loaded correctly by added a Class diagram with 'clazz.tool.class' disabled and it worked as intended.
Seeing how the StateMachine tools have such a different ID style from the Class and Usecase Diagram ('createInitialCreationTool' vs 'clazz.tool.class') I'm thinking that there might not be viewpoint support implemented for the StateMachine tools. I haven't found the code responsible for the viewpoints contribution to the tool palette yet so I can't prove or disprove that theory right now. Though I'm hoping I'm wrong about it.
Re: Viewpoint configuration for StateMachine Diagrams [message #1661569 is a reply to message #1658548] Mon, 09 March 2015 17:47 Go to previous messageGo to next message
Camille Letavernier is currently offline Camille LetavernierFriend
Messages: 952
Registered: February 2011
Senior Member
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:

* -> deny


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


Camille Letavernier
Re: Viewpoint configuration for StateMachine Diagrams [message #1663187 is a reply to message #1661569] Tue, 10 March 2015 09:59 Go to previous message
Lars Donner is currently offline Lars DonnerFriend
Messages: 3
Registered: March 2015
Junior Member
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
Previous Topic:Root of EditPart
Next Topic:[Activity diagram] Pins in Call Behavior action
Goto Forum:
  


Current Time: Sat Apr 20 01:56:31 GMT 2024

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

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

Back to the top