Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorptessier2014-04-03 09:26:16 -0400
committerptessier2014-04-03 09:26:16 -0400
commit0055a29b2a603c54f63a90de39cae25bf5c62c50 (patch)
tree7b90885bafaf9b464b64670d504cb5a8cedb7c5f /plugins
parent87c507d0c86292bbcda7dc79f58dc9ba56244bc8 (diff)
downloadorg.eclipse.papyrus-0055a29b2a603c54f63a90de39cae25bf5c62c50.tar.gz
org.eclipse.papyrus-0055a29b2a603c54f63a90de39cae25bf5c62c50.tar.xz
org.eclipse.papyrus-0055a29b2a603c54f63a90de39cae25bf5c62c50.zip
431216: [All Diagrams] Layout issues in Compartments
https://bugs.eclipse.org/bugs/show_bug.cgi?id=431216
Diffstat (limited to 'plugins')
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/NodeNamedElementFigure.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotype.edition/src/org/eclipse/papyrus/uml/diagram/stereotype/edition/editpolicies/AppliedStereotypeCommentCreationEditPolicy.java14
2 files changed, 14 insertions, 2 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/NodeNamedElementFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/NodeNamedElementFigure.java
index f9c16e55e98..8273710d68b 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/NodeNamedElementFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/NodeNamedElementFigure.java
@@ -188,7 +188,7 @@ public class NodeNamedElementFigure extends PapyrusNodeFigure implements IPapyru
public void restoreStereotypeLabel() {
if(stereotypesLabel!=null){
stereotypesLabel.setOpaque(false);
- getStereotypeLabelContainer().add(stereotypesLabel, getStereotypeLabelConstraint(), getStereotypePropertiesLabelPosition());
+ getStereotypeLabelContainer().add(stereotypesLabel, getStereotypeLabelConstraint(), getStereotypeLabelPosition());
}
}
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 39d51b4fb27..718f5cd32f2 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
@@ -41,6 +41,7 @@ import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeNode
import org.eclipse.papyrus.uml.diagram.stereotype.edition.command.CreateAppliedStereotypeCommentViewCommand;
import org.eclipse.papyrus.uml.diagram.stereotype.edition.editpart.AppliedStereotypesCommentLinkEditPart;
import org.eclipse.papyrus.uml.tools.listeners.PapyrusStereotypeListener;
+import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil;
import org.eclipse.swt.widgets.Display;
/**
@@ -77,9 +78,20 @@ public class AppliedStereotypeCommentCreationEditPolicy extends AppliedStereotyp
}
}
}
+
+ //test if the comment has to be removed
if(getAppliedStereotypeCommentNode() != null) {
View commentNode = getAppliedStereotypeCommentNode();
- if(!stereotypeLocalizationToDisplay.equals(UMLVisualInformationPapyrusConstant.STEREOTYPE_COMMENT_LOCATION) || getvisisbleAppliedStereotypeCompartment(commentNode, getUMLElement()) == 0) {
+
+ //1. the display is not comment
+ if(!stereotypeLocalizationToDisplay.equals(UMLVisualInformationPapyrusConstant.STEREOTYPE_COMMENT_LOCATION) ) {
+ final TransactionalEditingDomain domain = TransactionUtil.getEditingDomain(commentNode);
+ executeAppliedStereotypeCommentDeletion(domain, commentNode);
+ }
+
+ //the result of properties to display is null so no compartment will be created
+ String todisplay = StereotypeUtil.getPropertiesValues(stereotypePropertiesToDisplay, getUMLElement());
+ if("".equals(todisplay.trim())) {
final TransactionalEditingDomain domain = TransactionUtil.getEditingDomain(commentNode);
executeAppliedStereotypeCommentDeletion(domain, commentNode);
}

Back to the top