diff options
Diffstat (limited to 'plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AppliedStereotypeExternalNodeEditPolicy.java')
-rw-r--r-- | plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AppliedStereotypeExternalNodeEditPolicy.java | 43 |
1 files changed, 7 insertions, 36 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AppliedStereotypeExternalNodeEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AppliedStereotypeExternalNodeEditPolicy.java index 78389326dec..450d8e9b934 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AppliedStereotypeExternalNodeEditPolicy.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AppliedStereotypeExternalNodeEditPolicy.java @@ -19,8 +19,8 @@ import org.eclipse.gmf.runtime.notation.View; import org.eclipse.papyrus.infra.gmfdiag.common.editpart.IPapyrusEditPart; import org.eclipse.papyrus.uml.appearance.helper.AppliedStereotypeHelper; import org.eclipse.papyrus.uml.appearance.helper.UMLVisualInformationPapyrusConstant; -import org.eclipse.papyrus.uml.diagram.common.Activator; import org.eclipse.papyrus.uml.diagram.common.figure.node.IPapyrusUMLElementFigure; +import org.eclipse.papyrus.uml.diagram.common.stereotype.StereotypeDisplayHelper; import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; /** @@ -74,7 +74,7 @@ public class AppliedStereotypeExternalNodeEditPolicy extends AppliedStereotypeLa } /** - * + * Retrieve the List of the Stereotypes to Display * * @return the list of stereotypes to display with properties if there are * selected to be displayed @@ -89,46 +89,18 @@ public class AppliedStereotypeExternalNodeEditPolicy extends AppliedStereotypeLa } // try to display stereotype properties - String stereotypespresentationLocation = AppliedStereotypeHelper.getAppliedStereotypesPropertiesLocalization(parentView); String stereotypesPropertiesToDisplay = AppliedStereotypeHelper.getAppliedStereotypesPropertiesToDisplay(parentView); - String stereotypesToDisplay = AppliedStereotypeHelper.getStereotypesToDisplay(parentView); + String stereotypesToDisplay = StereotypeDisplayHelper.getStereotypeTextToDisplay(parentView); String stereotypespresentationKind = AppliedStereotypeHelper.getAppliedStereotypePresentationKind(parentView); - // now check presentation. - // if horizontal => equivalent to the inBrace visualization in nodes - // (i.e. only name = - // value, separator = comma, delimited with brace - // if vertical => equivalent to compartment visualization name of - // stereotype, NL, property = - // value, NL, etC. - // check the presentation kind. if only icon => do not display // stereotype, only values if (UMLVisualInformationPapyrusConstant.ICON_STEREOTYPE_PRESENTATION.equals(stereotypespresentationKind)) { return StereotypeUtil.getPropertiesValuesInBrace(stereotypesPropertiesToDisplay, getUMLElement()); } - String display = ""; - if (UMLVisualInformationPapyrusConstant.STEREOTYPE_BRACE_LOCATION.equals(stereotypespresentationLocation)) { - String stereotypesToDisplayWithQN = AppliedStereotypeHelper.getStereotypesQNToDisplay(parentView); - - if (UMLVisualInformationPapyrusConstant.STEREOTYPE_TEXT_VERTICAL_PRESENTATION.equals(stereotypespresentationKind)) { - display += stereotypesAndPropertiesToDisplay("\n", stereotypesToDisplay, stereotypesToDisplayWithQN, stereotypesPropertiesToDisplay); - } else { - final String st = stereotypesToDisplay(", ", stereotypesToDisplay, stereotypesToDisplayWithQN); - if (st != null && !st.equals("")) { - display += Activator.ST_LEFT + st + Activator.ST_RIGHT; - } - final String propSt = StereotypeUtil.getPropertiesValuesInBrace(stereotypesPropertiesToDisplay, getUMLElement()); - if (propSt != null && !propSt.equals("")) { - if (st != null && !st.equals("")) { - display += "\n"; - } - display += "{" + propSt + "}"; - } - } - } - return display; + + return stereotypesToDisplay; } /** @@ -141,10 +113,9 @@ public class AppliedStereotypeExternalNodeEditPolicy extends AppliedStereotypeLa IFigure figure = ((IPapyrusEditPart) getHost()).getPrimaryShape(); if (figure instanceof IPapyrusUMLElementFigure) {// calculate text - // and icon to - // display + // and icon to display final String stereotypesToDisplay = stereotypesToDisplay(); - ((IPapyrusUMLElementFigure) figure).setStereotypeDisplay(tag + (stereotypesToDisplay), null); + ((IPapyrusUMLElementFigure) figure).setStereotypeDisplay(tag + (stereotypesToDisplay == null ? "" : stereotypesToDisplay), null); } } |