Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "Papyrus/Mars Work Description/Improvments/Stereotype support/Solution Implementation"
(→Objective 5) |
(→Objective 1) |
||
Line 86: | Line 86: | ||
# Display the Label through the different EditPolicies | # Display the Label through the different EditPolicies | ||
#* For Node Label: '''AppliedStereotypeNodeLabelDisplayEditPolicy''' | #* For Node Label: '''AppliedStereotypeNodeLabelDisplayEditPolicy''' | ||
− | # Delete all usage of EAnnotation for the Stereotypes | + | # Delete all usage of EAnnotation for the Stereotypes |
− | + | ||
'''Note''': <span style="color: green;" > '''Done''' </span>, means that the task is done but not already comitted. | '''Note''': <span style="color: green;" > '''Done''' </span>, means that the task is done but not already comitted. |
Revision as of 11:53, 17 April 2015
Contents
Stereotype Display: Solution Implementation
Architecture
Technically, the DecorationNode will be extended to create StereotypeLabel element into notation file. As well as for the stereotype properties.
Demo is available here
Notation Model Structure
Structure into Notation file would be:
DecorationNode[type=StereotypeLabel][stereotype ="SysML::Allocations::Allocated"] BasicCompartment[type=StereotypeCompartment][stereotype="SysML::Allocations::Allocated"] DecorationNode[type=StereotypeProperty][property ="allocatedFrom=0..*" ] DecorationNode[type=StereotypeProperty][property ="allocatedTo=0..*" ] BasicCompartment[type=StereotypeBrace][stereotype="SysML::Allocations::Allocated"] DecorationNode[type=StereotypeBraceProperty][property ="allocatedFrom=0..*" ] DecorationNode[type=StereotypeBraceProperty][property ="allocatedTo=0..*" ]
Structure for the stereotype name Label:
DecorationNode (type = StereotypeLabel) stereotype(String: "SysML::Allocations::Allocated") element(Stereotype: "SysML::Allocations::Allocated") depth (String: None, Full, Auto, -1,-2,-3,...)
Structure of the property (to be defined):
BasicCompartment (type = StereotypeCompartment) stereotype(String: "SysML::Allocations::Allocated") element(Stereotype: "SysML::Allocations::Allocated") DecorationNode (type = StereotypeProperty) element( UML Property : AllocatedFrom )
EditPolicies Hierarchy
Here is the Class diagram that could be the solution for the new architecture:
Legend:
- AS = AppliedStereotype
- green block = new
- red block = modified
- blue block = not changed
Property View Design
As also listed in the requirements, the Graphical User Interface should be improve in order to be clearer than the previous interface. The main different with the previsous structure is that the location of the properties is not exclusive anymore. The User can then choose to display some properties at different locations:
- In a Compartment
- In a Comment
- In Braces
Here is the first suggestion for the Stereotype Display:
This will be implement during the Objective 5.
Intermediate Objectives
To plan the several steps of this whole improvement, it will be splitted into sub-goals.
All the objectives will be first fulfill for the Named Elements (like the Classes, Packages, ...) Once the new structure in place for those elements, it will be done for the other types of elements.
- Objective 1: Display all the stereotypes thanks to DecorationNode with one Label by stereotype.
- Objective 2:
- 2a. Hide stereotypes thanks to CSS.
- 2b. Display Qualified Name of some stereotypes thanks to CSS.
- Objective 3: Display all the properties into the compartment thanks to the DecorationNode into the notation file.
- Objective 4:
- 4a. Hide the properties thanks to the CSS
- 4b. Display properties into braces thanks to the CSS
- 4c. Display properties into comment thanks to CSS.
- Objective 5: Create the graphical user interface into the Appearence Tab
- Objective 6: Propage objectives 1 to 5 to the other element throught their own edit policied.
- Objective 7: Plan a model transformation for a compatibility with old models using EAnnotation.
The following section details the progression of each Objective.
Objective 1
- Display all the stereotypes thanks to DecorationNode with one Label by stereotype. (Done)
To fulfill this objective, the following steps should be completed:
- Create and Delete StereotypeLabel through a Recording Command
- Create / Delete objects when stereotype is applied or deleted.
- Display the Label through the different EditPolicies
- For Node Label: AppliedStereotypeNodeLabelDisplayEditPolicy
- Delete all usage of EAnnotation for the Stereotypes
Note: Done , means that the task is done but not already comitted.
The entire Objective 1 will be committed at once when completed.
Objective 2
- 2a. Hide stereotypes thanks to CSS (Done)
- Manage the isVisible parameter into the display of the Stereotype Label
- Edit the CSS DOM Tree to match the NamedStyle Value
- 2b. Display Qualified Name of some stereotypes thanks to CSS (Done)
- Manage the QualifiedName depth into the display of the Stereotype Label
- Retrieve the "depth" value from the CSS
Objective 3
- Display all the properties into the compartment thanks to the DecorationNode into the notation file.(Done)
- To fulfill this objective, the following steps should be completed:
- Create and Delete StereotypeProperty through a Recording Command
- Create / Delete objects when stereotype is applied or deleted.
- Display the Properties through the different EditPolicies
- For Node Label: AppliedStereotypeNodeLabelDisplayEditPolicy
Objective 4
- 4a. Hide the properties thanks to the CSS (Done)
- Modify the CSS DOM tree to match the NamedStyle Selectors For "StereotypeProperty".
- Catch the CSS value to hide the corresponded Property.
- Modify the CSS DOM tree to match the NamedStyle Selectors For "StereotypeCompartment".
- Catch the CSS value to hide the corresponded Compartment.
- Encountered issues:
- StereotypeProperties Labels are not created when CSS doesn't show the compartment
- Solution: Notify "AppliedStereotypePropertyEditPolicy" when stereotype is applied. Using StereotypeElementListener instead of PapyrusStereotypeListener
- Error when refresh figure with an empty Property textFlow
- Solution: Add condition on Text value during TextFlow creation into the AppliedStereotypeMultilinePropertyEditPart
- StereotypeProperties Labels are not created when CSS doesn't show the compartment
- Encountered issues:
- 4b. Display properties into braces thanks to CSS.(Done)
- Add The Location NamedStyle into Notation File
- Catch the CSS Value for the Location
- Calculate the New Text to display with Braces
- 4c. Display properties into a comment thanks to CSS.(Done)
- Create the Comment Object.
- Create the link between Comment and EditPart
- Calculate the text to display into the Comment
- Manage CSS property to display or hide properties into Comment
- Edit the Comment text content with the new text value
- Update Content when Stereotypes Applied or unapplied
- Delete Comment when empty
- Encountered issues:
- CSS application have unstable behavior.
- When a compartment is empty, the only way to not show it is to use the CSS attribute visible:false;
- To be able to Hide Brace Properties independently of Compartment Properties, the Properties Structure should be dupplicated for Brace Properties
- To manage several Stereotype Application, the related Element of the node should be the Stereotype and not it's application
- Encountered issues:
Objective 5
- Create the Graphical Interface to display Labels and Properties to override the CSS.
- This feature depends on the Task 463834 to allow table into the Property View.
- In the meantime, the current property view has been connected to the New structure, with some lacks.
- This feature depends on the Task 463834 to allow table into the Property View.
- 5a. Show a Stereotype Table with a stereotype and its Properties (464409)
- In Progress
- 5b. Add the required Column into the Tables
- Depth as a Combo Box
- Different location of the property (Brace, Comment, Compartment) as Boolean checkBox
- Visible as a boolean checkBox
- Not Started
- 5c. Insert the table as a Property View
- Not Started
- 5d. Add commands to Expand / Collapse
- Not Started
- 5e. Add commands to Select All / Deselect All
- Not Started
- 5f. Add Management rules (to be defined )
- Not Started
- 5a. Show a Stereotype Table with a stereotype and its Properties (464409)
Objective 6
- Propage objectives 1 to 5 to the other element throught their own edit policied.
- For External Node : AppliedStereotypeExternelNodeEditPolicy
- Done
- For External Node label: AppliedStereotypeExternelNodeLabelEditPolicy
- Done
- For Icon: AppliedStereotypeIconDisplayEditPolicy
- Done
- For Link Label: AppliedStereotypeLinkLabelDisplayEditPolicy
- Done
- For External Node : AppliedStereotypeExternelNodeEditPolicy
Objective 7
- Plan a model transformation for a compatibility with old models using EAnnotation (463903).
- In Progress
Open Points and Lessons learned
Open Points
- How an EditPolicy can be called when the Refresh (F5) of the EditPart is executed? It is required to refresh visual after applying a CSS.
- It appears that the super Class GraphicalEditPolicy doesn't implement a refresh method, contrary to the internal class GraphicalEditPolicyEx
- But this class is internal to GMF, so how make the refresh working for the Papyrus editPolicies.
- What are the general Use Cases for this new feature?
Lessons learned
- How a CSS selector can match on Notation Element likes [type="StereotypeLabel"] where "StereotypeLabel" is the type of a DecorationNode.
- Clue : The class CSSDOMSemanticElementHelper defines rules to match the sementic Element of a notation view.
- How to define the way the CSS selector match elements?
- Clue: The method doGetAttribute in the class GMFUMLElementAdapter return the corresponding element.