Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorptessier2013-10-29 10:12:02 -0400
committerptessier2013-10-29 10:12:02 -0400
commitb9cb46b26632af8de05b70e41decc6f39a016264 (patch)
treea2996d7e67de48a8f3cda991e8df2a4e03f90e74 /plugins
parent5ff6388e586f3fe2957bd2abeda53d01d9181912 (diff)
downloadorg.eclipse.papyrus-b9cb46b26632af8de05b70e41decc6f39a016264.tar.gz
org.eclipse.papyrus-b9cb46b26632af8de05b70e41decc6f39a016264.tar.xz
org.eclipse.papyrus-b9cb46b26632af8de05b70e41decc6f39a016264.zip
419965: Display of the name must be optional
https://bugs.eclipse.org/bugs/show_bug.cgi?id=419965
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.java28
1 files changed, 18 insertions, 10 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 305dc4da1f1..f9c16e55e98 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
@@ -184,10 +184,12 @@ public class NodeNamedElementFigure extends PapyrusNodeFigure implements IPapyru
}
}
-
+
public void restoreStereotypeLabel() {
- stereotypesLabel.setOpaque(false);
- getStereotypeLabelContainer().add(stereotypesLabel, getStereotypeLabelConstraint(), getStereotypePropertiesLabelPosition());
+ if(stereotypesLabel!=null){
+ stereotypesLabel.setOpaque(false);
+ getStereotypeLabelContainer().add(stereotypesLabel, getStereotypeLabelConstraint(), getStereotypePropertiesLabelPosition());
+ }
}
@@ -195,15 +197,19 @@ public class NodeNamedElementFigure extends PapyrusNodeFigure implements IPapyru
* Create a label that contains the stereotype of the element.
*/
public void removeStereotypeLabel() {
- if(getStereotypeLabelContainer().getChildren().contains(stereotypesLabel)) {
- getStereotypeLabelContainer().remove(stereotypesLabel);
+ if(stereotypesLabel!=null){
+ if(getStereotypeLabelContainer().getChildren().contains(stereotypesLabel)) {
+ getStereotypeLabelContainer().remove(stereotypesLabel);
+ }
}
}
-
+
public void restoreTaggedLabel() {
- taggedLabel.setOpaque(false);
- getTagLabelContainer().add(taggedLabel, getTagLabelConstraint(), 0);
+ if(taggedLabel!=null){
+ taggedLabel.setOpaque(false);
+ getTagLabelContainer().add(taggedLabel, getTagLabelConstraint(), 0);
+ }
}
@@ -211,8 +217,10 @@ public class NodeNamedElementFigure extends PapyrusNodeFigure implements IPapyru
* Create a label that contains the stereotype of the element.
*/
public void removeTaggedLabel() {
- if(getTagLabelContainer().getChildren().contains(taggedLabel)) {
- getTagLabelContainer().remove(taggedLabel);
+ if(taggedLabel!=null){
+ if(getTagLabelContainer().getChildren().contains(taggedLabel)) {
+ getTagLabelContainer().remove(taggedLabel);
+ }
}
}
/**

Back to the top