Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas FAUVERGUE2016-11-24 07:49:41 -0500
committervincent lorenzo2016-11-29 06:01:26 -0500
commit3ed639ecef256da3eeff86d3b428720561f362df (patch)
treeea5d0d552c2e0b62cd9ee3cafd907ee69c0ad2e8 /plugins/sysml
parentb3141df23ca644573f8b2813ad8859722d418bd9 (diff)
downloadorg.eclipse.papyrus-3ed639ecef256da3eeff86d3b428720561f362df.tar.gz
org.eclipse.papyrus-3ed639ecef256da3eeff86d3b428720561f362df.tar.xz
org.eclipse.papyrus-3ed639ecef256da3eeff86d3b428720561f362df.zip
Bug 496905: [Diagram][ModelExplorer][Table][Dialog] Papyrus must integrate
the internationalization feature provided by UML. https://bugs.eclipse.org/bugs/show_bug.cgi?id=496905 Commit of UML for internationalization. Change-Id: Ia61e5ef4d537f9e9b192bcfe073f921542fe4876 Signed-off-by: Nicolas FAUVERGUE <nicolas.fauvergue@all4tec.net>
Diffstat (limited to 'plugins/sysml')
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition/META-INF/MANIFEST.MF3
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition/src-gen/org/eclipse/papyrus/sysml/diagram/blockdefinition/BlockDefinitionDiagramForMultiEditor.java4
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/META-INF/MANIFEST.MF4
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/parser/FlowPortLabelParser.java13
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/parser/RequirementLabelParser.java7
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/parser/UnitLabelParser.java9
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/AssociationEndLabelParser.java13
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/ConnectorLabelParser.java9
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/ConstraintLabelParser.java23
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/NamedElementLabelParser.java19
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/OperationLabelParser.java9
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/PropertyLabelParser.java13
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/ReceptionLabelParser.java9
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/utils/ParameterLabelUtil.java271
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src/org/eclipse/papyrus/sysml/diagram/common/Activator.java8
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock/META-INF/MANIFEST.MF3
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock/src-gen/org/eclipse/papyrus/sysml/diagram/internalblock/InternalBlockDiagramForMultiEditor.java4
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/META-INF/MANIFEST.MF3
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/ParametricDiagramForMultiEditor.java4
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/part/CustomBlockLabelNameEditPart.java6
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement/META-INF/MANIFEST.MF4
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement/src-gen/org/eclipse/papyrus/sysml/diagram/requirement/RequirementDiagramForMultiEditor.java4
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement/src/org/eclipse/papyrus/sysml/diagram/requirement/edit/part/CustomRequirementEditPart.java174
-rw-r--r--plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/META-INF/MANIFEST.MF3
-rw-r--r--plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/src/org/eclipse/papyrus/sysml/modelexplorer/query/GetLabelQuery.java4
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.edit/META-INF/MANIFEST.MF3
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.edit/src/org/eclipse/papyrus/sysml/registry/SysmlRegistryAdapterFactoryRegistry.java865
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.service.types/META-INF/MANIFEST.MF3
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/utils/ConnectorUtils.java7
29 files changed, 777 insertions, 724 deletions
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition/META-INF/MANIFEST.MF b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition/META-INF/MANIFEST.MF
index 033455f8e12..cfcdd23cfde 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition/META-INF/MANIFEST.MF
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition/META-INF/MANIFEST.MF
@@ -16,7 +16,8 @@ Require-Bundle: org.eclipse.papyrus.uml.diagram.clazz;bundle-version="[3.0.0,4.0
org.eclipse.gmf.runtime.diagram.ui.providers;bundle-version="[1.7.0,2.0.0)",
org.eclipse.papyrus.sysml.diagram.common;bundle-version="[2.0.0,3.0.0)";visibility:=reexport,
org.eclipse.papyrus.sysml.service.types;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.papyrus.infra.gmfdiag.navigation;bundle-version="[2.0.0,3.0.0)"
+ org.eclipse.papyrus.infra.gmfdiag.navigation;bundle-version="[2.0.0,3.0.0)",
+ org.eclipse.papyrus.infra.internationalization.utils;bundle-version="[1.0.0,2.0.0)"
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
Bundle-Version: 3.0.0.qualifier
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition/src-gen/org/eclipse/papyrus/sysml/diagram/blockdefinition/BlockDefinitionDiagramForMultiEditor.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition/src-gen/org/eclipse/papyrus/sysml/diagram/blockdefinition/BlockDefinitionDiagramForMultiEditor.java
index 103bd30d935..a5c21be0d38 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition/src-gen/org/eclipse/papyrus/sysml/diagram/blockdefinition/BlockDefinitionDiagramForMultiEditor.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition/src-gen/org/eclipse/papyrus/sysml/diagram/blockdefinition/BlockDefinitionDiagramForMultiEditor.java
@@ -10,6 +10,7 @@
*
* CEA LIST - Initial API and implementation
* Christian W. Damus (CEA) - bug 392301
+ * Nicolas FAUVERGUE (ALL4TEC) nicolas.fauvergue@all4tec.net - Bug 496905
*
*****************************************************************************/
package org.eclipse.papyrus.sysml.diagram.blockdefinition;
@@ -23,6 +24,7 @@ import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.papyrus.infra.core.editor.BackboneException;
import org.eclipse.papyrus.infra.core.services.ServiceException;
import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
+import org.eclipse.papyrus.infra.internationalization.utils.utils.LabelInternationalization;
import org.eclipse.papyrus.sysml.diagram.blockdefinition.part.BlockDefinitionDiagramEditor;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Composite;
@@ -70,7 +72,7 @@ public class BlockDefinitionDiagramForMultiEditor extends BlockDefinitionDiagram
@Override
public void init(IEditorSite site, IEditorInput input) throws PartInitException {
super.init(site, input);
- setPartName(getDiagram().getName());
+ setPartName(LabelInternationalization.getInstance().getDiagramLabel(getDiagram()));
titleImage = DIAG_IMG_DESC.createImage();
setTitleImage(titleImage);
}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/META-INF/MANIFEST.MF b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/META-INF/MANIFEST.MF
index 1783a3e4258..20ca98c4fc9 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/META-INF/MANIFEST.MF
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/META-INF/MANIFEST.MF
@@ -33,7 +33,9 @@ Require-Bundle: org.eclipse.emf;bundle-version="[2.6.0,3.0.0)",
org.eclipse.papyrus.infra.widgets.toolbox;bundle-version="[1.2.0,2.0.0)";visibility:=reexport,
org.eclipse.papyrus.uml.modelexplorer.widgets;bundle-version="[2.0.0,3.0.0)",
org.eclipse.papyrus.uml.diagram.composite;bundle-version="[3.0.0,4.0.0)";visibility:=reexport,
- org.eclipse.papyrus.uml.diagram.clazz;bundle-version="[3.0.0,4.0.0)"
+ org.eclipse.papyrus.uml.diagram.clazz;bundle-version="[3.0.0,4.0.0)",
+ org.eclipse.papyrus.uml.internationalization.edit;bundle-version="[1.0.0,2.0.0)",
+ org.eclipse.papyrus.uml.internationalization.utils;bundle-version="[1.0.0,2.0.0)"
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
Bundle-Version: 2.0.0.qualifier
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/parser/FlowPortLabelParser.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/parser/FlowPortLabelParser.java
index 4fef645ef06..f332eb80329 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/parser/FlowPortLabelParser.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/parser/FlowPortLabelParser.java
@@ -7,8 +7,8 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- *
- * CEA LIST - Initial API and implementation
+ * CEA LIST - Initial API and implementation
+ * Nicolas FAUVERGUE (ALL4TEC) nicolas.fauvergue@all4tec.net - Bug 496905
*
*****************************************************************************/
package org.eclipse.papyrus.sysml.diagram.common.parser;
@@ -32,6 +32,7 @@ import org.eclipse.papyrus.sysml.portandflows.FlowPort;
import org.eclipse.papyrus.sysml.portandflows.FlowSpecification;
import org.eclipse.papyrus.sysml.portandflows.PortandflowsPackage;
import org.eclipse.papyrus.uml.diagram.common.parser.PropertyLabelParser;
+import org.eclipse.papyrus.uml.internationalization.utils.utils.UMLLabelInternationalization;
import org.eclipse.papyrus.uml.tools.utils.ICustomAppearance;
import org.eclipse.papyrus.uml.tools.utils.ValueSpecificationUtil;
import org.eclipse.uml2.uml.InstanceValue;
@@ -129,7 +130,7 @@ public class FlowPortLabelParser extends PropertyLabelParser {
// manage name
if ((maskValues.contains(ICustomAppearance.DISP_NAME)) && (property.isSetName())) {
- String name = property.getName();
+ String name = UMLLabelInternationalization.getInstance().getLabel(property);
result = String.format(NAME_FORMAT, result, name);
}
@@ -138,7 +139,7 @@ public class FlowPortLabelParser extends PropertyLabelParser {
String type = "<Undefined>";
if (property.getType() != null) {
- type = property.getType().getName();
+ type = UMLLabelInternationalization.getInstance().getLabel(property.getType());
}
// If type is undefined only show "<Undefined>" when explicitly asked.
@@ -164,7 +165,7 @@ public class FlowPortLabelParser extends PropertyLabelParser {
if ((maskValues.contains(ICustomAppearance.DISP_DEFAULT_VALUE)) && ((property.getDefaultValue() != null))) {
ValueSpecification valueSpecification = property.getDefaultValue();
if (valueSpecification instanceof InstanceValue) {
- result = String.format(DEFAULT_VALUE_FORMAT, result, ValueSpecificationUtil.getSpecificationValue(valueSpecification));
+ result = String.format(DEFAULT_VALUE_FORMAT, result, ValueSpecificationUtil.getSpecificationValue(valueSpecification, true));
}
}
@@ -186,7 +187,7 @@ public class FlowPortLabelParser extends PropertyLabelParser {
EList<Property> redefinedProperties = property.getRedefinedProperties();
if (redefinedProperties != null && !redefinedProperties.isEmpty()) {
for (Property p : redefinedProperties) {
- sb.append(sb.length() == 0 ? p.getName() : ", redefines " + p.getName());
+ sb.append(sb.length() == 0 ? UMLLabelInternationalization.getInstance().getLabel(p) : ", redefines " + UMLLabelInternationalization.getInstance().getLabel(p));
}
}
if (sb.length() != 0) {
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/parser/RequirementLabelParser.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/parser/RequirementLabelParser.java
index 548984a5c1f..c7984cb850b 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/parser/RequirementLabelParser.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/parser/RequirementLabelParser.java
@@ -7,8 +7,8 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- *
- * CEA LIST - Initial API and implementation
+ * CEA LIST - Initial API and implementation
+ * Nicolas FAUVERGUE (ALL4TEC) nicolas.fauvergue@all4tec.net - Bug 496905
*
*****************************************************************************/
package org.eclipse.papyrus.sysml.diagram.common.parser;
@@ -26,6 +26,7 @@ import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
import org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants;
import org.eclipse.papyrus.sysml.requirements.Requirement;
import org.eclipse.papyrus.uml.diagram.common.parser.NamedElementLabelParser;
+import org.eclipse.papyrus.uml.internationalization.utils.utils.UMLLabelInternationalization;
import org.eclipse.papyrus.uml.tools.utils.ICustomAppearance;
import org.eclipse.uml2.uml.Class;
import org.eclipse.uml2.uml.util.UMLUtil;
@@ -63,7 +64,7 @@ public class RequirementLabelParser extends NamedElementLabelParser {
// manage name
if (maskValues.contains(ICustomAppearance.DISP_NAME)) {
- String name = clazz.getName();
+ String name = UMLLabelInternationalization.getInstance().getLabel(clazz);
result = String.format(NAME_FORMAT, name);
}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/parser/UnitLabelParser.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/parser/UnitLabelParser.java
index 041a725ad39..10242f87699 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/parser/UnitLabelParser.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/parser/UnitLabelParser.java
@@ -7,8 +7,8 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- *
- * CEA LIST - Initial API and implementation
+ * CEA LIST - Initial API and implementation
+ * Nicolas FAUVERGUE (ALL4TEC) nicolas.fauvergue@all4tec.net - Bug 496905
*
*****************************************************************************/
package org.eclipse.papyrus.sysml.diagram.common.parser;
@@ -30,6 +30,7 @@ import org.eclipse.papyrus.sysml.blocks.Dimension;
import org.eclipse.papyrus.sysml.blocks.Unit;
import org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants;
import org.eclipse.papyrus.uml.diagram.common.parser.NamedElementLabelParser;
+import org.eclipse.papyrus.uml.internationalization.utils.utils.UMLLabelInternationalization;
import org.eclipse.papyrus.uml.tools.utils.ICustomAppearance;
import org.eclipse.uml2.uml.InstanceSpecification;
import org.eclipse.uml2.uml.util.UMLUtil;
@@ -68,7 +69,7 @@ public class UnitLabelParser extends NamedElementLabelParser {
// manage name
if ((maskValues.contains(ICustomAppearance.DISP_NAME)) && (iSpec.isSetName())) {
- String name = iSpec.getName();
+ String name = UMLLabelInternationalization.getInstance().getLabel(iSpec);
result = String.format(NAME_FORMAT, name);
}
@@ -78,7 +79,7 @@ public class UnitLabelParser extends NamedElementLabelParser {
if ((unit != null) && (unit.getDimension() != null)) {
Dimension dim = unit.getDimension();
if ((dim.getBase_InstanceSpecification() != null) && (dim.getBase_InstanceSpecification().isSetName())) {
- dimensionName = dim.getBase_InstanceSpecification().getName();
+ dimensionName = UMLLabelInternationalization.getInstance().getLabel(dim.getBase_InstanceSpecification());
}
}
result = String.format(DIMENSION_FORMAT, result, dimensionName);
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/AssociationEndLabelParser.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/AssociationEndLabelParser.java
index ac2699f927b..9cb1c33b8fd 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/AssociationEndLabelParser.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/AssociationEndLabelParser.java
@@ -7,8 +7,8 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- *
- * CEA LIST - Initial API and implementation
+ * CEA LIST - Initial API and implementation
+ * Nicolas FAUVERGUE (ALL4TEC) nicolas.fauvergue@all4tec.net - Bug 496905
*
*****************************************************************************/
package org.eclipse.papyrus.uml.diagram.common.parser;
@@ -24,6 +24,7 @@ import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
import org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants;
import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLMultiplicityElementUtil;
+import org.eclipse.papyrus.uml.internationalization.utils.utils.UMLLabelInternationalization;
import org.eclipse.papyrus.uml.tools.utils.ICustomAppearance;
import org.eclipse.papyrus.uml.tools.utils.ValueSpecificationUtil;
import org.eclipse.uml2.uml.Association;
@@ -87,7 +88,7 @@ public class AssociationEndLabelParser extends PropertyLabelParser {
// manage name
if (maskValues.contains(ICustomAppearance.DISP_NAME) && property.isSetName()) {
- String name = property.getName();
+ String name = UMLLabelInternationalization.getInstance().getLabel(property);
// If property is owned by Association (non navigable) only show the name when explicitly asked.
@@ -101,7 +102,7 @@ public class AssociationEndLabelParser extends PropertyLabelParser {
if (maskValues.contains(ICustomAppearance.DISP_TYPE)) {
String type = "<Undefined>";
if (property.getType() != null) {
- type = property.getType().getName();
+ type = UMLLabelInternationalization.getInstance().getLabel(property.getType());
}
// If type is undefined only show "<Undefined>" when explicitly asked.
@@ -124,7 +125,7 @@ public class AssociationEndLabelParser extends PropertyLabelParser {
// manage default value
if (maskValues.contains(ICustomAppearance.DISP_DEFAULT_VALUE) && property.getDefaultValue() != null) {
ValueSpecification valueSpecification = property.getDefaultValue();
- result = String.format(DEFAULT_VALUE_FORMAT, result, ValueSpecificationUtil.getSpecificationValue(valueSpecification));
+ result = String.format(DEFAULT_VALUE_FORMAT, result, ValueSpecificationUtil.getSpecificationValue(valueSpecification, true));
}
// manage modifier
@@ -145,7 +146,7 @@ public class AssociationEndLabelParser extends PropertyLabelParser {
EList<Property> redefinedProperties = property.getRedefinedProperties();
if (redefinedProperties != null && !redefinedProperties.isEmpty()) {
for (Property p : redefinedProperties) {
- sb.append(sb.length() == 0 ? p.getName() : ", redefines " + p.getName());
+ sb.append(sb.length() == 0 ? UMLLabelInternationalization.getInstance().getLabel(p) : ", redefines " + UMLLabelInternationalization.getInstance().getLabel(p));
}
}
if (sb.length() != 0) {
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/ConnectorLabelParser.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/ConnectorLabelParser.java
index d8b67756741..dba310651f9 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/ConnectorLabelParser.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/ConnectorLabelParser.java
@@ -7,8 +7,8 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- *
- * CEA LIST - Initial API and implementation
+ * CEA LIST - Initial API and implementation
+ * Nicolas FAUVERGUE (ALL4TEC) nicolas.fauvergue@all4tec.net - Bug 496905
*
*****************************************************************************/
package org.eclipse.papyrus.uml.diagram.common.parser;
@@ -26,6 +26,7 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
import org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants;
+import org.eclipse.papyrus.uml.internationalization.utils.utils.UMLLabelInternationalization;
import org.eclipse.papyrus.uml.tools.utils.ICustomAppearance;
import org.eclipse.uml2.uml.Connector;
import org.eclipse.uml2.uml.UMLPackage;
@@ -62,7 +63,7 @@ public class ConnectorLabelParser extends NamedElementLabelParser {
// manage name
if (maskValues.contains(ICustomAppearance.DISP_NAME) && (connector.isSetName())) {
- String name = connector.getName();
+ String name = UMLLabelInternationalization.getInstance().getLabel(connector);
result = String.format(NAME_FORMAT, name);
}
@@ -70,7 +71,7 @@ public class ConnectorLabelParser extends NamedElementLabelParser {
if (maskValues.contains(ICustomAppearance.DISP_TYPE)) {
String type = "<Undefined>";
if (connector.getType() != null) {
- type = connector.getType().getName();
+ type = UMLLabelInternationalization.getInstance().getLabel(connector.getType());
}
// If type is undefined only show "<Undefined>" when explicitly asked.
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/ConstraintLabelParser.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/ConstraintLabelParser.java
index b6193fd946d..1dbfdd09dd4 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/ConstraintLabelParser.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/ConstraintLabelParser.java
@@ -7,8 +7,8 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- *
- * CEA LIST - Initial API and implementation
+ * CEA LIST - Initial API and implementation
+ * Nicolas FAUVERGUE (ALL4TEC) nicolas.fauvergue@all4tec.net - Bug 496905
*
*****************************************************************************/
package org.eclipse.papyrus.uml.diagram.common.parser;
@@ -28,11 +28,15 @@ import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.gmf.runtime.common.core.command.ICommand;
import org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand;
import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
+import org.eclipse.papyrus.infra.core.resource.ModelSet;
import org.eclipse.papyrus.infra.core.services.ServiceException;
+import org.eclipse.papyrus.infra.emf.gmf.command.EMFtoGMFCommandWrapper;
import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
+import org.eclipse.papyrus.infra.internationalization.common.utils.InternationalizationPreferencesUtils;
import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
import org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants;
import org.eclipse.papyrus.uml.diagram.common.Activator;
+import org.eclipse.papyrus.uml.internationalization.utils.utils.UMLLabelInternationalization;
import org.eclipse.papyrus.uml.tools.utils.ICustomAppearance;
import org.eclipse.papyrus.uml.tools.utils.ValueSpecificationUtil;
import org.eclipse.uml2.uml.Constraint;
@@ -71,7 +75,7 @@ public class ConstraintLabelParser extends NamedElementLabelParser {
// edit name
if ((maskValues.contains(ICustomAppearance.DISP_NAME))) {
if (semElement.isSetName()) {
- editString = semElement.getName();
+ editString = UMLLabelInternationalization.getInstance().getLabel(semElement);
}
// (try to) edit constraint specification
@@ -107,7 +111,7 @@ public class ConstraintLabelParser extends NamedElementLabelParser {
// manage name
if ((maskValues.contains(ICustomAppearance.DISP_NAME)) && (semElement.isSetName())) {
- String name = semElement.getName();
+ String name = UMLLabelInternationalization.getInstance().getLabel(semElement);
result = String.format(NAME_FORMAT, name);
}
@@ -115,7 +119,7 @@ public class ConstraintLabelParser extends NamedElementLabelParser {
if ((maskValues.contains(ILabelPreferenceConstants.DISP_SPECIFICATION))) {
String spec = "<Undefined>";
if (semElement.getSpecification() != null) {
- spec = ValueSpecificationUtil.getSpecificationValue(semElement.getSpecification());
+ spec = ValueSpecificationUtil.getSpecificationValue(semElement.getSpecification(), true);
if (spec == null || "".equals(spec)) {
spec = "<Undefined>";
}
@@ -144,8 +148,13 @@ public class ConstraintLabelParser extends NamedElementLabelParser {
// prepare set name request
if ((maskValues.contains(ICustomAppearance.DISP_NAME))) {
- updateRequest = new SetRequest(constraint, UMLPackage.eINSTANCE.getNamedElement_Name(), newString);
- updateRequest.setLabel("Update Constraint Label");
+ if(InternationalizationPreferencesUtils.getInternationalizationPreference(constraint) && null != UMLLabelInternationalization.getInstance().getLabelWithoutUML(constraint)){
+ final ModelSet modelSet = (ModelSet)constraint.eResource().getResourceSet();
+ command = new EMFtoGMFCommandWrapper(UMLLabelInternationalization.getInstance().getSetLabelCommand(modelSet.getTransactionalEditingDomain(), constraint, newString, null));
+ }else{
+ updateRequest = new SetRequest(constraint, UMLPackage.eINSTANCE.getNamedElement_Name(), newString);
+ updateRequest.setLabel("Update Constraint Label");
+ }
// prepare set specification request
} else if ((maskValues.contains(ILabelPreferenceConstants.DISP_SPECIFICATION))) {
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/NamedElementLabelParser.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/NamedElementLabelParser.java
index f35c93eef23..dd5db038963 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/NamedElementLabelParser.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/NamedElementLabelParser.java
@@ -7,8 +7,8 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- *
- * CEA LIST - Initial API and implementation
+ * CEA LIST - Initial API and implementation
+ * Nicolas FAUVERGUE (ALL4TEC) nicolas.fauvergue@all4tec.net - Bug 496905
*
*****************************************************************************/
package org.eclipse.papyrus.uml.diagram.common.parser;
@@ -31,11 +31,15 @@ import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.papyrus.infra.core.resource.ModelSet;
import org.eclipse.papyrus.infra.core.services.ServiceException;
+import org.eclipse.papyrus.infra.emf.gmf.command.EMFtoGMFCommandWrapper;
import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
import org.eclipse.papyrus.infra.gmfdiag.common.helper.MaskLabelHelper;
+import org.eclipse.papyrus.infra.internationalization.common.utils.InternationalizationPreferencesUtils;
import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
import org.eclipse.papyrus.uml.diagram.common.Activator;
+import org.eclipse.papyrus.uml.internationalization.utils.utils.UMLLabelInternationalization;
import org.eclipse.uml2.uml.NamedElement;
import org.eclipse.uml2.uml.UMLPackage;
@@ -55,7 +59,7 @@ public class NamedElementLabelParser implements IMaskManagedSemanticParser {
if ((eObject != null) && (eObject instanceof NamedElement)) {
NamedElement semElement = (NamedElement) eObject;
if (semElement.isSetName()) {
- editString = semElement.getName();
+ editString = UMLLabelInternationalization.getInstance().getLabel(semElement);
}
}
return editString;
@@ -83,7 +87,12 @@ public class NamedElementLabelParser implements IMaskManagedSemanticParser {
}
try {
- command = ElementEditServiceUtils.getEditServiceProvider().getEditService(objectToEdit).getEditCommand(new SetRequest(objectToEdit, UMLPackage.eINSTANCE.getNamedElement_Name(), newString));
+ if(InternationalizationPreferencesUtils.getInternationalizationPreference(objectToEdit) && null != UMLLabelInternationalization.getInstance().getLabelWithoutUML((NamedElement)objectToEdit)){
+ final ModelSet modelSet = (ModelSet)objectToEdit.eResource().getResourceSet();
+ command = new EMFtoGMFCommandWrapper(UMLLabelInternationalization.getInstance().getSetLabelCommand(modelSet.getTransactionalEditingDomain(), (NamedElement)objectToEdit, newString, null));
+ }else{
+ command = ElementEditServiceUtils.getEditServiceProvider().getEditService(objectToEdit).getEditCommand(new SetRequest(objectToEdit, UMLPackage.eINSTANCE.getNamedElement_Name(), newString));
+ }
} catch (ServiceException e) {
Activator.log.error(e);
}
@@ -100,7 +109,7 @@ public class NamedElementLabelParser implements IMaskManagedSemanticParser {
EObject eObject = EMFHelper.getEObject(element);
if (eObject instanceof NamedElement) {
- return ((NamedElement) eObject).getName();
+ return UMLLabelInternationalization.getInstance().getLabel((NamedElement) eObject);
}
return result;
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/OperationLabelParser.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/OperationLabelParser.java
index 1c8aa32e973..81ef14ccf77 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/OperationLabelParser.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/OperationLabelParser.java
@@ -7,8 +7,8 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- *
- * CEA LIST - Initial API and implementation
+ * CEA LIST - Initial API and implementation
+ * Nicolas FAUVERGUE (ALL4TEC) nicolas.fauvergue@all4tec.net - Bug 496905
*
*****************************************************************************/
package org.eclipse.papyrus.uml.diagram.common.parser;
@@ -30,6 +30,7 @@ import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
import org.eclipse.papyrus.infra.tools.util.StringHelper;
import org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants;
import org.eclipse.papyrus.uml.diagram.common.utils.ParameterLabelUtil;
+import org.eclipse.papyrus.uml.internationalization.utils.utils.UMLLabelInternationalization;
import org.eclipse.papyrus.uml.tools.utils.ICustomAppearance;
import org.eclipse.uml2.uml.Operation;
import org.eclipse.uml2.uml.Parameter;
@@ -101,7 +102,7 @@ public class OperationLabelParser extends NamedElementLabelParser {
// manage name and parameters
if ((maskValues.contains(ICustomAppearance.DISP_NAME)) && (operation.isSetName())) {
- String name = operation.getName();
+ String name = UMLLabelInternationalization.getInstance().getLabel(operation);
StringBuffer params = new StringBuffer();
for (Parameter parameter : operation.getOwnedParameters()) {
@@ -118,7 +119,7 @@ public class OperationLabelParser extends NamedElementLabelParser {
if ((maskValues.contains(ICustomAppearance.DISP_TYPE))) {
String type = "<Undefined>";
if (operation.getType() != null) {
- type = operation.getType().getName();
+ type = UMLLabelInternationalization.getInstance().getLabel(operation.getType());
}
// If type is undefined only show "<Undefined>" when explicitly asked.
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/PropertyLabelParser.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/PropertyLabelParser.java
index 0fd37969d94..89ea3a8e1d7 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/PropertyLabelParser.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/PropertyLabelParser.java
@@ -7,8 +7,8 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- *
- * CEA LIST - Initial API and implementation
+ * CEA LIST - Initial API and implementation
+ * Nicolas FAUVERGUE (ALL4TEC) nicolas.fauvergue@all4tec.net - Bug 496905
*
*****************************************************************************/
package org.eclipse.papyrus.uml.diagram.common.parser;
@@ -28,6 +28,7 @@ import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
import org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants;
import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLMultiplicityElementUtil;
+import org.eclipse.papyrus.uml.internationalization.utils.utils.UMLLabelInternationalization;
import org.eclipse.papyrus.uml.tools.utils.ICustomAppearance;
import org.eclipse.papyrus.uml.tools.utils.ValueSpecificationUtil;
import org.eclipse.uml2.uml.Property;
@@ -113,7 +114,7 @@ public class PropertyLabelParser extends NamedElementLabelParser {
// manage name
if (maskValues.contains(ICustomAppearance.DISP_NAME) && (property.isSetName())) {
- String name = property.getName();
+ String name = UMLLabelInternationalization.getInstance().getLabel(property);
result = String.format(NAME_FORMAT, result, name);
}
@@ -121,7 +122,7 @@ public class PropertyLabelParser extends NamedElementLabelParser {
if (maskValues.contains(ICustomAppearance.DISP_TYPE)) {
String type = "<Undefined>";
if (property.getType() != null) {
- type = property.getType().getName();
+ type = UMLLabelInternationalization.getInstance().getLabel(property.getType());
}
// If type is undefined only show "<Undefined>" when explicitly asked.
@@ -143,7 +144,7 @@ public class PropertyLabelParser extends NamedElementLabelParser {
// manage default value
if (maskValues.contains(ICustomAppearance.DISP_DEFAULT_VALUE) && property.getDefaultValue() != null) {
ValueSpecification valueSpecification = property.getDefaultValue();
- result = String.format(DEFAULT_VALUE_FORMAT, result, ValueSpecificationUtil.getSpecificationValue(valueSpecification));
+ result = String.format(DEFAULT_VALUE_FORMAT, result, ValueSpecificationUtil.getSpecificationValue(valueSpecification, true));
}
// manage modifier
@@ -164,7 +165,7 @@ public class PropertyLabelParser extends NamedElementLabelParser {
EList<Property> redefinedProperties = property.getRedefinedProperties();
if (redefinedProperties != null && !redefinedProperties.isEmpty()) {
for (Property p : redefinedProperties) {
- sb.append(sb.length() == 0 ? p.getName() : ", redefines " + p.getName());
+ sb.append(sb.length() == 0 ? UMLLabelInternationalization.getInstance().getLabel(p) : ", redefines " + UMLLabelInternationalization.getInstance().getLabel(p));
}
}
if (sb.length() != 0) {
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/ReceptionLabelParser.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/ReceptionLabelParser.java
index 7c7fe85686c..a5fbfaef55c 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/ReceptionLabelParser.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/ReceptionLabelParser.java
@@ -7,8 +7,8 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- *
- * CEA LIST - Initial API and implementation
+ * CEA LIST - Initial API and implementation
+ * Nicolas FAUVERGUE (ALL4TEC) nicolas.fauvergue@all4tec.net - Bug 496905
*
*****************************************************************************/
package org.eclipse.papyrus.uml.diagram.common.parser;
@@ -26,6 +26,7 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
import org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants;
+import org.eclipse.papyrus.uml.internationalization.utils.utils.UMLLabelInternationalization;
import org.eclipse.papyrus.uml.tools.utils.ICustomAppearance;
import org.eclipse.uml2.uml.Reception;
import org.eclipse.uml2.uml.UMLPackage;
@@ -65,7 +66,7 @@ public class ReceptionLabelParser extends NamedElementLabelParser implements IMa
// manage name
if (maskValues.contains(ICustomAppearance.DISP_NAME) && reception.isSetName()) {
- String name = reception.getName();
+ String name = UMLLabelInternationalization.getInstance().getLabel(reception);
result = String.format(NAME_FORMAT, result, name);
}
@@ -73,7 +74,7 @@ public class ReceptionLabelParser extends NamedElementLabelParser implements IMa
if (maskValues.contains(ILabelPreferenceConstants.DISP_SIGNAL)) {
String type = "<Undefined>";
if (reception.getSignal() != null) {
- type = reception.getSignal().getName();
+ type = UMLLabelInternationalization.getInstance().getLabel(reception.getSignal());
}
result = String.format(TYPE_FORMAT, result, type);
}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/utils/ParameterLabelUtil.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/utils/ParameterLabelUtil.java
index ca346d9aecf..edb3268fffb 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/utils/ParameterLabelUtil.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/utils/ParameterLabelUtil.java
@@ -1,135 +1,136 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.utils;
-
-import java.util.Collection;
-
-import org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants;
-import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLMultiplicityElementUtil;
-import org.eclipse.papyrus.uml.diagram.common.parser.IMaskManagedSemanticParser;
-import org.eclipse.papyrus.uml.tools.utils.ICustomAppearance;
-import org.eclipse.papyrus.uml.tools.utils.ValueSpecificationUtil;
-import org.eclipse.uml2.uml.Parameter;
-import org.eclipse.uml2.uml.ParameterDirectionKind;
-import org.eclipse.uml2.uml.ValueSpecification;
-
-
-public class ParameterLabelUtil {
-
- /** The String format for displaying a {@link Parameter} with direction */
- protected static final String DIRECTION_FORMAT = "%s %s";
-
- /** The String format for displaying a {@link Parameter} label with its name */
- protected static final String NAME_FORMAT = "%s%s";
-
- /** The String format for displaying a {@link Parameter} label with its type */
- protected static final String TYPE_FORMAT = "%s: %s";
-
- /** The String format for displaying a {@link Parameter} label with its multiplicity */
- protected static final String MULTIPLICITY_FORMAT = "%s [%s..%s]";
-
- /** The String format for displaying a {@link Parameter} label with its default value */
- protected static final String DEFAULT_VALUE_FORMAT = "%s= %s";
-
- /** The String format for displaying a {@link Parameter} label with its modifiers */
- protected static final String MODIFIER_FORMAT = "%s{%s}";
-
- public static String getPrintString(Parameter parameter, Collection<String> displayValue) {
- if (displayValue.isEmpty()) {
- return IMaskManagedSemanticParser.MaskedLabel;
- }
-
- String result = "";
-
- if (parameter != null) {
-
- // manage direction
- if (displayValue.contains(ICustomAppearance.DISP_DIRECTION) || displayValue.contains(ICustomAppearance.DISP_PARAMETER_DIRECTION)) {
- String direction;
- switch (parameter.getDirection().getValue()) {
- case ParameterDirectionKind.IN:
- direction = "in";
- break;
- case ParameterDirectionKind.OUT:
- direction = "out";
- break;
- case ParameterDirectionKind.INOUT:
- direction = "inout";
- break;
- case ParameterDirectionKind.RETURN:
- direction = "return";
- break;
- default:
- direction = "in";
- break;
- }
- result = String.format(DIRECTION_FORMAT, direction, result);
- }
-
- // manage name
- if ((displayValue.contains(ICustomAppearance.DISP_NAME) || displayValue.contains(ICustomAppearance.DISP_PARAMETER_NAME)) && (parameter.isSetName())) {
- String name = parameter.getName();
- result = String.format(NAME_FORMAT, result, name);
- }
-
- // manage type
- if (displayValue.contains(ICustomAppearance.DISP_TYPE) || displayValue.contains(ICustomAppearance.DISP_PARAMETER_TYPE)) {
- String type = "<Undefined>";
- if (parameter.getType() != null) {
- type = parameter.getType().getName();
- }
-
- // If type is undefined only show "<Undefined>" when explicitly asked.
- if (displayValue.contains(ILabelPreferenceConstants.DISP_UNDEFINED_TYPE) || (!"<Undefined>".equals(type))) {
- result = String.format(TYPE_FORMAT, result, type);
- }
- }
-
- // manage multiplicity
- String multiplicity = SysMLMultiplicityElementUtil.formatMultiplicity(parameter, displayValue);
- if (multiplicity != null && !multiplicity.isEmpty()) {
- result += " " + multiplicity;
- }
-
- // manage default value
- if ((displayValue.contains(ICustomAppearance.DISP_PARAMETER_DEFAULT) || displayValue.contains(ICustomAppearance.DISP_DEFAULT_VALUE)) && ((parameter.getDefaultValue() != null))) {
- ValueSpecification valueSpecification = parameter.getDefaultValue();
- result = String.format(DEFAULT_VALUE_FORMAT, result, ValueSpecificationUtil.getSpecificationValue(valueSpecification));
- }
-
- // manage modifier
- if (displayValue.contains(ICustomAppearance.DISP_PARAMETER_MODIFIERS) || displayValue.contains(ICustomAppearance.DISP_MODIFIERS)) {
- StringBuffer sb = new StringBuffer();
- if (parameter.isOrdered()) {
- sb.append(sb.length() == 0 ? "ordered" : ", ordered");
- }
- if (parameter.isUnique()) {
- sb.append(sb.length() == 0 ? "unique" : ", unique");
- }
- if (parameter.isStream()) {
- sb.append(sb.length() == 0 ? "stream" : ", stream");
- }
- if (parameter.isException()) {
- sb.append(sb.length() == 0 ? "exception" : ", exception");
- }
- if (sb.length() != 0) {
- result = String.format(MODIFIER_FORMAT, result, sb.toString());
- }
- }
-
- }
- return result;
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ * Nicolas FAUVERGUE (ALL4TEC) nicolas.fauvergue@all4tec.net - Bug 496905
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.utils;
+
+import java.util.Collection;
+
+import org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants;
+import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLMultiplicityElementUtil;
+import org.eclipse.papyrus.uml.diagram.common.parser.IMaskManagedSemanticParser;
+import org.eclipse.papyrus.uml.internationalization.utils.utils.UMLLabelInternationalization;
+import org.eclipse.papyrus.uml.tools.utils.ICustomAppearance;
+import org.eclipse.papyrus.uml.tools.utils.ValueSpecificationUtil;
+import org.eclipse.uml2.uml.Parameter;
+import org.eclipse.uml2.uml.ParameterDirectionKind;
+import org.eclipse.uml2.uml.ValueSpecification;
+
+
+public class ParameterLabelUtil {
+
+ /** The String format for displaying a {@link Parameter} with direction */
+ protected static final String DIRECTION_FORMAT = "%s %s";
+
+ /** The String format for displaying a {@link Parameter} label with its name */
+ protected static final String NAME_FORMAT = "%s%s";
+
+ /** The String format for displaying a {@link Parameter} label with its type */
+ protected static final String TYPE_FORMAT = "%s: %s";
+
+ /** The String format for displaying a {@link Parameter} label with its multiplicity */
+ protected static final String MULTIPLICITY_FORMAT = "%s [%s..%s]";
+
+ /** The String format for displaying a {@link Parameter} label with its default value */
+ protected static final String DEFAULT_VALUE_FORMAT = "%s= %s";
+
+ /** The String format for displaying a {@link Parameter} label with its modifiers */
+ protected static final String MODIFIER_FORMAT = "%s{%s}";
+
+ public static String getPrintString(Parameter parameter, Collection<String> displayValue) {
+ if (displayValue.isEmpty()) {
+ return IMaskManagedSemanticParser.MaskedLabel;
+ }
+
+ String result = "";
+
+ if (parameter != null) {
+
+ // manage direction
+ if (displayValue.contains(ICustomAppearance.DISP_DIRECTION) || displayValue.contains(ICustomAppearance.DISP_PARAMETER_DIRECTION)) {
+ String direction;
+ switch (parameter.getDirection().getValue()) {
+ case ParameterDirectionKind.IN:
+ direction = "in";
+ break;
+ case ParameterDirectionKind.OUT:
+ direction = "out";
+ break;
+ case ParameterDirectionKind.INOUT:
+ direction = "inout";
+ break;
+ case ParameterDirectionKind.RETURN:
+ direction = "return";
+ break;
+ default:
+ direction = "in";
+ break;
+ }
+ result = String.format(DIRECTION_FORMAT, direction, result);
+ }
+
+ // manage name
+ if ((displayValue.contains(ICustomAppearance.DISP_NAME) || displayValue.contains(ICustomAppearance.DISP_PARAMETER_NAME)) && (parameter.isSetName())) {
+ String name = UMLLabelInternationalization.getInstance().getLabel(parameter);
+ result = String.format(NAME_FORMAT, result, name);
+ }
+
+ // manage type
+ if (displayValue.contains(ICustomAppearance.DISP_TYPE) || displayValue.contains(ICustomAppearance.DISP_PARAMETER_TYPE)) {
+ String type = "<Undefined>";
+ if (parameter.getType() != null) {
+ type = UMLLabelInternationalization.getInstance().getLabel(parameter.getType());
+ }
+
+ // If type is undefined only show "<Undefined>" when explicitly asked.
+ if (displayValue.contains(ILabelPreferenceConstants.DISP_UNDEFINED_TYPE) || (!"<Undefined>".equals(type))) {
+ result = String.format(TYPE_FORMAT, result, type);
+ }
+ }
+
+ // manage multiplicity
+ String multiplicity = SysMLMultiplicityElementUtil.formatMultiplicity(parameter, displayValue);
+ if (multiplicity != null && !multiplicity.isEmpty()) {
+ result += " " + multiplicity;
+ }
+
+ // manage default value
+ if ((displayValue.contains(ICustomAppearance.DISP_PARAMETER_DEFAULT) || displayValue.contains(ICustomAppearance.DISP_DEFAULT_VALUE)) && ((parameter.getDefaultValue() != null))) {
+ ValueSpecification valueSpecification = parameter.getDefaultValue();
+ result = String.format(DEFAULT_VALUE_FORMAT, result, ValueSpecificationUtil.getSpecificationValue(valueSpecification, true));
+ }
+
+ // manage modifier
+ if (displayValue.contains(ICustomAppearance.DISP_PARAMETER_MODIFIERS) || displayValue.contains(ICustomAppearance.DISP_MODIFIERS)) {
+ StringBuffer sb = new StringBuffer();
+ if (parameter.isOrdered()) {
+ sb.append(sb.length() == 0 ? "ordered" : ", ordered");
+ }
+ if (parameter.isUnique()) {
+ sb.append(sb.length() == 0 ? "unique" : ", unique");
+ }
+ if (parameter.isStream()) {
+ sb.append(sb.length() == 0 ? "stream" : ", stream");
+ }
+ if (parameter.isException()) {
+ sb.append(sb.length() == 0 ? "exception" : ", exception");
+ }
+ if (sb.length() != 0) {
+ result = String.format(MODIFIER_FORMAT, result, sb.toString());
+ }
+ }
+
+ }
+ return result;
+ }
+
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src/org/eclipse/papyrus/sysml/diagram/common/Activator.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src/org/eclipse/papyrus/sysml/diagram/common/Activator.java
index 957f7ddf5d5..4437e9f5e9c 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src/org/eclipse/papyrus/sysml/diagram/common/Activator.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src/org/eclipse/papyrus/sysml/diagram/common/Activator.java
@@ -7,8 +7,8 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- *
- * CEA LIST - Initial API and implementation
+ * CEA LIST - Initial API and implementation
+ * Nicolas FAUVERGUE (ALL4TEC) nicolas.fauvergue@all4tec.net - Bug 496905
*
*****************************************************************************/
package org.eclipse.papyrus.sysml.diagram.common;
@@ -33,10 +33,10 @@ import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.papyrus.infra.core.log.LogHelper;
import org.eclipse.papyrus.sysml.portandflows.FlowDirection;
import org.eclipse.papyrus.sysml.portandflows.FlowPort;
+import org.eclipse.papyrus.uml.internationalization.edit.providers.InternationalizationUMLItemProviderAdapterFactory;
import org.eclipse.papyrus.uml.tools.providers.UMLLabelProvider;
import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.uml2.uml.edit.providers.UMLItemProviderAdapterFactory;
import org.osgi.framework.BundleContext;
//import org.eclipse.papyrus.sysml.activities.provider.ActivitiesItemProviderAdapterFactory;
//import org.eclipse.papyrus.sysml.allocations.provider.AllocationsItemProviderAdapterFactory;
@@ -285,7 +285,7 @@ public class Activator extends AbstractUIPlugin {
// factories.add(new PortandflowsItemProviderAdapterFactory());
// factories.add(new RequirementsItemProviderAdapterFactory());
// Add UML adapter
- factories.add(new UMLItemProviderAdapterFactory());
+ factories.add(new InternationalizationUMLItemProviderAdapterFactory());
// Other adapters
factories.add(new EcoreItemProviderAdapterFactory());
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock/META-INF/MANIFEST.MF b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock/META-INF/MANIFEST.MF
index 8f438356c57..0892dd3cc43 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock/META-INF/MANIFEST.MF
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock/META-INF/MANIFEST.MF
@@ -16,7 +16,8 @@ Export-Package: org.eclipse.papyrus.sysml.diagram.internalblock,
Require-Bundle: org.eclipse.gmf.runtime.diagram.ui.providers;bundle-version="[1.7.0,2.0.0)",
org.eclipse.papyrus.sysml.diagram.common;bundle-version="[2.0.0,3.0.0)";visibility:=reexport,
org.eclipse.papyrus.sysml.service.types;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.papyrus.infra.gmfdiag.navigation;bundle-version="[2.0.0,3.0.0)"
+ org.eclipse.papyrus.infra.gmfdiag.navigation;bundle-version="[2.0.0,3.0.0)",
+ org.eclipse.papyrus.infra.internationalization.utils;bundle-version="[1.0.0,2.0.0)"
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
Bundle-Version: 3.0.0.qualifier
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock/src-gen/org/eclipse/papyrus/sysml/diagram/internalblock/InternalBlockDiagramForMultiEditor.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock/src-gen/org/eclipse/papyrus/sysml/diagram/internalblock/InternalBlockDiagramForMultiEditor.java
index 8155867ca48..b50f917caf6 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock/src-gen/org/eclipse/papyrus/sysml/diagram/internalblock/InternalBlockDiagramForMultiEditor.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock/src-gen/org/eclipse/papyrus/sysml/diagram/internalblock/InternalBlockDiagramForMultiEditor.java
@@ -10,6 +10,7 @@
*
* CEA LIST - Initial API and implementation
* Christian W. Damus (CEA) - bug 392301
+ * Nicolas FAUVERGUE (ALL4TEC) nicolas.fauvergue@all4tec.net - Bug 496905
*
*****************************************************************************/
package org.eclipse.papyrus.sysml.diagram.internalblock;
@@ -23,6 +24,7 @@ import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.papyrus.infra.core.editor.BackboneException;
import org.eclipse.papyrus.infra.core.services.ServiceException;
import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
+import org.eclipse.papyrus.infra.internationalization.utils.utils.LabelInternationalization;
import org.eclipse.papyrus.sysml.diagram.internalblock.part.InternalBlockDiagramEditor;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Composite;
@@ -70,7 +72,7 @@ public class InternalBlockDiagramForMultiEditor extends InternalBlockDiagramEdit
@Override
public void init(IEditorSite site, IEditorInput input) throws PartInitException {
super.init(site, input);
- setPartName(getDiagram().getName());
+ setPartName(LabelInternationalization.getInstance().getDiagramLabel(getDiagram()));
titleImage = DIAG_IMG_DESC.createImage();
setTitleImage(titleImage);
}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/META-INF/MANIFEST.MF b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/META-INF/MANIFEST.MF
index 61654370816..26bfc574664 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/META-INF/MANIFEST.MF
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/META-INF/MANIFEST.MF
@@ -20,7 +20,8 @@ Require-Bundle: org.eclipse.gmf.runtime.diagram.ui.providers;bundle-version="[1.
org.eclipse.papyrus.infra.gmfdiag.navigation;bundle-version="[2.0.0,3.0.0)",
org.eclipse.papyrus.sysml.diagram.internalblock;bundle-version="[3.0.0,4.0.0)",
org.eclipse.papyrus.uml.diagram.clazz;bundle-version="[3.0.0,4.0.0)",
- org.eclipse.papyrus.infra.properties.ui;bundle-version="[2.0.0,3.0.0)"
+ org.eclipse.papyrus.infra.properties.ui;bundle-version="[2.0.0,3.0.0)",
+ org.eclipse.papyrus.infra.internationalization.utils;bundle-version="[1.0.0,2.0.0)"
Bundle-Vendor: %providerName
Bundle-Version: 2.0.0.qualifier
Bundle-ManifestVersion: 2
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/ParametricDiagramForMultiEditor.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/ParametricDiagramForMultiEditor.java
index ee096dc9e71..725e124586f 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/ParametricDiagramForMultiEditor.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/ParametricDiagramForMultiEditor.java
@@ -10,6 +10,7 @@
* R�gis CHEVREL: chevrel.regis <at> gmail.com
* CEA LIST - Initial API and implementation
* Christian W. Damus (CEA) - bug 392301
+ * Nicolas FAUVERGUE (ALL4TEC) nicolas.fauvergue@all4tec.net - Bug 496905
*
*****************************************************************************/
package org.eclipse.papyrus.sysml.diagram.parametric;
@@ -23,6 +24,7 @@ import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.papyrus.infra.core.editor.BackboneException;
import org.eclipse.papyrus.infra.core.services.ServiceException;
import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
+import org.eclipse.papyrus.infra.internationalization.utils.utils.LabelInternationalization;
import org.eclipse.papyrus.sysml.diagram.parametric.part.ParametricDiagramEditor;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Composite;
@@ -70,7 +72,7 @@ public class ParametricDiagramForMultiEditor extends ParametricDiagramEditor {
@Override
public void init(IEditorSite site, IEditorInput input) throws PartInitException {
super.init(site, input);
- setPartName(getDiagram().getName());
+ setPartName(LabelInternationalization.getInstance().getDiagramLabel(getDiagram()));
titleImage = DIAG_IMG_DESC.createImage();
setTitleImage(titleImage);
}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/part/CustomBlockLabelNameEditPart.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/part/CustomBlockLabelNameEditPart.java
index 5709767d37d..f53b3b6be81 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/part/CustomBlockLabelNameEditPart.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/part/CustomBlockLabelNameEditPart.java
@@ -7,13 +7,15 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Rgis CHEVREL: chevrel.regis <at> gmail.com
+ * R�gis CHEVREL: chevrel.regis <at> gmail.com
* CEA LIST - Initial API and implementation
+ * Nicolas FAUVERGUE (ALL4TEC) nicolas.fauvergue@all4tec.net - Bug 496905
*
*****************************************************************************/
package org.eclipse.papyrus.sysml.diagram.parametric.edit.part;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.internationalization.utils.utils.LabelInternationalization;
import org.eclipse.papyrus.sysml.diagram.common.edit.part.BlockLabelNameEditPart;
public class CustomBlockLabelNameEditPart extends BlockLabelNameEditPart {
@@ -27,7 +29,7 @@ public class CustomBlockLabelNameEditPart extends BlockLabelNameEditPart {
*/
@Override
protected String getLabelText() {
- String diagramName = getDiagramView().getName();
+ String diagramName = LabelInternationalization.getInstance().getDiagramLabel(getDiagramView());
return super.getLabelText() + " [" + diagramName + "]";
}
}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement/META-INF/MANIFEST.MF b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement/META-INF/MANIFEST.MF
index d1191935063..ae52be451e6 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement/META-INF/MANIFEST.MF
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement/META-INF/MANIFEST.MF
@@ -13,7 +13,9 @@ Require-Bundle: org.eclipse.papyrus.uml.diagram.common;bundle-version="[3.0.0,4.
org.eclipse.gmf.runtime.diagram.ui.providers;bundle-version="[1.7.0,2.0.0)",
org.eclipse.papyrus.infra.gmfdiag.navigation;bundle-version="[2.0.0,3.0.0)",
org.eclipse.papyrus.sysml.diagram.common;bundle-version="[2.0.0,3.0.0)";visibility:=reexport,
- org.eclipse.papyrus.uml.appearance;bundle-version="[1.2.0,2.0.0)"
+ org.eclipse.papyrus.uml.appearance;bundle-version="[1.2.0,2.0.0)",
+ org.eclipse.papyrus.infra.internationalization.utils;bundle-version="[1.0.0,2.0.0)",
+ org.eclipse.papyrus.uml.internationalization.utils;bundle-version="[1.0.0,2.0.0)"
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
Bundle-Version: 3.0.0.qualifier
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement/src-gen/org/eclipse/papyrus/sysml/diagram/requirement/RequirementDiagramForMultiEditor.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement/src-gen/org/eclipse/papyrus/sysml/diagram/requirement/RequirementDiagramForMultiEditor.java
index 0fe44cb82cc..ad4bba4a0bb 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement/src-gen/org/eclipse/papyrus/sysml/diagram/requirement/RequirementDiagramForMultiEditor.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement/src-gen/org/eclipse/papyrus/sysml/diagram/requirement/RequirementDiagramForMultiEditor.java
@@ -11,6 +11,7 @@
* CEA LIST- Initial API and implementation
* Nizar GUEDIDI (CEA LIST)- modification
* Christian W. Damus (CEA) - bug 392301
+ * Nicolas FAUVERGUE (ALL4TEC) nicolas.fauvergue@all4tec.net - Bug 496905
*
****************************************************************************/
package org.eclipse.papyrus.sysml.diagram.requirement;
@@ -24,6 +25,7 @@ import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.papyrus.infra.core.editor.BackboneException;
import org.eclipse.papyrus.infra.core.services.ServiceException;
import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
+import org.eclipse.papyrus.infra.internationalization.utils.utils.LabelInternationalization;
import org.eclipse.papyrus.sysml.diagram.requirement.part.RequirementDiagramEditor;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Composite;
@@ -71,7 +73,7 @@ public class RequirementDiagramForMultiEditor extends RequirementDiagramEditor {
@Override
public void init(IEditorSite site, IEditorInput input) throws PartInitException {
super.init(site, input);
- setPartName(getDiagram().getName());
+ setPartName(LabelInternationalization.getInstance().getDiagramLabel(getDiagram()));
titleImage = DIAG_IMG_DESC.createImage();
setTitleImage(titleImage);
}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement/src/org/eclipse/papyrus/sysml/diagram/requirement/edit/part/CustomRequirementEditPart.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement/src/org/eclipse/papyrus/sysml/diagram/requirement/edit/part/CustomRequirementEditPart.java
index 0ee257a59dc..fc917caf9bb 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement/src/org/eclipse/papyrus/sysml/diagram/requirement/edit/part/CustomRequirementEditPart.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement/src/org/eclipse/papyrus/sysml/diagram/requirement/edit/part/CustomRequirementEditPart.java
@@ -1,86 +1,88 @@
-/*****************************************************************************
- * Copyright (c) 2012 ATOS.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Olivier Mélois (ATOS) - Initial API and implementation
- *
- ******************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.requirement.edit.part;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.sysml.diagram.requirement.figure.CustomRequirementFigure;
-import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.ClassEditPart;
-import org.eclipse.papyrus.uml.diagram.common.commands.ShowHideCompartmentRequest;
-import org.eclipse.uml2.uml.NamedElement;
-
-public class CustomRequirementEditPart extends ClassEditPart {
-
- //protected static final String ICONS_PATH = "/org.eclipse.papyrus.sysml/icons/requirements/Requirement.gif"; //$NON-NLS-1$
-
- public CustomRequirementEditPart(View view) {
- super(view);
- }
-
-
- @Override
- protected IFigure createNodeShape() {
- // Showing the information compartment.
- View notationView = getNotationView();
- Request request = new ShowHideCompartmentRequest(ShowHideCompartmentRequest.SHOW, notationView);
- request.setType(ShowHideCompartmentRequest.SHOW_HIDE_COMPARTMENT);
- Command showCompartmentCommand = this.getCommand(request);
- getEditDomain().getCommandStack().execute(showCompartmentCommand);
-
- primaryShape = new CustomRequirementFigure();
- // ((CustomRequirementFigure)primaryShape).setTagIcon(Activator.getPluginIconImage(Activator.ID, ICONS_PATH));
- return primaryShape;
- }
-
- public void refreshTitle() {
- NamedElement clazz = (NamedElement) ((View) this.getModel()).getElement();
- String requirementName = clazz.getName();
- ((CustomRequirementFigure) this.getFigure()).setName(requirementName);
- }
-
- @Override
- protected boolean addFixedChild(EditPart childEditPart) {
- if (childEditPart instanceof CustomRequirementInformationCompartmentEditPart) {
- IFigure pane = ((CustomRequirementFigure) getPrimaryShape()).getRequirementIdInformationCompartmentFigure();
- setupContentPane(pane); // FIXME each compartment should handle his content pane in his own way
- pane.add(((CustomRequirementInformationCompartmentEditPart) childEditPart).getFigure());
- return true;
- }
- return super.addFixedChild(childEditPart);
- }
-
- @Override
- protected boolean removeFixedChild(EditPart childEditPart) {
- if (childEditPart instanceof CustomRequirementInformationCompartmentEditPart) {
- IFigure pane = ((CustomRequirementFigure) getPrimaryShape()).getRequirementIdInformationCompartmentFigure();
- setupContentPane(pane); // FIXME each compartment should handle his content pane in his own way
- pane.remove(((CustomRequirementInformationCompartmentEditPart) childEditPart).getFigure());
- return true;
- }
- return super.removeFixedChild(childEditPart);
- }
-
- @Override
- public IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if (editPart instanceof CustomRequirementInformationCompartmentEditPart) {
- return ((CustomRequirementFigure) getPrimaryShape()).getRequirementIdInformationCompartmentFigure();
- }
- return super.getContentPaneFor(editPart);
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2012 ATOS.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Olivier Mélois (ATOS) - Initial API and implementation
+ * Nicolas FAUVERGUE (ALL4TEC) nicolas.fauvergue@all4tec.net - Bug 496905
+ *
+ ******************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.requirement.edit.part;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.requirement.figure.CustomRequirementFigure;
+import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.ClassEditPart;
+import org.eclipse.papyrus.uml.diagram.common.commands.ShowHideCompartmentRequest;
+import org.eclipse.papyrus.uml.internationalization.utils.utils.UMLLabelInternationalization;
+import org.eclipse.uml2.uml.NamedElement;
+
+public class CustomRequirementEditPart extends ClassEditPart {
+
+ //protected static final String ICONS_PATH = "/org.eclipse.papyrus.sysml/icons/requirements/Requirement.gif"; //$NON-NLS-1$
+
+ public CustomRequirementEditPart(View view) {
+ super(view);
+ }
+
+
+ @Override
+ protected IFigure createNodeShape() {
+ // Showing the information compartment.
+ View notationView = getNotationView();
+ Request request = new ShowHideCompartmentRequest(ShowHideCompartmentRequest.SHOW, notationView);
+ request.setType(ShowHideCompartmentRequest.SHOW_HIDE_COMPARTMENT);
+ Command showCompartmentCommand = this.getCommand(request);
+ getEditDomain().getCommandStack().execute(showCompartmentCommand);
+
+ primaryShape = new CustomRequirementFigure();
+ // ((CustomRequirementFigure)primaryShape).setTagIcon(Activator.getPluginIconImage(Activator.ID, ICONS_PATH));
+ return primaryShape;
+ }
+
+ public void refreshTitle() {
+ NamedElement clazz = (NamedElement) ((View) this.getModel()).getElement();
+ String requirementName = UMLLabelInternationalization.getInstance().getLabel(clazz);
+ ((CustomRequirementFigure) this.getFigure()).setName(requirementName);
+ }
+
+ @Override
+ protected boolean addFixedChild(EditPart childEditPart) {
+ if (childEditPart instanceof CustomRequirementInformationCompartmentEditPart) {
+ IFigure pane = ((CustomRequirementFigure) getPrimaryShape()).getRequirementIdInformationCompartmentFigure();
+ setupContentPane(pane); // FIXME each compartment should handle his content pane in his own way
+ pane.add(((CustomRequirementInformationCompartmentEditPart) childEditPart).getFigure());
+ return true;
+ }
+ return super.addFixedChild(childEditPart);
+ }
+
+ @Override
+ protected boolean removeFixedChild(EditPart childEditPart) {
+ if (childEditPart instanceof CustomRequirementInformationCompartmentEditPart) {
+ IFigure pane = ((CustomRequirementFigure) getPrimaryShape()).getRequirementIdInformationCompartmentFigure();
+ setupContentPane(pane); // FIXME each compartment should handle his content pane in his own way
+ pane.remove(((CustomRequirementInformationCompartmentEditPart) childEditPart).getFigure());
+ return true;
+ }
+ return super.removeFixedChild(childEditPart);
+ }
+
+ @Override
+ public IFigure getContentPaneFor(IGraphicalEditPart editPart) {
+ if (editPart instanceof CustomRequirementInformationCompartmentEditPart) {
+ return ((CustomRequirementFigure) getPrimaryShape()).getRequirementIdInformationCompartmentFigure();
+ }
+ return super.getContentPaneFor(editPart);
+ }
+
+}
diff --git a/plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/META-INF/MANIFEST.MF b/plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/META-INF/MANIFEST.MF
index 69bf9a21e0f..e44ff1953c2 100644
--- a/plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/META-INF/MANIFEST.MF
+++ b/plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/META-INF/MANIFEST.MF
@@ -3,7 +3,8 @@ Require-Bundle: org.eclipse.papyrus.sysml.service.types;bundle-version="[2.0.0,3
org.eclipse.papyrus.sysml.diagram.common;bundle-version="[2.0.0,3.0.0)",
org.eclipse.papyrus.uml.modelexplorer;bundle-version="[2.0.0,3.0.0)",
org.eclipse.papyrus.infra.newchild;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.papyrus.views.modelexplorer;bundle-version="[3.0.0,4.0.0)"
+ org.eclipse.papyrus.views.modelexplorer;bundle-version="[3.0.0,4.0.0)",
+ org.eclipse.papyrus.uml.internationalization.utils;bundle-version="[1.0.0,2.0.0)"
Export-Package: org.eclipse.papyrus.sysml.modelexplorer
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
diff --git a/plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/src/org/eclipse/papyrus/sysml/modelexplorer/query/GetLabelQuery.java b/plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/src/org/eclipse/papyrus/sysml/modelexplorer/query/GetLabelQuery.java
index 20295188017..0eb523de87b 100644
--- a/plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/src/org/eclipse/papyrus/sysml/modelexplorer/query/GetLabelQuery.java
+++ b/plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/src/org/eclipse/papyrus/sysml/modelexplorer/query/GetLabelQuery.java
@@ -9,6 +9,7 @@
*
* Contributors:
* Patrick Tessier (CEA LIST) - Initial API and implementation
+ * Nicolas FAUVERGUE (ALL4TEC) nicolas.fauvergue@all4tec.net - Bug 496905
/*****************************************************************************/
package org.eclipse.papyrus.sysml.modelexplorer.query;
@@ -18,6 +19,7 @@ import org.eclipse.papyrus.emf.facet.efacet.core.exception.DerivedTypedElementEx
import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.ParameterValue;
import org.eclipse.papyrus.emf.facet.query.java.core.IJavaQuery2;
import org.eclipse.papyrus.emf.facet.query.java.core.IParameterValueList2;
+import org.eclipse.papyrus.uml.internationalization.utils.utils.UMLLabelInternationalization;
import org.eclipse.uml2.uml.NamedElement;
/** Create a basic label based on element name */
@@ -35,7 +37,7 @@ public class GetLabelQuery implements IJavaQuery2<NamedElement, String> {
String label = UNNAMED;
if (source.isSetName() && (!"".equals(source.getName().trim()))) {
- label = source.getName();
+ label = UMLLabelInternationalization.getInstance().getLabel(source);
}
return label;
}
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.edit/META-INF/MANIFEST.MF b/plugins/sysml/org.eclipse.papyrus.sysml.edit/META-INF/MANIFEST.MF
index 2e0caf3fe0b..d9510f3a65b 100644
--- a/plugins/sysml/org.eclipse.papyrus.sysml.edit/META-INF/MANIFEST.MF
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.edit/META-INF/MANIFEST.MF
@@ -7,7 +7,8 @@ Require-Bundle: org.eclipse.papyrus.sysml;bundle-version="[1.2.0,2.0.0)";visibil
org.eclipse.uml2.types;bundle-version="[2.0.0,3.0.0)";visibility:=reexport,
org.eclipse.uml2.uml;bundle-version="[5.2.0,6.0.0)";visibility:=reexport,
org.eclipse.uml2.uml.edit;bundle-version="[5.1.0,6.0.0)",
- org.eclipse.uml2.common.edit;bundle-version="[2.1.0,3.0.0)";visibility:=reexport
+ org.eclipse.uml2.common.edit;bundle-version="[2.1.0,3.0.0)";visibility:=reexport,
+ org.eclipse.papyrus.uml.internationalization.edit;bundle-version="[1.0.0,2.0.0)"
Export-Package: org.eclipse.papyrus.sysml.activities.provider,
org.eclipse.papyrus.sysml.allocations.provider,
org.eclipse.papyrus.sysml.blocks.provider,
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.edit/src/org/eclipse/papyrus/sysml/registry/SysmlRegistryAdapterFactoryRegistry.java b/plugins/sysml/org.eclipse.papyrus.sysml.edit/src/org/eclipse/papyrus/sysml/registry/SysmlRegistryAdapterFactoryRegistry.java
index a7d7846267b..28655ca7abd 100644
--- a/plugins/sysml/org.eclipse.papyrus.sysml.edit/src/org/eclipse/papyrus/sysml/registry/SysmlRegistryAdapterFactoryRegistry.java
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.edit/src/org/eclipse/papyrus/sysml/registry/SysmlRegistryAdapterFactoryRegistry.java
@@ -1,432 +1,433 @@
-/*****************************************************************************
- * Copyright (c) 2011 Atos.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Atos - Initial API and implementation
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.registry;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.edit.provider.ItemProviderAdapter;
-import org.eclipse.papyrus.sysml.activities.provider.ActivitiesItemProviderAdapterFactory;
-import org.eclipse.papyrus.sysml.allocations.provider.AllocationsItemProviderAdapterFactory;
-import org.eclipse.papyrus.sysml.blocks.provider.BlocksItemProviderAdapterFactory;
-import org.eclipse.papyrus.sysml.constraints.provider.ConstraintsItemProviderAdapterFactory;
-import org.eclipse.papyrus.sysml.edit.provider.IComposableAdapterFactory;
-import org.eclipse.papyrus.sysml.edit.provider.IRootAdapterFactory;
-import org.eclipse.papyrus.sysml.modelelements.provider.ModelelementsItemProviderAdapterFactory;
-import org.eclipse.papyrus.sysml.portandflows.provider.PortandflowsItemProviderAdapterFactory;
-import org.eclipse.papyrus.sysml.requirements.provider.RequirementsItemProviderAdapterFactory;
-import org.eclipse.uml2.uml.UMLPackage;
-import org.eclipse.uml2.uml.edit.providers.AbstractionItemProvider;
-import org.eclipse.uml2.uml.edit.providers.ActivityEdgeItemProvider;
-import org.eclipse.uml2.uml.edit.providers.ActivityPartitionItemProvider;
-import org.eclipse.uml2.uml.edit.providers.BehaviorItemProvider;
-import org.eclipse.uml2.uml.edit.providers.ClassItemProvider;
-import org.eclipse.uml2.uml.edit.providers.ClassifierItemProvider;
-import org.eclipse.uml2.uml.edit.providers.CommentItemProvider;
-import org.eclipse.uml2.uml.edit.providers.ConnectorEndItemProvider;
-import org.eclipse.uml2.uml.edit.providers.ConnectorItemProvider;
-import org.eclipse.uml2.uml.edit.providers.DataTypeItemProvider;
-import org.eclipse.uml2.uml.edit.providers.DependencyItemProvider;
-import org.eclipse.uml2.uml.edit.providers.InformationFlowItemProvider;
-import org.eclipse.uml2.uml.edit.providers.InstanceSpecificationItemProvider;
-import org.eclipse.uml2.uml.edit.providers.InterfaceItemProvider;
-import org.eclipse.uml2.uml.edit.providers.NamedElementItemProvider;
-import org.eclipse.uml2.uml.edit.providers.ObjectNodeItemProvider;
-import org.eclipse.uml2.uml.edit.providers.OperationItemProvider;
-import org.eclipse.uml2.uml.edit.providers.PackageItemProvider;
-import org.eclipse.uml2.uml.edit.providers.ParameterItemProvider;
-import org.eclipse.uml2.uml.edit.providers.ParameterSetItemProvider;
-import org.eclipse.uml2.uml.edit.providers.PortItemProvider;
-import org.eclipse.uml2.uml.edit.providers.PropertyItemProvider;
-import org.eclipse.uml2.uml.edit.providers.UMLItemProviderAdapterFactory;
-
-/**
- * Get a registry of all SysML Adapter Factory classified by the UML class their
- * correspond.
- *
- * Example:
- *
- * <Class.class> ->[ModelelementsItemProviderAdapterFactory,
- * BlocksAdapterItemProviderFactory, RequirementsAdapterItemProviderFactory]
- *
- * @generated
- */
-public class SysmlRegistryAdapterFactoryRegistry {
-
- /**
- * Keep track of the item provider of type ModelelementsItemProviderAdapterFactory
- *
- * @generated
- */
-
- protected ModelelementsItemProviderAdapterFactory modelelementsAdapterFactoryItemProvider;
-
- /**
- * Keep track of the item provider of type BlocksItemProviderAdapterFactory
- *
- * @generated
- */
-
- protected BlocksItemProviderAdapterFactory blocksAdapterFactoryItemProvider;
-
- /**
- * Keep track of the item provider of type PortandflowsItemProviderAdapterFactory
- *
- * @generated
- */
-
- protected PortandflowsItemProviderAdapterFactory portandflowsAdapterFactoryItemProvider;
-
- /**
- * Keep track of the item provider of type ConstraintsItemProviderAdapterFactory
- *
- * @generated
- */
-
- protected ConstraintsItemProviderAdapterFactory constraintsAdapterFactoryItemProvider;
-
- /**
- * Keep track of the item provider of type ActivitiesItemProviderAdapterFactory
- *
- * @generated
- */
-
- protected ActivitiesItemProviderAdapterFactory activitiesAdapterFactoryItemProvider;
-
- /**
- * Keep track of the item provider of type AllocationsItemProviderAdapterFactory
- *
- * @generated
- */
-
- protected AllocationsItemProviderAdapterFactory allocationsAdapterFactoryItemProvider;
-
- /**
- * Keep track of the item provider of type RequirementsItemProviderAdapterFactory
- *
- * @generated
- */
-
- protected RequirementsItemProviderAdapterFactory requirementsAdapterFactoryItemProvider;
-
- /**
- * Registry for all SysML AdapterFactory
- *
- * @generated
- */
- private List<AdapterFactory> adapterFactoryRegistry = new ArrayList<AdapterFactory>(7);
-
- /**
- * Registry of all {@link AdapterFactory} classified by corresponding UML element
- *
- * @generated
- */
- private HashMap<EClass, ArrayList<AdapterFactory>> adapterFactoryRegistryMap = new HashMap<EClass, ArrayList<AdapterFactory>>();
-
- /**
- * Default adapterFactory
- *
- * @generated
- */
- private UMLItemProviderAdapterFactory defaultAdapterFactory = new UMLItemProviderAdapterFactory();
-
- /**
- * Constructor + initialize
- *
- * @generated
- */
- private SysmlRegistryAdapterFactoryRegistry() {
- /**
- * Initialize all AdapterFactories
- */
-
- modelelementsAdapterFactoryItemProvider = new ModelelementsItemProviderAdapterFactory();
- adapterFactoryRegistry.add(modelelementsAdapterFactoryItemProvider);
-
- blocksAdapterFactoryItemProvider = new BlocksItemProviderAdapterFactory();
- adapterFactoryRegistry.add(blocksAdapterFactoryItemProvider);
-
- portandflowsAdapterFactoryItemProvider = new PortandflowsItemProviderAdapterFactory();
- adapterFactoryRegistry.add(portandflowsAdapterFactoryItemProvider);
-
- constraintsAdapterFactoryItemProvider = new ConstraintsItemProviderAdapterFactory();
- adapterFactoryRegistry.add(constraintsAdapterFactoryItemProvider);
-
- activitiesAdapterFactoryItemProvider = new ActivitiesItemProviderAdapterFactory();
- adapterFactoryRegistry.add(activitiesAdapterFactoryItemProvider);
-
- allocationsAdapterFactoryItemProvider = new AllocationsItemProviderAdapterFactory();
- adapterFactoryRegistry.add(allocationsAdapterFactoryItemProvider);
-
- requirementsAdapterFactoryItemProvider = new RequirementsItemProviderAdapterFactory();
- adapterFactoryRegistry.add(requirementsAdapterFactoryItemProvider);
-
- /**
- * AdapterFactories for the ABSTRACTION elements
- */
- adapterFactoryRegistryMap.put(UMLPackage.Literals.ABSTRACTION, new ArrayList<AdapterFactory>(Collections.singletonList(requirementsAdapterFactoryItemProvider)));
-
- adapterFactoryRegistryMap.get(UMLPackage.Literals.ABSTRACTION).add(allocationsAdapterFactoryItemProvider);
-
- /**
- * AdapterFactories for the ACTIVITY_EDGE elements
- */
- adapterFactoryRegistryMap.put(UMLPackage.Literals.ACTIVITY_EDGE, new ArrayList<AdapterFactory>(Collections.singletonList(activitiesAdapterFactoryItemProvider)));
-
- /**
- * AdapterFactories for the ACTIVITY_PARTITION elements
- */
- adapterFactoryRegistryMap.put(UMLPackage.Literals.ACTIVITY_PARTITION, new ArrayList<AdapterFactory>(Collections.singletonList(allocationsAdapterFactoryItemProvider)));
-
- /**
- * AdapterFactories for the BEHAVIOR elements
- */
- adapterFactoryRegistryMap.put(UMLPackage.Literals.BEHAVIOR, new ArrayList<AdapterFactory>(Collections.singletonList(requirementsAdapterFactoryItemProvider)));
-
- adapterFactoryRegistryMap.get(UMLPackage.Literals.BEHAVIOR).add(activitiesAdapterFactoryItemProvider);
-
- /**
- * AdapterFactories for the CLASS elements
- */
- adapterFactoryRegistryMap.put(UMLPackage.Literals.CLASS, new ArrayList<AdapterFactory>(Collections.singletonList(requirementsAdapterFactoryItemProvider)));
-
- adapterFactoryRegistryMap.get(UMLPackage.Literals.CLASS).add(modelelementsAdapterFactoryItemProvider);
-
- adapterFactoryRegistryMap.get(UMLPackage.Literals.CLASS).add(constraintsAdapterFactoryItemProvider);
-
- adapterFactoryRegistryMap.get(UMLPackage.Literals.CLASS).add(blocksAdapterFactoryItemProvider);
-
- /**
- * AdapterFactories for the CLASSIFIER elements
- */
- adapterFactoryRegistryMap.put(UMLPackage.Literals.CLASSIFIER, new ArrayList<AdapterFactory>(Collections.singletonList(blocksAdapterFactoryItemProvider)));
-
- /**
- * AdapterFactories for the COMMENT elements
- */
- adapterFactoryRegistryMap.put(UMLPackage.Literals.COMMENT, new ArrayList<AdapterFactory>(Collections.singletonList(modelelementsAdapterFactoryItemProvider)));
-
- /**
- * AdapterFactories for the CONNECTOR elements
- */
- adapterFactoryRegistryMap.put(UMLPackage.Literals.CONNECTOR, new ArrayList<AdapterFactory>(Collections.singletonList(blocksAdapterFactoryItemProvider)));
-
- /**
- * AdapterFactories for the CONNECTOR_END elements
- */
- adapterFactoryRegistryMap.put(UMLPackage.Literals.CONNECTOR_END, new ArrayList<AdapterFactory>(Collections.singletonList(blocksAdapterFactoryItemProvider)));
-
- /**
- * AdapterFactories for the DATA_TYPE elements
- */
- adapterFactoryRegistryMap.put(UMLPackage.Literals.DATA_TYPE, new ArrayList<AdapterFactory>(Collections.singletonList(blocksAdapterFactoryItemProvider)));
-
- /**
- * AdapterFactories for the DEPENDENCY elements
- */
- adapterFactoryRegistryMap.put(UMLPackage.Literals.DEPENDENCY, new ArrayList<AdapterFactory>(Collections.singletonList(modelelementsAdapterFactoryItemProvider)));
-
- /**
- * AdapterFactories for the INFORMATION_FLOW elements
- */
- adapterFactoryRegistryMap.put(UMLPackage.Literals.INFORMATION_FLOW, new ArrayList<AdapterFactory>(Collections.singletonList(portandflowsAdapterFactoryItemProvider)));
-
- /**
- * AdapterFactories for the INSTANCE_SPECIFICATION elements
- */
- adapterFactoryRegistryMap.put(UMLPackage.Literals.INSTANCE_SPECIFICATION, new ArrayList<AdapterFactory>(Collections.singletonList(blocksAdapterFactoryItemProvider)));
-
- /**
- * AdapterFactories for the INTERFACE elements
- */
- adapterFactoryRegistryMap.put(UMLPackage.Literals.INTERFACE, new ArrayList<AdapterFactory>(Collections.singletonList(portandflowsAdapterFactoryItemProvider)));
-
- /**
- * AdapterFactories for the NAMED_ELEMENT elements
- */
- adapterFactoryRegistryMap.put(UMLPackage.Literals.NAMED_ELEMENT, new ArrayList<AdapterFactory>(Collections.singletonList(requirementsAdapterFactoryItemProvider)));
-
- adapterFactoryRegistryMap.get(UMLPackage.Literals.NAMED_ELEMENT).add(allocationsAdapterFactoryItemProvider);
-
- /**
- * AdapterFactories for the OBJECT_NODE elements
- */
- adapterFactoryRegistryMap.put(UMLPackage.Literals.OBJECT_NODE, new ArrayList<AdapterFactory>(Collections.singletonList(activitiesAdapterFactoryItemProvider)));
-
- /**
- * AdapterFactories for the OPERATION elements
- */
- adapterFactoryRegistryMap.put(UMLPackage.Literals.OPERATION, new ArrayList<AdapterFactory>(Collections.singletonList(requirementsAdapterFactoryItemProvider)));
-
- adapterFactoryRegistryMap.get(UMLPackage.Literals.OPERATION).add(activitiesAdapterFactoryItemProvider);
-
- /**
- * AdapterFactories for the PACKAGE elements
- */
- adapterFactoryRegistryMap.put(UMLPackage.Literals.PACKAGE, new ArrayList<AdapterFactory>(Collections.singletonList(modelelementsAdapterFactoryItemProvider)));
-
- /**
- * AdapterFactories for the PARAMETER elements
- */
- adapterFactoryRegistryMap.put(UMLPackage.Literals.PARAMETER, new ArrayList<AdapterFactory>(Collections.singletonList(activitiesAdapterFactoryItemProvider)));
-
- /**
- * AdapterFactories for the PARAMETER_SET elements
- */
- adapterFactoryRegistryMap.put(UMLPackage.Literals.PARAMETER_SET, new ArrayList<AdapterFactory>(Collections.singletonList(activitiesAdapterFactoryItemProvider)));
-
- /**
- * AdapterFactories for the PORT elements
- */
- adapterFactoryRegistryMap.put(UMLPackage.Literals.PORT, new ArrayList<AdapterFactory>(Collections.singletonList(portandflowsAdapterFactoryItemProvider)));
-
- /**
- * AdapterFactories for the PROPERTY elements
- */
- adapterFactoryRegistryMap.put(UMLPackage.Literals.PROPERTY, new ArrayList<AdapterFactory>(Collections.singletonList(portandflowsAdapterFactoryItemProvider)));
-
- adapterFactoryRegistryMap.get(UMLPackage.Literals.PROPERTY).add(constraintsAdapterFactoryItemProvider);
-
- adapterFactoryRegistryMap.get(UMLPackage.Literals.PROPERTY).add(blocksAdapterFactoryItemProvider);
-
- }
-
- /**
- * Singleton holder
- *
- * @generated
- */
- private static class SingletonHolder {
-
- protected static SysmlRegistryAdapterFactoryRegistry instance = null;
- static {
- instance = new SysmlRegistryAdapterFactoryRegistry();
- }
- }
-
- /**
- * @generated
- */
- public static SysmlRegistryAdapterFactoryRegistry getSingleton() {
- return SingletonHolder.instance;
- }
-
- /**
- * Get the default AdapterFactory
- *
- * @return List<AdapterFactory> return the default adapter factory (UML)
- * @generated
- */
- public AdapterFactory getDefaultAdapterFactory() {
- return defaultAdapterFactory;
- }
-
- /**
- * Get the list of all AdapterFactory for this type
- *
- * @param Object
- * element
- * @return List<AdapterFactory> List of all the adapter factories which can handle the object element
- * @generated
- */
- public List<AdapterFactory> getAdapterFactoriesForType(Object element) {
- if (element instanceof EObject) {
- EObject eObject = (EObject) element;
- ArrayList<AdapterFactory> result = adapterFactoryRegistryMap.get(eObject.eClass());
- if (result != null) {
- return result;
- } else {
- return Collections.singletonList(getDefaultAdapterFactory());
- }
- } else {
- throw new RuntimeException("org.eclipse.papyrus.sysml.edit.utils.SysmlRegistryAdapterFactoryRegistery : This factory only works with EOBjects");
- }
- }
-
- /**
- * Set the the root AdapterFactory for all registered adapter factory
- *
- * @param AdapterFactory
- * The adapter factory which will be the root
- * @generated
- */
- public void setRootAdapterFactory(IRootAdapterFactory adapter) {
- for (AdapterFactory adap : adapterFactoryRegistry) {
- if (adap instanceof IComposableAdapterFactory) {
- ((IComposableAdapterFactory) adap).setRootAdapterFactory(adapter);
- }
- }
- }
-
- /**
- * Get a map of all UML ItemProvider needed
- *
- * @generated
- */
- public HashMap<EClass, ItemProviderAdapter> getUMLItemProviderClassifedByUMLElement(AdapterFactory rootAdapterFactory) {
- HashMap<EClass, ItemProviderAdapter> result = new HashMap<EClass, ItemProviderAdapter>();
-
- result.put(UMLPackage.Literals.INSTANCE_SPECIFICATION, new InstanceSpecificationItemProvider(rootAdapterFactory));
-
- result.put(UMLPackage.Literals.CONNECTOR_END, new ConnectorEndItemProvider(rootAdapterFactory));
-
- result.put(UMLPackage.Literals.OPERATION, new OperationItemProvider(rootAdapterFactory));
-
- result.put(UMLPackage.Literals.DEPENDENCY, new DependencyItemProvider(rootAdapterFactory));
-
- result.put(UMLPackage.Literals.OBJECT_NODE, new ObjectNodeItemProvider(rootAdapterFactory));
-
- result.put(UMLPackage.Literals.DATA_TYPE, new DataTypeItemProvider(rootAdapterFactory));
-
- result.put(UMLPackage.Literals.PROPERTY, new PropertyItemProvider(rootAdapterFactory));
-
- result.put(UMLPackage.Literals.BEHAVIOR, new BehaviorItemProvider(rootAdapterFactory));
-
- result.put(UMLPackage.Literals.COMMENT, new CommentItemProvider(rootAdapterFactory));
-
- result.put(UMLPackage.Literals.INTERFACE, new InterfaceItemProvider(rootAdapterFactory));
-
- result.put(UMLPackage.Literals.ABSTRACTION, new AbstractionItemProvider(rootAdapterFactory));
-
- result.put(UMLPackage.Literals.ACTIVITY_PARTITION, new ActivityPartitionItemProvider(rootAdapterFactory));
-
- result.put(UMLPackage.Literals.CONNECTOR, new ConnectorItemProvider(rootAdapterFactory));
-
- result.put(UMLPackage.Literals.PARAMETER_SET, new ParameterSetItemProvider(rootAdapterFactory));
-
- result.put(UMLPackage.Literals.ACTIVITY_EDGE, new ActivityEdgeItemProvider(rootAdapterFactory));
-
- result.put(UMLPackage.Literals.CLASSIFIER, new ClassifierItemProvider(rootAdapterFactory));
-
- result.put(UMLPackage.Literals.NAMED_ELEMENT, new NamedElementItemProvider(rootAdapterFactory));
-
- result.put(UMLPackage.Literals.PARAMETER, new ParameterItemProvider(rootAdapterFactory));
-
- result.put(UMLPackage.Literals.PORT, new PortItemProvider(rootAdapterFactory));
-
- result.put(UMLPackage.Literals.INFORMATION_FLOW, new InformationFlowItemProvider(rootAdapterFactory));
-
- result.put(UMLPackage.Literals.CLASS, new ClassItemProvider(rootAdapterFactory));
-
- result.put(UMLPackage.Literals.PACKAGE, new PackageItemProvider(rootAdapterFactory));
-
- return result;
- }
-
-} // org.eclipse.papyrus.sysml.registry;
-
+/*****************************************************************************
+ * Copyright (c) 2011 Atos.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Atos - Initial API and implementation
+ * Nicolas FAUVERGUE (ALL4TEC) nicolas.fauvergue@all4tec.net - Bug 496905
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.registry;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
+import org.eclipse.papyrus.sysml.activities.provider.ActivitiesItemProviderAdapterFactory;
+import org.eclipse.papyrus.sysml.allocations.provider.AllocationsItemProviderAdapterFactory;
+import org.eclipse.papyrus.sysml.blocks.provider.BlocksItemProviderAdapterFactory;
+import org.eclipse.papyrus.sysml.constraints.provider.ConstraintsItemProviderAdapterFactory;
+import org.eclipse.papyrus.sysml.edit.provider.IComposableAdapterFactory;
+import org.eclipse.papyrus.sysml.edit.provider.IRootAdapterFactory;
+import org.eclipse.papyrus.sysml.modelelements.provider.ModelelementsItemProviderAdapterFactory;
+import org.eclipse.papyrus.sysml.portandflows.provider.PortandflowsItemProviderAdapterFactory;
+import org.eclipse.papyrus.sysml.requirements.provider.RequirementsItemProviderAdapterFactory;
+import org.eclipse.papyrus.uml.internationalization.edit.providers.InternationalizationUMLItemProviderAdapterFactory;
+import org.eclipse.uml2.uml.UMLPackage;
+import org.eclipse.uml2.uml.edit.providers.AbstractionItemProvider;
+import org.eclipse.uml2.uml.edit.providers.ActivityEdgeItemProvider;
+import org.eclipse.uml2.uml.edit.providers.ActivityPartitionItemProvider;
+import org.eclipse.uml2.uml.edit.providers.BehaviorItemProvider;
+import org.eclipse.uml2.uml.edit.providers.ClassItemProvider;
+import org.eclipse.uml2.uml.edit.providers.ClassifierItemProvider;
+import org.eclipse.uml2.uml.edit.providers.CommentItemProvider;
+import org.eclipse.uml2.uml.edit.providers.ConnectorEndItemProvider;
+import org.eclipse.uml2.uml.edit.providers.ConnectorItemProvider;
+import org.eclipse.uml2.uml.edit.providers.DataTypeItemProvider;
+import org.eclipse.uml2.uml.edit.providers.DependencyItemProvider;
+import org.eclipse.uml2.uml.edit.providers.InformationFlowItemProvider;
+import org.eclipse.uml2.uml.edit.providers.InstanceSpecificationItemProvider;
+import org.eclipse.uml2.uml.edit.providers.InterfaceItemProvider;
+import org.eclipse.uml2.uml.edit.providers.NamedElementItemProvider;
+import org.eclipse.uml2.uml.edit.providers.ObjectNodeItemProvider;
+import org.eclipse.uml2.uml.edit.providers.OperationItemProvider;
+import org.eclipse.uml2.uml.edit.providers.PackageItemProvider;
+import org.eclipse.uml2.uml.edit.providers.ParameterItemProvider;
+import org.eclipse.uml2.uml.edit.providers.ParameterSetItemProvider;
+import org.eclipse.uml2.uml.edit.providers.PortItemProvider;
+import org.eclipse.uml2.uml.edit.providers.PropertyItemProvider;
+
+/**
+ * Get a registry of all SysML Adapter Factory classified by the UML class their
+ * correspond.
+ *
+ * Example:
+ *
+ * <Class.class> ->[ModelelementsItemProviderAdapterFactory,
+ * BlocksAdapterItemProviderFactory, RequirementsAdapterItemProviderFactory]
+ *
+ * @generated
+ */
+public class SysmlRegistryAdapterFactoryRegistry {
+
+ /**
+ * Keep track of the item provider of type ModelelementsItemProviderAdapterFactory
+ *
+ * @generated
+ */
+
+ protected ModelelementsItemProviderAdapterFactory modelelementsAdapterFactoryItemProvider;
+
+ /**
+ * Keep track of the item provider of type BlocksItemProviderAdapterFactory
+ *
+ * @generated
+ */
+
+ protected BlocksItemProviderAdapterFactory blocksAdapterFactoryItemProvider;
+
+ /**
+ * Keep track of the item provider of type PortandflowsItemProviderAdapterFactory
+ *
+ * @generated
+ */
+
+ protected PortandflowsItemProviderAdapterFactory portandflowsAdapterFactoryItemProvider;
+
+ /**
+ * Keep track of the item provider of type ConstraintsItemProviderAdapterFactory
+ *
+ * @generated
+ */
+
+ protected ConstraintsItemProviderAdapterFactory constraintsAdapterFactoryItemProvider;
+
+ /**
+ * Keep track of the item provider of type ActivitiesItemProviderAdapterFactory
+ *
+ * @generated
+ */
+
+ protected ActivitiesItemProviderAdapterFactory activitiesAdapterFactoryItemProvider;
+
+ /**
+ * Keep track of the item provider of type AllocationsItemProviderAdapterFactory
+ *
+ * @generated
+ */
+
+ protected AllocationsItemProviderAdapterFactory allocationsAdapterFactoryItemProvider;
+
+ /**
+ * Keep track of the item provider of type RequirementsItemProviderAdapterFactory
+ *
+ * @generated
+ */
+
+ protected RequirementsItemProviderAdapterFactory requirementsAdapterFactoryItemProvider;
+
+ /**
+ * Registry for all SysML AdapterFactory
+ *
+ * @generated
+ */
+ private List<AdapterFactory> adapterFactoryRegistry = new ArrayList<AdapterFactory>(7);
+
+ /**
+ * Registry of all {@link AdapterFactory} classified by corresponding UML element
+ *
+ * @generated
+ */
+ private HashMap<EClass, ArrayList<AdapterFactory>> adapterFactoryRegistryMap = new HashMap<EClass, ArrayList<AdapterFactory>>();
+
+ /**
+ * Default adapterFactory
+ *
+ * @generated
+ */
+ private InternationalizationUMLItemProviderAdapterFactory defaultAdapterFactory = new InternationalizationUMLItemProviderAdapterFactory();
+
+ /**
+ * Constructor + initialize
+ *
+ * @generated
+ */
+ private SysmlRegistryAdapterFactoryRegistry() {
+ /**
+ * Initialize all AdapterFactories
+ */
+
+ modelelementsAdapterFactoryItemProvider = new ModelelementsItemProviderAdapterFactory();
+ adapterFactoryRegistry.add(modelelementsAdapterFactoryItemProvider);
+
+ blocksAdapterFactoryItemProvider = new BlocksItemProviderAdapterFactory();
+ adapterFactoryRegistry.add(blocksAdapterFactoryItemProvider);
+
+ portandflowsAdapterFactoryItemProvider = new PortandflowsItemProviderAdapterFactory();
+ adapterFactoryRegistry.add(portandflowsAdapterFactoryItemProvider);
+
+ constraintsAdapterFactoryItemProvider = new ConstraintsItemProviderAdapterFactory();
+ adapterFactoryRegistry.add(constraintsAdapterFactoryItemProvider);
+
+ activitiesAdapterFactoryItemProvider = new ActivitiesItemProviderAdapterFactory();
+ adapterFactoryRegistry.add(activitiesAdapterFactoryItemProvider);
+
+ allocationsAdapterFactoryItemProvider = new AllocationsItemProviderAdapterFactory();
+ adapterFactoryRegistry.add(allocationsAdapterFactoryItemProvider);
+
+ requirementsAdapterFactoryItemProvider = new RequirementsItemProviderAdapterFactory();
+ adapterFactoryRegistry.add(requirementsAdapterFactoryItemProvider);
+
+ /**
+ * AdapterFactories for the ABSTRACTION elements
+ */
+ adapterFactoryRegistryMap.put(UMLPackage.Literals.ABSTRACTION, new ArrayList<AdapterFactory>(Collections.singletonList(requirementsAdapterFactoryItemProvider)));
+
+ adapterFactoryRegistryMap.get(UMLPackage.Literals.ABSTRACTION).add(allocationsAdapterFactoryItemProvider);
+
+ /**
+ * AdapterFactories for the ACTIVITY_EDGE elements
+ */
+ adapterFactoryRegistryMap.put(UMLPackage.Literals.ACTIVITY_EDGE, new ArrayList<AdapterFactory>(Collections.singletonList(activitiesAdapterFactoryItemProvider)));
+
+ /**
+ * AdapterFactories for the ACTIVITY_PARTITION elements
+ */
+ adapterFactoryRegistryMap.put(UMLPackage.Literals.ACTIVITY_PARTITION, new ArrayList<AdapterFactory>(Collections.singletonList(allocationsAdapterFactoryItemProvider)));
+
+ /**
+ * AdapterFactories for the BEHAVIOR elements
+ */
+ adapterFactoryRegistryMap.put(UMLPackage.Literals.BEHAVIOR, new ArrayList<AdapterFactory>(Collections.singletonList(requirementsAdapterFactoryItemProvider)));
+
+ adapterFactoryRegistryMap.get(UMLPackage.Literals.BEHAVIOR).add(activitiesAdapterFactoryItemProvider);
+
+ /**
+ * AdapterFactories for the CLASS elements
+ */
+ adapterFactoryRegistryMap.put(UMLPackage.Literals.CLASS, new ArrayList<AdapterFactory>(Collections.singletonList(requirementsAdapterFactoryItemProvider)));
+
+ adapterFactoryRegistryMap.get(UMLPackage.Literals.CLASS).add(modelelementsAdapterFactoryItemProvider);
+
+ adapterFactoryRegistryMap.get(UMLPackage.Literals.CLASS).add(constraintsAdapterFactoryItemProvider);
+
+ adapterFactoryRegistryMap.get(UMLPackage.Literals.CLASS).add(blocksAdapterFactoryItemProvider);
+
+ /**
+ * AdapterFactories for the CLASSIFIER elements
+ */
+ adapterFactoryRegistryMap.put(UMLPackage.Literals.CLASSIFIER, new ArrayList<AdapterFactory>(Collections.singletonList(blocksAdapterFactoryItemProvider)));
+
+ /**
+ * AdapterFactories for the COMMENT elements
+ */
+ adapterFactoryRegistryMap.put(UMLPackage.Literals.COMMENT, new ArrayList<AdapterFactory>(Collections.singletonList(modelelementsAdapterFactoryItemProvider)));
+
+ /**
+ * AdapterFactories for the CONNECTOR elements
+ */
+ adapterFactoryRegistryMap.put(UMLPackage.Literals.CONNECTOR, new ArrayList<AdapterFactory>(Collections.singletonList(blocksAdapterFactoryItemProvider)));
+
+ /**
+ * AdapterFactories for the CONNECTOR_END elements
+ */
+ adapterFactoryRegistryMap.put(UMLPackage.Literals.CONNECTOR_END, new ArrayList<AdapterFactory>(Collections.singletonList(blocksAdapterFactoryItemProvider)));
+
+ /**
+ * AdapterFactories for the DATA_TYPE elements
+ */
+ adapterFactoryRegistryMap.put(UMLPackage.Literals.DATA_TYPE, new ArrayList<AdapterFactory>(Collections.singletonList(blocksAdapterFactoryItemProvider)));
+
+ /**
+ * AdapterFactories for the DEPENDENCY elements
+ */
+ adapterFactoryRegistryMap.put(UMLPackage.Literals.DEPENDENCY, new ArrayList<AdapterFactory>(Collections.singletonList(modelelementsAdapterFactoryItemProvider)));
+
+ /**
+ * AdapterFactories for the INFORMATION_FLOW elements
+ */
+ adapterFactoryRegistryMap.put(UMLPackage.Literals.INFORMATION_FLOW, new ArrayList<AdapterFactory>(Collections.singletonList(portandflowsAdapterFactoryItemProvider)));
+
+ /**
+ * AdapterFactories for the INSTANCE_SPECIFICATION elements
+ */
+ adapterFactoryRegistryMap.put(UMLPackage.Literals.INSTANCE_SPECIFICATION, new ArrayList<AdapterFactory>(Collections.singletonList(blocksAdapterFactoryItemProvider)));
+
+ /**
+ * AdapterFactories for the INTERFACE elements
+ */
+ adapterFactoryRegistryMap.put(UMLPackage.Literals.INTERFACE, new ArrayList<AdapterFactory>(Collections.singletonList(portandflowsAdapterFactoryItemProvider)));
+
+ /**
+ * AdapterFactories for the NAMED_ELEMENT elements
+ */
+ adapterFactoryRegistryMap.put(UMLPackage.Literals.NAMED_ELEMENT, new ArrayList<AdapterFactory>(Collections.singletonList(requirementsAdapterFactoryItemProvider)));
+
+ adapterFactoryRegistryMap.get(UMLPackage.Literals.NAMED_ELEMENT).add(allocationsAdapterFactoryItemProvider);
+
+ /**
+ * AdapterFactories for the OBJECT_NODE elements
+ */
+ adapterFactoryRegistryMap.put(UMLPackage.Literals.OBJECT_NODE, new ArrayList<AdapterFactory>(Collections.singletonList(activitiesAdapterFactoryItemProvider)));
+
+ /**
+ * AdapterFactories for the OPERATION elements
+ */
+ adapterFactoryRegistryMap.put(UMLPackage.Literals.OPERATION, new ArrayList<AdapterFactory>(Collections.singletonList(requirementsAdapterFactoryItemProvider)));
+
+ adapterFactoryRegistryMap.get(UMLPackage.Literals.OPERATION).add(activitiesAdapterFactoryItemProvider);
+
+ /**
+ * AdapterFactories for the PACKAGE elements
+ */
+ adapterFactoryRegistryMap.put(UMLPackage.Literals.PACKAGE, new ArrayList<AdapterFactory>(Collections.singletonList(modelelementsAdapterFactoryItemProvider)));
+
+ /**
+ * AdapterFactories for the PARAMETER elements
+ */
+ adapterFactoryRegistryMap.put(UMLPackage.Literals.PARAMETER, new ArrayList<AdapterFactory>(Collections.singletonList(activitiesAdapterFactoryItemProvider)));
+
+ /**
+ * AdapterFactories for the PARAMETER_SET elements
+ */
+ adapterFactoryRegistryMap.put(UMLPackage.Literals.PARAMETER_SET, new ArrayList<AdapterFactory>(Collections.singletonList(activitiesAdapterFactoryItemProvider)));
+
+ /**
+ * AdapterFactories for the PORT elements
+ */
+ adapterFactoryRegistryMap.put(UMLPackage.Literals.PORT, new ArrayList<AdapterFactory>(Collections.singletonList(portandflowsAdapterFactoryItemProvider)));
+
+ /**
+ * AdapterFactories for the PROPERTY elements
+ */
+ adapterFactoryRegistryMap.put(UMLPackage.Literals.PROPERTY, new ArrayList<AdapterFactory>(Collections.singletonList(portandflowsAdapterFactoryItemProvider)));
+
+ adapterFactoryRegistryMap.get(UMLPackage.Literals.PROPERTY).add(constraintsAdapterFactoryItemProvider);
+
+ adapterFactoryRegistryMap.get(UMLPackage.Literals.PROPERTY).add(blocksAdapterFactoryItemProvider);
+
+ }
+
+ /**
+ * Singleton holder
+ *
+ * @generated
+ */
+ private static class SingletonHolder {
+
+ protected static SysmlRegistryAdapterFactoryRegistry instance = null;
+ static {
+ instance = new SysmlRegistryAdapterFactoryRegistry();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public static SysmlRegistryAdapterFactoryRegistry getSingleton() {
+ return SingletonHolder.instance;
+ }
+
+ /**
+ * Get the default AdapterFactory
+ *
+ * @return List<AdapterFactory> return the default adapter factory (UML)
+ * @generated
+ */
+ public AdapterFactory getDefaultAdapterFactory() {
+ return defaultAdapterFactory;
+ }
+
+ /**
+ * Get the list of all AdapterFactory for this type
+ *
+ * @param Object
+ * element
+ * @return List<AdapterFactory> List of all the adapter factories which can handle the object element
+ * @generated
+ */
+ public List<AdapterFactory> getAdapterFactoriesForType(Object element) {
+ if (element instanceof EObject) {
+ EObject eObject = (EObject) element;
+ ArrayList<AdapterFactory> result = adapterFactoryRegistryMap.get(eObject.eClass());
+ if (result != null) {
+ return result;
+ } else {
+ return Collections.singletonList(getDefaultAdapterFactory());
+ }
+ } else {
+ throw new RuntimeException("org.eclipse.papyrus.sysml.edit.utils.SysmlRegistryAdapterFactoryRegistery : This factory only works with EOBjects");
+ }
+ }
+
+ /**
+ * Set the the root AdapterFactory for all registered adapter factory
+ *
+ * @param AdapterFactory
+ * The adapter factory which will be the root
+ * @generated
+ */
+ public void setRootAdapterFactory(IRootAdapterFactory adapter) {
+ for (AdapterFactory adap : adapterFactoryRegistry) {
+ if (adap instanceof IComposableAdapterFactory) {
+ ((IComposableAdapterFactory) adap).setRootAdapterFactory(adapter);
+ }
+ }
+ }
+
+ /**
+ * Get a map of all UML ItemProvider needed
+ *
+ * @generated
+ */
+ public HashMap<EClass, ItemProviderAdapter> getUMLItemProviderClassifedByUMLElement(AdapterFactory rootAdapterFactory) {
+ HashMap<EClass, ItemProviderAdapter> result = new HashMap<EClass, ItemProviderAdapter>();
+
+ result.put(UMLPackage.Literals.INSTANCE_SPECIFICATION, new InstanceSpecificationItemProvider(rootAdapterFactory));
+
+ result.put(UMLPackage.Literals.CONNECTOR_END, new ConnectorEndItemProvider(rootAdapterFactory));
+
+ result.put(UMLPackage.Literals.OPERATION, new OperationItemProvider(rootAdapterFactory));
+
+ result.put(UMLPackage.Literals.DEPENDENCY, new DependencyItemProvider(rootAdapterFactory));
+
+ result.put(UMLPackage.Literals.OBJECT_NODE, new ObjectNodeItemProvider(rootAdapterFactory));
+
+ result.put(UMLPackage.Literals.DATA_TYPE, new DataTypeItemProvider(rootAdapterFactory));
+
+ result.put(UMLPackage.Literals.PROPERTY, new PropertyItemProvider(rootAdapterFactory));
+
+ result.put(UMLPackage.Literals.BEHAVIOR, new BehaviorItemProvider(rootAdapterFactory));
+
+ result.put(UMLPackage.Literals.COMMENT, new CommentItemProvider(rootAdapterFactory));
+
+ result.put(UMLPackage.Literals.INTERFACE, new InterfaceItemProvider(rootAdapterFactory));
+
+ result.put(UMLPackage.Literals.ABSTRACTION, new AbstractionItemProvider(rootAdapterFactory));
+
+ result.put(UMLPackage.Literals.ACTIVITY_PARTITION, new ActivityPartitionItemProvider(rootAdapterFactory));
+
+ result.put(UMLPackage.Literals.CONNECTOR, new ConnectorItemProvider(rootAdapterFactory));
+
+ result.put(UMLPackage.Literals.PARAMETER_SET, new ParameterSetItemProvider(rootAdapterFactory));
+
+ result.put(UMLPackage.Literals.ACTIVITY_EDGE, new ActivityEdgeItemProvider(rootAdapterFactory));
+
+ result.put(UMLPackage.Literals.CLASSIFIER, new ClassifierItemProvider(rootAdapterFactory));
+
+ result.put(UMLPackage.Literals.NAMED_ELEMENT, new NamedElementItemProvider(rootAdapterFactory));
+
+ result.put(UMLPackage.Literals.PARAMETER, new ParameterItemProvider(rootAdapterFactory));
+
+ result.put(UMLPackage.Literals.PORT, new PortItemProvider(rootAdapterFactory));
+
+ result.put(UMLPackage.Literals.INFORMATION_FLOW, new InformationFlowItemProvider(rootAdapterFactory));
+
+ result.put(UMLPackage.Literals.CLASS, new ClassItemProvider(rootAdapterFactory));
+
+ result.put(UMLPackage.Literals.PACKAGE, new PackageItemProvider(rootAdapterFactory));
+
+ return result;
+ }
+
+} // org.eclipse.papyrus.sysml.registry;
+
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.service.types/META-INF/MANIFEST.MF b/plugins/sysml/org.eclipse.papyrus.sysml.service.types/META-INF/MANIFEST.MF
index 561ef56a893..afeb0065e87 100644
--- a/plugins/sysml/org.eclipse.papyrus.sysml.service.types/META-INF/MANIFEST.MF
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.service.types/META-INF/MANIFEST.MF
@@ -8,7 +8,8 @@ Export-Package: org.eclipse.papyrus.sysml.service.types,
org.eclipse.papyrus.sysml.service.types.menu,
org.eclipse.papyrus.sysml.service.types.utils
Require-Bundle: org.eclipse.papyrus.sysml;bundle-version="[1.2.0,2.0.0)",
- org.eclipse.papyrus.uml.service.types.ui;bundle-version="[2.0.0,3.0.0)";visibility:=reexport
+ org.eclipse.papyrus.uml.service.types.ui;bundle-version="[2.0.0,3.0.0)";visibility:=reexport,
+ org.eclipse.papyrus.uml.internationalization.utils;bundle-version="[1.0.0,2.0.0)"
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
Bundle-Version: 2.0.0.qualifier
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/utils/ConnectorUtils.java b/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/utils/ConnectorUtils.java
index 667ac1570ec..3d91efa7de2 100644
--- a/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/utils/ConnectorUtils.java
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/utils/ConnectorUtils.java
@@ -7,8 +7,8 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- *
- * CEA LIST - Initial API and implementation
+ * CEA LIST - Initial API and implementation
+ * Nicolas FAUVERGUE (ALL4TEC) nicolas.fauvergue@all4tec.net - Bug 496905
*
*****************************************************************************/
package org.eclipse.papyrus.sysml.service.types.utils;
@@ -28,6 +28,7 @@ import org.eclipse.emf.ecore.EStructuralFeature.Setting;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.sysml.blocks.Block;
import org.eclipse.papyrus.sysml.blocks.NestedConnectorEnd;
+import org.eclipse.papyrus.uml.internationalization.utils.utils.UMLLabelInternationalization;
import org.eclipse.uml2.uml.ConnectableElement;
import org.eclipse.uml2.uml.Connector;
import org.eclipse.uml2.uml.ConnectorEnd;
@@ -257,7 +258,7 @@ public class ConnectorUtils extends org.eclipse.papyrus.uml.service.types.utils.
* the property name with name delimiter if it is required
*/
public static final String getNameWithQuotes(final NamedElement property) {
- final String partName = property.getName();
+ final String partName = UMLLabelInternationalization.getInstance().getLabel(property);
final StringBuffer partNameBuffer = new StringBuffer();
final Pattern pattern = Pattern.compile(ConnectorUtils.HAS_NO_WORD_CHAR_REGEX);
final Matcher matcher = pattern.matcher(partName);

Back to the top