respecting l10n, when displaying stereotypes
diff --git a/plugins/org.eclipse.uml2.diagram.common/META-INF/MANIFEST.MF b/plugins/org.eclipse.uml2.diagram.common/META-INF/MANIFEST.MF
index 3356c4f..308326d 100644
--- a/plugins/org.eclipse.uml2.diagram.common/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.uml2.diagram.common/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.uml2.diagram.common;singleton:=true
-Bundle-Version: 0.9.2.qualifier
+Bundle-Version: 0.10.0.qualifier
Bundle-Localization: plugin
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.uml2.uml;bundle-version="3.1.1";visibility:=reexport,
diff --git a/plugins/org.eclipse.uml2.diagram.common/src/org/eclipse/uml2/diagram/common/parser/stereotype/AppliedStereotypeParser.java b/plugins/org.eclipse.uml2.diagram.common/src/org/eclipse/uml2/diagram/common/parser/stereotype/AppliedStereotypeParser.java
index 2f41509..536f35e 100644
--- a/plugins/org.eclipse.uml2.diagram.common/src/org/eclipse/uml2/diagram/common/parser/stereotype/AppliedStereotypeParser.java
+++ b/plugins/org.eclipse.uml2.diagram.common/src/org/eclipse/uml2/diagram/common/parser/stereotype/AppliedStereotypeParser.java
@@ -64,6 +64,12 @@
public IContentAssistProcessor getCompletionProcessor(IAdaptable subject) {
return null;
}
+
+ public ICommand getParseCommand(IAdaptable element, String newString, int flags) {
+ Element subject = doAdapt(element);
+ List<String> toApply = getStereotypesToApply(newString);
+ return ApplyStereotypeHelper.getCommand(subject, toApply);
+ }
public String getEditString(IAdaptable element, int flags) {
Element subject = doAdapt(element);
@@ -80,24 +86,34 @@
}
return result.toString();
}
-
- public ICommand getParseCommand(IAdaptable element, String newString, int flags) {
- Element subject = doAdapt(element);
- List<String> toApply = getStereotypesToApply(newString);
- return ApplyStereotypeHelper.getCommand(subject, toApply);
- }
-
+
public String getPrintString(IAdaptable element, int flags) {
String classifier = getElementLabel(doAdapt(element));
- String editString = getEditString(element, flags);
+ String labelString = this.getLabelString(element, flags);
if (classifier != null) {
String result = classifier;
- if (editString != null && editString.length() > 0) {
- result += STEREOTYPE_SEPARATOR + StringStatics.SPACE + editString;
+ if (labelString != null && labelString.length() > 0) {
+ result += STEREOTYPE_SEPARATOR + StringStatics.SPACE + labelString;
}
return NLS.bind(APPLIED_PROFILE, new Object[] { result });
}
- return editString == null || editString.length() == 0 ? editString : NLS.bind(APPLIED_PROFILE, new Object[] { editString });
+ return labelString == null || labelString.length() == 0 ? labelString : NLS.bind(APPLIED_PROFILE, new Object[] { labelString });
+ }
+
+ private String getLabelString(IAdaptable element, int flags) {
+ Element subject = doAdapt(element);
+ List<Stereotype> stereos = subject.getAppliedStereotypes();
+ if (stereos.isEmpty()) {
+ return ""; //$NON-NLS-1$
+ }
+ StringBuffer result = new StringBuffer();
+ for (Stereotype next : stereos) {
+ if (result.length() > 0) {
+ result.append(STEREOTYPE_SEPARATOR + " "); //$NON-NLS-1$
+ }
+ result.append(next.getLabel());
+ }
+ return result.toString();
}
public boolean isAffectingEvent(Object event, int flags) {