Community
Participate
Working Groups
It is sometime useful to see at the same time the code attached to several transitions: for that purpose, the property view is no more useful. It is then possible to open each piece of code attached to a transition into a specific textual editor by using a contextual menu on the transition ("Show source in an editor"). Then the tool asked which code you want to see (e.g., effect or guard) and open an editor to show the code.
Clarification: showing the code directly on a diagram is not considered useful, as larger pieces of code would make the diagram unreadable. An exception is code that delegates directly to a method owned by the class. Thus, it might be useful to show the first line directly in the diagram (eventually cut after a certain number of characters and followed by ...)
Remind me of this next week and I will give you a demo of an efficient UI. :)
Created attachment 237397 [details] Statemachine and associated code
A first fix has been added with commit 09757bb49805f1395e86a3a03a599ad11f2b1d6a (master). Now, the preference page contains two additional boolean options: (1) whether to indicate parameters in a call or attributes in a signal by means of (...) after the name of the operation or signal. Defaults to true. (2) whether to make a line break after the "/", if an effect is present. Defaults to true. The intention is to avoid wide labels. (3) the max. number of lines to display. Default is 1. Longer text is followed by "...". In addition, it's possible to see the complete code with the old C/C++ view, when the transition is selected and to open a CDT editor. Currently, the code generator has a complete class as granularity, i.e. there is no separate file for the behavior within the transition. The attachment shows a sample screenshot with the number of shown lines set to 0. Things still missing: - Allow per diagram settings - Complete CDT integration, currently reverse is not properly done for effects - The linebreak should perhaps not be done (regardless of the associated flag), if the number of lines to show is set to 0.
There is still no possibility to update the settings per diagram, which would be very useful as some diagrams would be unreadable if we show the complete code, while it may be useful for others. Therefore, preference pages are not a suitable way, but the configuration must be part of the CSS for the diagram.
The option to control via CSS has been added with commit f3e8a9db27f252723305c9f9ae95c00f6c51143b for master and 88586d4986afc80be8ec4cec06e51dd3f69263b9 for 1.0-maintenance The additional properties are documented on: https://wiki.eclipse.org/MDT/Papyrus/UserGuide/CSS#Style_properties They can be applied to a diagram using for instance: Transition > Label { bodyCutLength : 5; lineBreakBeforeEffect : true; }
I'm setting this bug to "resolved", see comment 6.