From aa8fe3c74d0e20ad56edab6678f4b41862c5216a Mon Sep 17 00:00:00 2001 From: ptessier Date: Tue, 1 Apr 2014 17:28:51 +0200 Subject: 431723: [Test] property of stereotypes must be tested with a Junit https://bugs.eclipse.org/bugs/show_bug.cgi?id=431723 --- .../ResizeableListCompartmentEditPart.java | 4 +- .../META-INF/MANIFEST.MF | 1 + .../build.properties | 4 +- .../docs/StereotypePropertyCommentv2.docx | Bin 0 -> 393534 bytes .../docs/UserGuide.docx | Bin 0 -> 342267 bytes .../docs/img/ChangeAppearance.PNG | Bin 0 -> 19646 bytes .../docs/img/Deletion.PNG | Bin 0 -> 39172 bytes .../docs/img/StereotypeDisplay1.PNG | Bin 0 -> 14046 bytes .../docs/img/StereotypeDisplay2.PNG | Bin 0 -> 18725 bytes .../docs/img/TechnicalProposition.PNG | Bin 0 -> 56464 bytes .../docs/img/displayAsComment.PNG | Bin 0 -> 27560 bytes .../docs/img/hide.PNG | Bin 0 -> 45238 bytes .../img/removeDisplayAppliedStereotypeProperty.PNG | Bin 0 -> 22486 bytes .../docs/img/removeStereotype.PNG | Bin 0 -> 26145 bytes .../docs/img/resultDisplay.PNG | Bin 0 -> 19462 bytes .../docs/model.di | 68 + .../docs/model.notation | 2570 ++++++++++++++++++++ .../docs/model.uml | 315 +++ .../plugin.pdoc | 4 + .../AppliedStereotypeConpartmentEditPart.java | 6 +- ...AppliedStereotypeMultilinePropertyEditPart.java | 33 +- ...AppliedStereotypeCommentCreationEditPolicy.java | 27 +- .../AppliedStereotypeCompartmentEditPolicy.java | 7 +- .../AppliedStereotypePropertiesEditPolicy.java | 8 +- .../edition/provider/CustomEditPolicyProvider.java | 2 +- 25 files changed, 3020 insertions(+), 29 deletions(-) create mode 100644 plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/docs/StereotypePropertyCommentv2.docx create mode 100644 plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/docs/UserGuide.docx create mode 100644 plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/docs/img/ChangeAppearance.PNG create mode 100644 plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/docs/img/Deletion.PNG create mode 100644 plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/docs/img/StereotypeDisplay1.PNG create mode 100644 plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/docs/img/StereotypeDisplay2.PNG create mode 100644 plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/docs/img/TechnicalProposition.PNG create mode 100644 plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/docs/img/displayAsComment.PNG create mode 100644 plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/docs/img/hide.PNG create mode 100644 plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/docs/img/removeDisplayAppliedStereotypeProperty.PNG create mode 100644 plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/docs/img/removeStereotype.PNG create mode 100644 plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/docs/img/resultDisplay.PNG create mode 100644 plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/docs/model.di create mode 100644 plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/docs/model.notation create mode 100644 plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/docs/model.uml create mode 100644 plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/plugin.pdoc (limited to 'plugins') diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpart/ResizeableListCompartmentEditPart.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpart/ResizeableListCompartmentEditPart.java index eeec5ecb6ae..064e23b08ab 100644 --- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpart/ResizeableListCompartmentEditPart.java +++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpart/ResizeableListCompartmentEditPart.java @@ -62,7 +62,9 @@ public abstract class ResizeableListCompartmentEditPart extends ListCompartmentE if(NotationPackage.eINSTANCE.getSize_Width().equals(feature) || NotationPackage.eINSTANCE.getSize_Height().equals(feature) || NotationPackage.eINSTANCE.getLocation_X().equals(feature) || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) { refreshBounds(); } - super.handleNotificationEvent(notification); + if( resolveSemanticElement()!=null){ + super.handleNotificationEvent(notification); + } } @Override diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/META-INF/MANIFEST.MF b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/META-INF/MANIFEST.MF index 452d0e580a8..d5ac1152931 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/META-INF/MANIFEST.MF +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/META-INF/MANIFEST.MF @@ -26,4 +26,5 @@ Bundle-ManifestVersion: 2 Bundle-SymbolicName: org.eclipse.papyrus.uml.diagram.stereotype.editio n;singleton:=true Bundle-RequiredExecutionEnvironment: J2SE-1.5 +Bundle-Description: The pupose of this plugin is add the fucntionality to display stereotype into compartment or into comment of applied stereotype. More details (models and file.doc) has been store in the docs directory. diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/build.properties b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/build.properties index 653ec3c3daf..8013a222c4b 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/build.properties +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/build.properties @@ -5,4 +5,6 @@ bin.includes = META-INF/,\ plugin.xml,\ about.html,\ plugin.properties -src.includes = about.html +src.includes = about.html,\ + docs/,\ + plugin.pdoc diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/docs/StereotypePropertyCommentv2.docx b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/docs/StereotypePropertyCommentv2.docx new file mode 100644 index 00000000000..73b8175a810 Binary files /dev/null and b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/docs/StereotypePropertyCommentv2.docx differ diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/docs/UserGuide.docx b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/docs/UserGuide.docx new file mode 100644 index 00000000000..d516947c044 Binary files /dev/null and b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/docs/UserGuide.docx differ diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/docs/img/ChangeAppearance.PNG b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/docs/img/ChangeAppearance.PNG new file mode 100644 index 00000000000..7eb0628f83c Binary files /dev/null and b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/docs/img/ChangeAppearance.PNG differ diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/docs/img/Deletion.PNG b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/docs/img/Deletion.PNG new file mode 100644 index 00000000000..db44473b2cb Binary files /dev/null and b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/docs/img/Deletion.PNG differ diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/docs/img/StereotypeDisplay1.PNG b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/docs/img/StereotypeDisplay1.PNG new file mode 100644 index 00000000000..6f2f91bac1c Binary files /dev/null and b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/docs/img/StereotypeDisplay1.PNG differ diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/docs/img/StereotypeDisplay2.PNG b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/docs/img/StereotypeDisplay2.PNG new file mode 100644 index 00000000000..57e3cf00506 Binary files /dev/null and b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/docs/img/StereotypeDisplay2.PNG differ diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/docs/img/TechnicalProposition.PNG b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/docs/img/TechnicalProposition.PNG new file mode 100644 index 00000000000..8e8996dd039 Binary files /dev/null and b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/docs/img/TechnicalProposition.PNG differ diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/docs/img/displayAsComment.PNG b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/docs/img/displayAsComment.PNG new file mode 100644 index 00000000000..805c62fee92 Binary files /dev/null and b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/docs/img/displayAsComment.PNG differ diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/docs/img/hide.PNG b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/docs/img/hide.PNG new file mode 100644 index 00000000000..48b89b9d7fc Binary files /dev/null and b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/docs/img/hide.PNG differ diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/docs/img/removeDisplayAppliedStereotypeProperty.PNG b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/docs/img/removeDisplayAppliedStereotypeProperty.PNG new file mode 100644 index 00000000000..b26bad85b08 Binary files /dev/null and b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/docs/img/removeDisplayAppliedStereotypeProperty.PNG differ diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/docs/img/removeStereotype.PNG b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/docs/img/removeStereotype.PNG new file mode 100644 index 00000000000..222cefa1e0b Binary files /dev/null and b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/docs/img/removeStereotype.PNG differ diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/docs/img/resultDisplay.PNG b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/docs/img/resultDisplay.PNG new file mode 100644 index 00000000000..461cc35c742 Binary files /dev/null and b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/docs/img/resultDisplay.PNG differ diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/docs/model.di b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/docs/model.di new file mode 100644 index 00000000000..0a41ead3893 --- /dev/null +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/docs/model.di @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/docs/model.notation b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/docs/model.notation new file mode 100644 index 00000000000..0385b197d9f --- /dev/null +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/docs/model.notation @@ -0,0 +1,2570 @@ + + + + + +
+ + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + +
+ + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + +
+ + + + + + + +
+ + +
+ + +
+ + + + + + + +
+ + +
+ + +
+ + + + + + + +
+ + +
+ + +
+ + +
+
+
+ + + + + + + +
+ + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + +
+ + + + + + + +
+ + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + +
+ + + + + +
+ + +
+ + +
+ + +
+
+
+ + +
+
+
+ + + + + + + + + + + + +
+ + +
+ + +
+ + + + + + + + + + + + +
+ + +
+ + +
+ + + + + + + + + + + + +
+ + +
+ + +
+ + + + + + + + + + + + +
+ + +
+ + +
+ + + + + + + + + + + + +
+ + +
+ + +
+ + + + + + + + + + + + +
+ + +
+ + +
+ + + + + + + + +
+ + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + +
+ + + + + + + + + + + + +
+ + +
+ + +
+ + + + + + + + + + + + +
+ + +
+ + +
+ + + + + + + + + + + + +
+ + +
+ + +
+ + + + + + + + + + + + +
+ + +
+ + +
+ + + + + + + + + + + + +
+ + +
+ + +
+ + + + + + + + +
+ + +
+ + +
+ + + + + + + + +
+ + +
+ + +
+ + + + + + + + +
+ + +
+ + +
+ + + + + + + + +
+ + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + +
+ + +
+
+
+
+
+ + + + + +
+ + +
+ + +
+ + + + + + + + + + + +
+ + +
+ + +
+ + + + + + + + + + + +
+ + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + +
+ + + + + + + + + + + + +
+ + +
+ + +
+ + + + + + + + + + + + +
+ + +
+ + +
+ + + + + + + + + + + + +
+ + +
+ + +
+ + + + + + + + + + + + +
+ + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + +
+ + + + + + + + + + + + +
+ + +
+ + +
+ + + + + + + + + + + + +
+ + +
+ + +
+ + + + + + + + + + + + +
+ + +
+ + +
+ + + + + + + + + + + + +
+ + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + +
+ + + + + + + + + + + + +
+ + +
+ + +
+ + + + + + + + + + + + +
+ + +
+ + +
+ + + + + + + + + + + + +
+ + +
+ + +
+ + + + + + + + + + + + +
+ + +
+ + +
+ + + + + + + + + + + + +
+ + +
+ + +
+ + + + + + + + + + + + +
+ + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + +
+ + + + + + + + + + + + +
+ + +
+ + +
+ + + + + + + + + + + + +
+ + +
+ + +
+ + + + + + + + + + + + +
+ + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + +
+ + + + + +
+ + +
+ + +
+ + + + + +
+ + +
+ + +
+ + + + + + + + + + + +
+ + +
+ + +
+ + + + + + + + + + + +
+ + +
+ + +
+ + + + + + + + + + + + + + + + + +
+ + +
+ + +
+ + + + + +
+ + +
+ + +
+ + + + + + + + + + + +
+ + +
+ + +
+ + + + + + + + + + + +
+ + +
+ + +
+ + + + + + + + + + + +
+ + +
+ + +
+ + + + + + + + + + + +
+ + +
+ + +
+ + + + + + + + + + + + + + + + + +
+ + +
+ + +
+ + + + + +
+ + +
+ + +
+ + + + + + + + + + + +
+ + +
+ + +
+ + + + + + + + + + + +
+ + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + +
+ + + + + + + +
+ + +
+ + +
+ + + + + + + +
+ + +
+ + +
+ + + + + + + +
+ + +
+ + +
+ + + + + + + +
+ + +
+ + +
+ + + + + + + +
+ + +
+ + +
+ + + + + + + +
+ + +
+ + +
+ + + + + + + +
+ + +
+ + +
+ + + + + + + +
+ + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + +
+ + +
+
+
+
+
+ + + + + + + + + + + + +
+ + +
+ + +
+ + +
+
+
+
+
+ + + + + + + + + + + + +
+ + +
+ + +
+ + +
+
+
+
+
+ + + + + + + + + + + + +
+ + +
+ + +
+ + +
+
+
+
+
+ + + + + + + + + + + + +
+ + +
+ + +
+ + +
+
+
+
+
+ + +
+
+
+ + +
+
+
+ + + + + + + + +
+ + +
+ + +
+ + +
+
+
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + + + + + + + +
+ + +
+ + +
+ + +
+
+
+
+
+ + +
+
+
+ + + + + + + + +
+ + +
+ + +
+ + +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/docs/model.uml b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/docs/model.uml new file mode 100644 index 00000000000..f1288d384df --- /dev/null +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/docs/model.uml @@ -0,0 +1,315 @@ + + + + Patrick Tessier (CEA LIST) +Version 0.2 + + + + + + + The comment symbol is created when a user decide to show at least one property value of a stereotype applied on a model element. + + + + • The comment symbol, and its link, used to display the stereotype values shall be deleted when the annotated model element is deleted. +• The comment symbol, and its link, used to display the stereotype values shall be deleted when the graphical representation of the annotated model element is deleted, that is to say when the annotated model element is hidden from the diagram. +• The comment symbol, and its link, used to display the stereotype values shall be deleted when the user hides all values of a stereotype. +• The comment symbol, and its link, used to display the stereotype values shall be deleted when the applied stereotype whose values are currently shown are unapplied. +• When the user delete or cut graphically the comment symbol, this latter is deleted, as well its link with the annotated model element and the stereotypes values that were shown in the deleted comment symbol are set to be no more shown in the notation file. +• When the profile that contains the stereotype is unapplied +• For the moment, this element cannot be deleted semantically or graphically. + Semantically = unapplication of stereotypes? + graphically = update information of the display of the property of stereotype in the property view (maybe later) + + + • Create it when the element is stereotyped and when a property of the stereotype is displayed as "comment shape" + + + + • When the semantic element is deleted +• when all properties of applied stereotypes are not displayed as "comment shape" +• when all properties of applied stereotypes that are displayed as " comment shape" are unapplied +• For the moment, this element cannot be deleted semantically or graphically, because it is only to be link the "comment" + + + + • The comment symbol showing the stereotype values can be graphically moved everywhere in the diagram. +• The comment symbol showing the stereotype values cannot be copy/past. + + + + - Apply chosen profile and chosen stereotype on the element by using profile tab. +- Go to the property view (appearance tab). +- Select properties to stereotype to select and then choose the “display place” as Comment + + +Thank to this, a comment symbol appear. It contains the applied stereotype property that you want to see. The property of stereotype can be edited. This functionality can be use on links or nodes see Figure 5. + + + + • The comment symbol, and its link, used to display the stereotype values shall be deleted when the annotated model element is deleted. + +Figure 6: Deletion of the selected element + +• The comment symbol, and its link, used to display the stereotype values shall be deleted when the graphical representation of the annotated model element is deleted, that is to say when the annotated model element is hidden from the diagram. + + +• The comment symbol, and its link, used to display the stereotype values shall be deleted when the user hides all values of a stereotype. +To that, go the property view select each property of stereotype (1) and click on the small TV (2) Figure 8 . When the property is displayed the symbol is , when it is not displayed the symbol is . + +Figure 8: Remove the display of applied stereotype property +• The comment symbol, and its link, used to display the stereotype values shall be deleted when the applied stereotype whose values are currently shown are unapplied. + To do that , go the property view (Figure 9), select profile tab, and first select the stereotype to remove (1) and then the click on the red cross (2) + + + + + + The presentation of the comment symbol can be customized by the user. You can change the background and the foreground color. + + + + Within UML, there are three options to show the values of stereotype applications: (i) within a dedicated compartment (e.g., left side within Figure 2); within a string enclosed by braces and put just behind the string showing the stereotype application ((e.g., right side within Figure 2); (iii) using a comment symbol as denoted in the Figure 2. The purpose is here to support this latter option. + + + + + + + + + + + + + + + + + + + + + + Display stereotype directly as comment shape by selecteing two propertie! +a bug was raised because several comment were created +393530: [Stereotypes] doublon of applied stereotype comment can be created + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The applied stereotypes properties “comment” is represented by: +The editpart AppliedStereotypesCommentEditpart, the comment shape that will contains the editpart in charge of the edition of sterotype (AppliedStereotypeConpartmentEditPart, AppliedStereotypePropertyEditPart). +The editpart AppliedSterotypesCommentLinkEditPart, the link between the stereotyped element and the comment. + + + + The Applied StereotypeCommentEdipart and the appliedStereotypeCommentLinkEditPart are connected to the semantic element. Thanks to this, if the semantic element is deleted the comment will be also deleted. +The Applied StereotypeCommentEdipart will be contains eannotation about stereotype application exactly as the editpart that represents the semantic element. In this manner, it is possible to reuse mechanism of stereotype edition. +To ensure the creation of the comment and the synchronization of eannotation information from the Semantic editpart an editpolicy will be added: the AppliedStereotypeCommentEditPolicy. + + + + Explaination of the example: +Two stereotypes are applied on the Class1. By default two ApplicationStereotypeCompartment are created (one references stapp1, and the second references stapp2). By default there are not visible. This is the normal behavior. +The user has decided to display a property if the applied stereotype stapp1. +An AppliedStereotypesCommentEditpart and AppliedStereotypeCommentLinkEditPart are created. (They references Class1). The AppliedStereotypesCommentEditpart reuse the standard mechanism of stereotype displaying: +Two ApplicationStereotypeCompartment are created (one references stapp1 with visibility=true, and the second references stapp2 with the visibility=false). +An appliedStereotypePropertyEditpart is created because we want to see a property of stapp1 + + + + • CommentShapeForAppliedStereotypeEditPolicy : this editpolicy attached to StereotypeCommentEdipart has in charge to prevent the remove form model and launch command of deletion if it detect that any properties of applied stereotype are displayed. + + + • AppliedStereotypeCompartmentForCommentShapeEditPolicy is another editpolicy attached to StereotypeCommentEdipart. It does the same work as AppliedStereotypeCompartmentEditPolicy. Because the StereotypeCommentEdipart is not attached to a semantic element by the attribute element of the notation view. It specializes the method getUMLElement to find the semantic element + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + To ensure the creation of the comment and the synchronization of eannotation information from the Semantic editpart an editpolicy will be added: the AppliedStereotypeCommentCreationEditPolicy. +This editpolicy has in charge to: +- Create by using the command CreateAppliedStereotypeCommentViewCommand +- Destroy the AppliedStereotypesCommentEditpart +- Adapt the information about stereotype display into AppliedstereotypeCommentEditPart by using eannotation existing mechanism + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A node and a link are stereotyped. The purpose is to display applied stereotype properties as comment + + + + + A node and a link are stereotyped. Applied stereotype properties are displayed as compartment. The purpose is to display them as comment. The comment has to be created and compartments disappear. + + + + + A node and a link are stereotyped. Applied stereotype properties are displayed as comment. The purpose is to open the file with papyrus and ensure that there are displayed as comment. + + + + + + + + + A node and a link are stereotyped. Applied stereotype properties are displayed as comment. The purpose is to open the file with papyrus and and to display as compartment. Comment has to disappear. + + + + + + A node and a link are stereotyped. Applied stereotype properties are displayed as comment. The purpose is to open the file with papyrus and to unapply profile. Comment has to disappear. + + + + + + A node and a link are stereotyped. Applied stereotype properties are displayed as comment. The purpose is to open the file with papyrus and to unapply stereotype. Comment has to disappear. + + + + + + A node and a link are stereotyped. Applied stereotype properties are displayed as comment. But the profile has been unapplied with the UML editor.So the notation is not up to date.The purpose is to open the file with papyrus. Comment has to disappear. + + + + + + A node and a link are stereotyped. Applied stereotype properties are displayed as comment. But the profile has been unapplied with diagram closed.The purpose is to open the diagram. Comment has to disappear. + + + + + + + + A node and a link are stereotyped. Applied stereotype properties are displayed as comment. The purpose is to open the file with papyrus and ensure that you can move comment into package without move stereotyped element. + + + + + + A node and a link are stereotyped. Applied stereotype properties are displayed as comment. The purpose is to open the file with papyrus and ensure that you can move semantic into package without move comment. + + + + + + A node and a link are stereotyped. Applied stereotype properties are displayed as comment. The purpose is to open the file with papyrus and ensure that you can move comment everywhere. + + + + + + + diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/plugin.pdoc b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/plugin.pdoc new file mode 100644 index 00000000000..fb1783dd8d0 --- /dev/null +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/plugin.pdoc @@ -0,0 +1,4 @@ + + + + diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/src/org/eclipse/papyrus/uml/diagram/stereotype/edition/editpart/AppliedStereotypeConpartmentEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/src/org/eclipse/papyrus/uml/diagram/stereotype/edition/editpart/AppliedStereotypeConpartmentEditPart.java index 34556b027db..bfdc311036c 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/src/org/eclipse/papyrus/uml/diagram/stereotype/edition/editpart/AppliedStereotypeConpartmentEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/src/org/eclipse/papyrus/uml/diagram/stereotype/edition/editpart/AppliedStereotypeConpartmentEditPart.java @@ -139,7 +139,11 @@ public class AppliedStereotypeConpartmentEditPart extends ResizeableListCompartm if(NotationPackage.eINSTANCE.getSize_Width().equals(feature) || NotationPackage.eINSTANCE.getSize_Height().equals(feature) || NotationPackage.eINSTANCE.getLocation_X().equals(feature) || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) { refreshBounds(); } - super.handleNotificationEvent(notification); + + // before to be suppressed by its owner, the associate EObject can be UNSET, so refresh is prevented + if(resolveSemanticElement()!=null){ + super.handleNotificationEvent(notification); + } } @Override diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/src/org/eclipse/papyrus/uml/diagram/stereotype/edition/editpart/AppliedStereotypeMultilinePropertyEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/src/org/eclipse/papyrus/uml/diagram/stereotype/edition/editpart/AppliedStereotypeMultilinePropertyEditPart.java index 1dfdff97c4d..dc085fab9cb 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/src/org/eclipse/papyrus/uml/diagram/stereotype/edition/editpart/AppliedStereotypeMultilinePropertyEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/src/org/eclipse/papyrus/uml/diagram/stereotype/edition/editpart/AppliedStereotypeMultilinePropertyEditPart.java @@ -286,7 +286,7 @@ public class AppliedStereotypeMultilinePropertyEditPart extends CompartmentEditP if(getParserElement() == null || getParser() == null) { return ""; //$NON-NLS-1$ } - + // return getParser().getEditString(new SemanticAdapter((EObject) this.getAdapter(AppliedStereotypeProperty.class), getNotationView()), getParserOptions().intValue()); return getParser().getEditString(new SemanticAdapter(resolveSemanticElement(), getNotationView()), getParserOptions().intValue()); } @@ -389,7 +389,7 @@ public class AppliedStereotypeMultilinePropertyEditPart extends CompartmentEditP */ protected void performDirectEdit() { BusyIndicator.showWhile(Display.getDefault(), new Runnable() { - + public void run() { getManager().show(); } @@ -446,7 +446,7 @@ public class AppliedStereotypeMultilinePropertyEditPart extends CompartmentEditP Dialog dialog = null; if (configuration instanceof ICustomDirectEditorConfiguration) { setManager(((ICustomDirectEditorConfiguration) configuration) - .createDirectEditManager(this)); + .createDirectEditManager(this)); initializeDirectEditManager(theRequest); return; } else if(configuration instanceof IPopupEditorConfiguration) { @@ -520,14 +520,14 @@ public class AppliedStereotypeMultilinePropertyEditPart extends CompartmentEditP public void run() { if (isActive() && isEditable()) { if (request - .getExtendedData() - .get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) { + .getExtendedData() + .get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) { Character initialChar = (Character) request - .getExtendedData() - .get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR); + .getExtendedData() + .get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR); performDirectEdit(initialChar.charValue()); } else if ((request instanceof DirectEditRequest) - && (getEditText().equals(getLabelText()))) { + && (getEditText().equals(getLabelText()))) { DirectEditRequest editRequest = (DirectEditRequest) request; performDirectEdit(editRequest.getLocation()); } else { @@ -540,7 +540,7 @@ public class AppliedStereotypeMultilinePropertyEditPart extends CompartmentEditP e.printStackTrace(); } } - + /** * * @see org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart#refreshVisuals() @@ -868,12 +868,15 @@ public class AppliedStereotypeMultilinePropertyEditPart extends CompartmentEditP */ @Override public void activate() { - super.activate(); - addOwnerElementListeners(); - stereotypeApplication = ((View)getNotationView().eContainer()).getElement(); - final Element umlElement = UMLUtil.getBaseElement(stereotypeApplication); - getDiagramEventBroker().addNotificationListener(stereotypeApplication, this); - getDiagramEventBroker().addNotificationListener(umlElement, this); + // before to be suppressed by its owner, the associate EObject can be UNSET, so refresh is prevented + if(((View)getNotationView().eContainer()!=null)&&((View)getNotationView().eContainer()).getElement()!=null){ + super.activate(); + addOwnerElementListeners(); + stereotypeApplication = ((View)getNotationView().eContainer()).getElement(); + final Element umlElement = UMLUtil.getBaseElement(stereotypeApplication); + getDiagramEventBroker().addNotificationListener(stereotypeApplication, this); + getDiagramEventBroker().addNotificationListener(umlElement, this); + } } /** diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/src/org/eclipse/papyrus/uml/diagram/stereotype/edition/editpolicies/AppliedStereotypeCommentCreationEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/src/org/eclipse/papyrus/uml/diagram/stereotype/edition/editpolicies/AppliedStereotypeCommentCreationEditPolicy.java index 2914f240d7b..39d51b4fb27 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/src/org/eclipse/papyrus/uml/diagram/stereotype/edition/editpolicies/AppliedStereotypeCommentCreationEditPolicy.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/src/org/eclipse/papyrus/uml/diagram/stereotype/edition/editpolicies/AppliedStereotypeCommentCreationEditPolicy.java @@ -57,6 +57,9 @@ public class AppliedStereotypeCommentCreationEditPolicy extends AppliedStereotyp public final static String APPLIED_STEREOTYPE_COMMENT = "Applied_Stereotype_Comment"; + /** + * This method has in charge to refresh the presence of the view that represent the comment + */ protected void updateAppliedStereotypeCommentShape() { String stereotypeLocalizationToDisplay = AppliedStereotypeHelper.getAppliedStereotypesPropertiesLocalization((View)getHost().getModel()); String stereotypePropertiesToDisplay = AppliedStereotypeHelper.getAppliedStereotypesPropertiesToDisplay((View)getHost().getModel()); @@ -79,13 +82,20 @@ public class AppliedStereotypeCommentCreationEditPolicy extends AppliedStereotyp if(!stereotypeLocalizationToDisplay.equals(UMLVisualInformationPapyrusConstant.STEREOTYPE_COMMENT_LOCATION) || getvisisbleAppliedStereotypeCompartment(commentNode, getUMLElement()) == 0) { final TransactionalEditingDomain domain = TransactionUtil.getEditingDomain(commentNode); executeAppliedStereotypeCommentDeletion(domain, commentNode); - } } + } + /** + * return the number of visible compartment that represent a stereotype + * @param view the container view + * @param eobject the eobject that represent the container + * @return the number of visible stereotype compartment + */ protected int getvisisbleAppliedStereotypeCompartment(View view, EObject eobject) { int nbVisibleCompartment = 0; + @SuppressWarnings("unchecked") Iterator iteratorView = view.getChildren().iterator(); while(iteratorView.hasNext()) { View subview = (View)iteratorView.next(); @@ -95,7 +105,9 @@ public class AppliedStereotypeCommentCreationEditPolicy extends AppliedStereotyp } return nbVisibleCompartment; } - +/** + * this method is use to copy all eAnnotation from the view to the comment in order to display properties of stereotype + */ protected void delegateEAnnotationInCommentShape() { final Node appliedStereotypeComment = getAppliedStereotypeCommentNode(); @@ -119,7 +131,7 @@ public class AppliedStereotypeCommentCreationEditPolicy extends AppliedStereotyp } }; - Display.getCurrent().asyncExec(new Runnable() { + Display.getCurrent().syncExec(new Runnable() { public void run() { //use to avoid to put it in the command stack @@ -169,7 +181,7 @@ public class AppliedStereotypeCommentCreationEditPolicy extends AppliedStereotyp * the stereotype application */ protected void executeAppliedStereotypeCommentCreation(final EditPart editPart, final TransactionalEditingDomain domain, final EObject semanticElement) { - Display.getCurrent().asyncExec(new Runnable() { + Display.getCurrent().syncExec(new Runnable() { public void run() { int x = 200; @@ -208,9 +220,14 @@ public class AppliedStereotypeCommentCreationEditPolicy extends AppliedStereotyp }); } + /** + * method in oder to delete the comment + * @param domain the transactional editing domain + * @param commentNode the view that represent the comment of stereotype + */ protected void executeAppliedStereotypeCommentDeletion(final TransactionalEditingDomain domain, final View commentNode) { - Display.getCurrent().asyncExec(new Runnable() { + Display.getCurrent().syncExec(new Runnable() { public void run() { //because it is asynchrone the comment node maybe become s null diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/src/org/eclipse/papyrus/uml/diagram/stereotype/edition/editpolicies/AppliedStereotypeCompartmentEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/src/org/eclipse/papyrus/uml/diagram/stereotype/edition/editpolicies/AppliedStereotypeCompartmentEditPolicy.java index 687b056b8a4..c53aa2a17fc 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/src/org/eclipse/papyrus/uml/diagram/stereotype/edition/editpolicies/AppliedStereotypeCompartmentEditPolicy.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/src/org/eclipse/papyrus/uml/diagram/stereotype/edition/editpolicies/AppliedStereotypeCompartmentEditPolicy.java @@ -73,7 +73,12 @@ public class AppliedStereotypeCompartmentEditPolicy extends AppliedStereotypeNod } } - +/** + * this method has in charge to calculate if a compartment must be displayed. + * To know that it computes if a property of stereotype is displayed into it. + * @param applicationOfStereotype the eobject that represent the stereotype application + * @return true if the compartment display a property of sterotype + */ protected boolean hasToDisplayCompartment(EObject applicationOfStereotype) { String stereotypesPropertiesToDisplay = AppliedStereotypeHelper.getAppliedStereotypesPropertiesToDisplay((View)getHost().getModel()); String stereotypesLocalizationToDisplay = AppliedStereotypeHelper.getAppliedStereotypesPropertiesLocalization((View)getHost().getModel()); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/src/org/eclipse/papyrus/uml/diagram/stereotype/edition/editpolicies/AppliedStereotypePropertiesEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/src/org/eclipse/papyrus/uml/diagram/stereotype/edition/editpolicies/AppliedStereotypePropertiesEditPolicy.java index 2f4a9ee2b7f..36205f6bf59 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/src/org/eclipse/papyrus/uml/diagram/stereotype/edition/editpolicies/AppliedStereotypePropertiesEditPolicy.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/src/org/eclipse/papyrus/uml/diagram/stereotype/edition/editpolicies/AppliedStereotypePropertiesEditPolicy.java @@ -93,7 +93,7 @@ public class AppliedStereotypePropertiesEditPolicy extends AppliedStereotypeNode editPart.getEditingDomain().runExclusive(new Runnable() { public void run() { - Display.getCurrent().asyncExec(new Runnable() { + Display.getCurrent().syncExec(new Runnable() { public void run() { @@ -181,7 +181,7 @@ public class AppliedStereotypePropertiesEditPolicy extends AppliedStereotypeNode editPart.getEditingDomain().runExclusive(new Runnable() { public void run() { - Display.getCurrent().asyncExec(new Runnable() { + Display.getCurrent().syncExec(new Runnable() { public void run() { editPart.getEditingDomain().getCommandStack().execute(command); @@ -227,7 +227,7 @@ public class AppliedStereotypePropertiesEditPolicy extends AppliedStereotypeNode editPart.getEditingDomain().runExclusive(new Runnable() { public void run() { - Display.getCurrent().asyncExec(new Runnable() { + Display.getCurrent().syncExec(new Runnable() { public void run() { DeleteCommand command = new DeleteCommand((View)getHost().getModel()); @@ -278,7 +278,7 @@ public class AppliedStereotypePropertiesEditPolicy extends AppliedStereotypeNode editPart.getEditingDomain().runExclusive(new Runnable() { public void run() { - Display.getCurrent().asyncExec(new Runnable() { + Display.getCurrent().syncExec(new Runnable() { public void run() { if(currentNode.eContainer() != null) { diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/src/org/eclipse/papyrus/uml/diagram/stereotype/edition/provider/CustomEditPolicyProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/src/org/eclipse/papyrus/uml/diagram/stereotype/edition/provider/CustomEditPolicyProvider.java index 779f327c1ee..e2f694e86d7 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/src/org/eclipse/papyrus/uml/diagram/stereotype/edition/provider/CustomEditPolicyProvider.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/src/org/eclipse/papyrus/uml/diagram/stereotype/edition/provider/CustomEditPolicyProvider.java @@ -24,6 +24,7 @@ import org.eclipse.gmf.runtime.diagram.ui.services.editpolicy.IEditPolicyProvide import org.eclipse.papyrus.infra.gmfdiag.common.editpart.IPapyrusEditPart; import org.eclipse.papyrus.uml.diagram.common.editparts.NamedElementEditPart; import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy; +import org.eclipse.papyrus.uml.diagram.common.editpolicies.ApplyStereotypeEditPolicy; import org.eclipse.papyrus.uml.diagram.stereotype.edition.editpart.AppliedStereotypeMultilinePropertyEditPart; import org.eclipse.papyrus.uml.diagram.stereotype.edition.editpolicies.AppliedStereotypeCommentCreationEditPolicy; import org.eclipse.papyrus.uml.diagram.stereotype.edition.editpolicies.AppliedStereotypeCompartmentEditPolicy; @@ -36,7 +37,6 @@ import org.eclipse.papyrus.uml.tools.utils.UMLUtil; */ public class CustomEditPolicyProvider extends AbstractProvider implements IEditPolicyProvider { - /** * * {@inheritDoc} -- cgit v1.2.3