Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCéline Janssens2015-04-02 15:48:20 +0000
committerCéline Janssens2015-05-06 13:41:52 +0000
commit6cf730c33da825452060cbc50a4cddeb35905c2e (patch)
treebbe9d4369ad05101d14053a7e797f0e723f075b7 /plugins/infra/gmfdiag
parentf57dace5ab8472395bac57ebe43f7175c947374f (diff)
downloadorg.eclipse.papyrus-6cf730c33da825452060cbc50a4cddeb35905c2e.tar.gz
org.eclipse.papyrus-6cf730c33da825452060cbc50a4cddeb35905c2e.tar.xz
org.eclipse.papyrus-6cf730c33da825452060cbc50a4cddeb35905c2e.zip
Bug 463605: [Stereotype Display] Objective 5: Create the Graphical
Interface to display Labels and Properties to override the CSS. https://bugs.eclipse.org/bugs/show_bug.cgi?id=463605 - Connect the Property View Appearance to the New Stereotype Structure - Hide/Show Label - Hide/Show properties into Compartment - Fix Icon display of Stereotype - Fix Persitency on the modified Child only - Fix the deletion of the Comment node if not displayed while removing the reference. - Fix issues with Comment when closing and reopening the diagram (The comment is not deleted anymore) - Change "AppliedStereotypeCommentCreationEditPolicy" Name - NOT WORKING: Hide/Show in Comment with property View - NOT WORKING: Hide/Show in Brace with property View - NOT WORKING: Display Shape Change-Id: Ib566d6ab915c505765ce0c36eff047d1c79b1286 Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=462359 Signed-off-by: Céline Janssens <Celine.Janssens@all4tec.net> Reviewed-on: https://git.eclipse.org/r/45228 Tested-by: Hudson CI Reviewed-by: Gabriel Pascual <gabriel.pascual@all4tec.net> Reviewed-by: Mickael ADAM <mickael.adam@all4tec.net>
Diffstat (limited to 'plugins/infra/gmfdiag')
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/command/ResetStyleCommand.java64
1 files changed, 63 insertions, 1 deletions
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/command/ResetStyleCommand.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/command/ResetStyleCommand.java
index 6c84c486bdc..d86203d2122 100644
--- a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/command/ResetStyleCommand.java
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/command/ResetStyleCommand.java
@@ -8,6 +8,7 @@
*
* Contributors:
* Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ * Celine Janssens (ALL4TEC) celine.janssens@all4tec.net - Bug 455311
*****************************************************************************/
package org.eclipse.papyrus.infra.gmfdiag.css.command;
@@ -28,6 +29,8 @@ import org.eclipse.papyrus.infra.emf.appearance.helper.VisualInformationPapyrusC
import org.eclipse.papyrus.infra.gmfdiag.common.helper.NotationHelper;
import org.eclipse.papyrus.infra.gmfdiag.css.notation.CSSAnnotations;
import org.eclipse.papyrus.infra.gmfdiag.css.notation.CSSStyles;
+import org.eclipse.papyrus.uml.diagram.common.stereotype.StereotypeDisplayHelper;
+import org.eclipse.papyrus.uml.diagram.common.stereotype.StereotypeDisplayUtils;
public class ResetStyleCommand extends RecordingCommand {
@@ -39,12 +42,22 @@ public class ResetStyleCommand extends RecordingCommand {
papyrusStyleAnnotations.add(VisualInformationPapyrusConstants.SHADOWFIGURE);
papyrusStyleAnnotations.add(VisualInformationPapyrusConstants.QUALIFIED_NAME);
papyrusStyleAnnotations.add(VisualInformationPapyrusConstants.CUSTOM_APPEARENCE_ANNOTATION);
+ papyrusStyleAnnotations.add(StereotypeDisplayUtils.STEREOTYPE_LABEL_DEPTH);
}
private Iterator<?> iterator;
-
+ private TransactionalEditingDomain domain;
+
+ /**
+ *
+ * Constructor.
+ *
+ * @param domain
+ * @param iterator
+ */
public ResetStyleCommand(TransactionalEditingDomain domain, Iterator<?> iterator) {
super(domain);
+ this.domain = domain;
this.iterator = iterator;
}
@@ -67,6 +80,11 @@ public class ResetStyleCommand extends RecordingCommand {
}
}
+ /**
+ * Reset the diagram
+ *
+ * @param diagram
+ */
private void resetDiagram(Diagram diagram) {
for (Object viewObject : diagram.getChildren()) {
if (viewObject instanceof View) {
@@ -80,6 +98,15 @@ public class ResetStyleCommand extends RecordingCommand {
}
}
+
+ /**
+ * Reset a Style and its children
+ *
+ * @param view
+ * the view of which the style should be reset
+ * @param recursive
+ * true if the children should be reset as well
+ */
private void resetStyle(View view, boolean recursive) {
resetStyle(view);
if (recursive) {
@@ -91,12 +118,22 @@ public class ResetStyleCommand extends RecordingCommand {
}
}
+ /**
+ * Reset the style of a view.
+ * Delete all the custom NamedStyle
+ * Reset EAnnotation
+ * Reset Stereotype Styles
+ *
+ * @param view
+ * the view to be reset
+ */
private void resetStyle(View view) {
// Reset the view (Except for volatile/transient elements which are already derived, e.g. Stereotype compartments)
if (view.eContainingFeature().isTransient()) {
return;
}
+ // remove all the named Style of the view.
Iterator<?> styleIterator = view.getStyles().iterator();
while (styleIterator.hasNext()) {
Object styleObject = styleIterator.next();
@@ -132,10 +169,35 @@ public class ResetStyleCommand extends RecordingCommand {
// Remove the Papyrus Style EAnnotations
resetStyleAnnotations(view);
+ // Reset Stereotype Persistency
+ resetStereotypeView(view);
+
// Reset the visibility
view.eUnset(NotationPackage.eINSTANCE.getView_Visible());
}
+ /**
+ * This method reset the style of the Stereotype Node
+ *
+ * @param view
+ * Stereotype View
+ */
+ private void resetStereotypeView(final View view) {
+ StereotypeDisplayHelper helper = StereotypeDisplayHelper.getInstance();
+
+ if (helper.isStereotypeView(view)) {
+ helper.unsetPersistency(domain, view);
+
+ }
+
+ }
+
+ /**
+ * Reset a Style .
+ *
+ * @param style
+ * the Style to reset.
+ */
private void resetStyle(Style style) {
if (style instanceof NamedStyle) {
// Skip custom styles.

Back to the top