Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Lorenzo2018-11-05 09:53:19 -0500
committerPatrick Tessier2018-11-27 04:37:56 -0500
commit67608342c715324e60e646f6ed9b62c3f4ffd8d8 (patch)
tree8c1e932a4122fb243260f5402e06de1eaed0ed18
parentdf37716b50a1de5ce5123801ce6e584ad10a26f0 (diff)
downloadorg.eclipse.papyrus-67608342c715324e60e646f6ed9b62c3f4ffd8d8.tar.gz
org.eclipse.papyrus-67608342c715324e60e646f6ed9b62c3f4ffd8d8.tar.xz
org.eclipse.papyrus-67608342c715324e60e646f6ed9b62c3f4ffd8d8.zip
Bug 540879: [Properties] Clean code of Observable and neighbours classes
- oep.infra.emf.appearance plugin now use java 1.8 - fix some pom.xml files - add some non-nls marker - remove some possible NPE Change-Id: I68ad6b1384871438979c101dcc85b3f79994f9fd Signed-off-by: Vincent Lorenzo <vincent.lorenzo@cea.fr>
-rw-r--r--plugins/infra/emf/org.eclipse.papyrus.infra.emf.appearance/.classpath2
-rw-r--r--plugins/infra/emf/org.eclipse.papyrus.infra.emf.appearance/.settings/org.eclipse.jdt.core.prefs6
-rw-r--r--plugins/infra/emf/org.eclipse.papyrus.infra.emf.appearance/META-INF/MANIFEST.MF2
-rw-r--r--plugins/infra/emf/org.eclipse.papyrus.infra.emf.appearance/pom.xml3
-rw-r--r--plugins/infra/emf/org.eclipse.papyrus.infra.emf.appearance/src/org/eclipse/papyrus/infra/emf/appearance/commands/SetLayoutKindCommand.java2
-rw-r--r--plugins/infra/emf/org.eclipse.papyrus.infra.emf.appearance/src/org/eclipse/papyrus/infra/emf/appearance/commands/SetNameLabelIconCommand.java2
-rw-r--r--plugins/infra/emf/org.eclipse.papyrus.infra.emf.appearance/src/org/eclipse/papyrus/infra/emf/appearance/commands/SetQualifiedNameDepthCommand.java2
-rw-r--r--plugins/infra/emf/org.eclipse.papyrus.infra.emf.appearance/src/org/eclipse/papyrus/infra/emf/appearance/commands/SetShadowFigureCommand.java2
-rw-r--r--plugins/infra/emf/org.eclipse.papyrus.infra.emf.appearance/src/org/eclipse/papyrus/infra/emf/appearance/helper/AppearanceHelper.java2
-rw-r--r--plugins/infra/emf/org.eclipse.papyrus.infra.emf.appearance/src/org/eclipse/papyrus/infra/emf/appearance/helper/VisualInformationPapyrusConstants.java26
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/pom.xml3
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/databinding/custom/CustomBooleanStyleObservableValue.java2
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/databinding/custom/CustomDoubleStyleObservableValue.java7
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/databinding/custom/CustomEObjectStyleObservableValue.java2
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/databinding/custom/CustomIntStyleObservableValue.java2
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/databinding/custom/CustomStringStyleObservableValue.java2
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/databinding/DoubleDiagramViewObservaleValue.java15
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/databinding/RulersUnitObservableValue.java14
-rw-r--r--plugins/infra/services/org.eclipse.papyrus.infra.services.edit.ui/src/org/eclipse/papyrus/infra/services/edit/ui/databinding/PapyrusObservableList.java2
-rw-r--r--plugins/infra/services/org.eclipse.papyrus.infra.services.edit.ui/src/org/eclipse/papyrus/infra/services/edit/ui/databinding/PapyrusObservableValue.java2
-rw-r--r--plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/databinding/AppliedCommentsObservableList.java4
-rw-r--r--plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/databinding/ImportedPackageLocationObservableValue.java3
-rw-r--r--plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/datatype/StringDataTypeObservableValue.java2
-rw-r--r--plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/messages/Messages.java2
-rw-r--r--plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/messages/messages.properties1
-rw-r--r--plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/commands/UndefineProfileCommand.java14
-rw-r--r--plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/ExtensionRequiredObservableValue.java2
-rw-r--r--plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/NamedElementValidator.java2
-rw-r--r--plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/OwnedAttributeHelper.java60
-rw-r--r--plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/OwnerObservableValue.java2
-rw-r--r--plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/PapyrusObservableList.java2
-rw-r--r--plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/PapyrusObservableValue.java6
-rw-r--r--plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/ProfileApplicationObservableList.java2
-rw-r--r--plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/ProvidedInterfaceObservableList.java2
-rw-r--r--plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/RequiredInterfaceObservableList.java2
-rw-r--r--plugins/views/properties/org.eclipse.papyrus.views.properties.toolsmiths/src/org/eclipse/papyrus/views/properties/toolsmiths/modelelement/GenericAttributeObservable.java2
-rw-r--r--tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/utils/ObservableListTest.java70
37 files changed, 180 insertions, 98 deletions
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.appearance/.classpath b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.appearance/.classpath
index 64c5e31b7a2..eca7bdba8f0 100644
--- a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.appearance/.classpath
+++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.appearance/.classpath
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.appearance/.settings/org.eclipse.jdt.core.prefs b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.appearance/.settings/org.eclipse.jdt.core.prefs
index 15d5f917b9c..74c6d08d7e4 100644
--- a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.appearance/.settings/org.eclipse.jdt.core.prefs
+++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.appearance/.settings/org.eclipse.jdt.core.prefs
@@ -1,16 +1,16 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.release=disabled
-org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.appearance/META-INF/MANIFEST.MF b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.appearance/META-INF/MANIFEST.MF
index 6497ee897ce..44a023391c1 100644
--- a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.appearance/META-INF/MANIFEST.MF
+++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.appearance/META-INF/MANIFEST.MF
@@ -13,5 +13,5 @@ Bundle-Name: %Bundle-Name
Bundle-Activator: org.eclipse.papyrus.infra.emf.appearance.Activator
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.eclipse.papyrus.infra.emf.appearance;singleton:=true
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Automatic-Module-Name: org.eclipse.papyrus.infra.emf.appearance
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.appearance/pom.xml b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.appearance/pom.xml
index 0ba1a6c3e23..720b0a25eca 100644
--- a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.appearance/pom.xml
+++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.appearance/pom.xml
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<project>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>org.eclipse.papyrus.infra-emf</artifactId>
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.appearance/src/org/eclipse/papyrus/infra/emf/appearance/commands/SetLayoutKindCommand.java b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.appearance/src/org/eclipse/papyrus/infra/emf/appearance/commands/SetLayoutKindCommand.java
index eda486e1d4f..476259dd57d 100644
--- a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.appearance/src/org/eclipse/papyrus/infra/emf/appearance/commands/SetLayoutKindCommand.java
+++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.appearance/src/org/eclipse/papyrus/infra/emf/appearance/commands/SetLayoutKindCommand.java
@@ -41,7 +41,7 @@ public class SetLayoutKindCommand extends CreateEAnnotationCommand {
*/
public SetLayoutKindCommand(TransactionalEditingDomain domain, EModelElement object, String layoutKind) {
super(domain, object, VisualInformationPapyrusConstants.LAYOUTFIGURE);
- this.layoutKind = "" + layoutKind;
+ this.layoutKind = layoutKind;
}
/**
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.appearance/src/org/eclipse/papyrus/infra/emf/appearance/commands/SetNameLabelIconCommand.java b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.appearance/src/org/eclipse/papyrus/infra/emf/appearance/commands/SetNameLabelIconCommand.java
index 1c8f1bbd11f..c3e59552fec 100644
--- a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.appearance/src/org/eclipse/papyrus/infra/emf/appearance/commands/SetNameLabelIconCommand.java
+++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.appearance/src/org/eclipse/papyrus/infra/emf/appearance/commands/SetNameLabelIconCommand.java
@@ -41,7 +41,7 @@ public class SetNameLabelIconCommand extends CreateEAnnotationCommand {
*/
public SetNameLabelIconCommand(TransactionalEditingDomain domain, EModelElement object, boolean displayIcon) {
super(domain, object, VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON);
- this.displayIcon = "" + displayIcon;
+ this.displayIcon = String.valueOf(displayIcon);
}
/**
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.appearance/src/org/eclipse/papyrus/infra/emf/appearance/commands/SetQualifiedNameDepthCommand.java b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.appearance/src/org/eclipse/papyrus/infra/emf/appearance/commands/SetQualifiedNameDepthCommand.java
index 12f8759bee8..53e75c0f19b 100644
--- a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.appearance/src/org/eclipse/papyrus/infra/emf/appearance/commands/SetQualifiedNameDepthCommand.java
+++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.appearance/src/org/eclipse/papyrus/infra/emf/appearance/commands/SetQualifiedNameDepthCommand.java
@@ -41,7 +41,7 @@ public class SetQualifiedNameDepthCommand extends CreateEAnnotationCommand {
*/
public SetQualifiedNameDepthCommand(TransactionalEditingDomain domain, EModelElement object, int depth) {
super(domain, object, VisualInformationPapyrusConstants.QUALIFIED_NAME);
- this.qualifiedNamedepth = "" + depth;
+ this.qualifiedNamedepth = String.valueOf(depth);
}
/**
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.appearance/src/org/eclipse/papyrus/infra/emf/appearance/commands/SetShadowFigureCommand.java b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.appearance/src/org/eclipse/papyrus/infra/emf/appearance/commands/SetShadowFigureCommand.java
index 71d43d53582..d5d20875b17 100644
--- a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.appearance/src/org/eclipse/papyrus/infra/emf/appearance/commands/SetShadowFigureCommand.java
+++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.appearance/src/org/eclipse/papyrus/infra/emf/appearance/commands/SetShadowFigureCommand.java
@@ -41,7 +41,7 @@ public class SetShadowFigureCommand extends CreateEAnnotationCommand {
*/
public SetShadowFigureCommand(TransactionalEditingDomain domain, EModelElement object, boolean shadow) {
super(domain, object, VisualInformationPapyrusConstants.SHADOWFIGURE);
- this.shadowFigure = "" + shadow;
+ this.shadowFigure = String.valueOf(shadow);
}
/**
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.appearance/src/org/eclipse/papyrus/infra/emf/appearance/helper/AppearanceHelper.java b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.appearance/src/org/eclipse/papyrus/infra/emf/appearance/helper/AppearanceHelper.java
index fcbc804109e..1a408fa9b84 100644
--- a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.appearance/src/org/eclipse/papyrus/infra/emf/appearance/helper/AppearanceHelper.java
+++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.appearance/src/org/eclipse/papyrus/infra/emf/appearance/helper/AppearanceHelper.java
@@ -23,7 +23,7 @@ import org.eclipse.papyrus.infra.emf.appearance.style.AppearanceStyleProvider;
public class AppearanceHelper {
- public static final String EXTENSION_ID = Activator.PLUGIN_ID + ".styleProvider";
+ public static final String EXTENSION_ID = Activator.PLUGIN_ID + ".styleProvider"; //$NON-NLS-1$
private static AppearanceStyleProvider styleProvider = findStyleProvider();
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.appearance/src/org/eclipse/papyrus/infra/emf/appearance/helper/VisualInformationPapyrusConstants.java b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.appearance/src/org/eclipse/papyrus/infra/emf/appearance/helper/VisualInformationPapyrusConstants.java
index 9c846a59707..6c88acc6c75 100644
--- a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.appearance/src/org/eclipse/papyrus/infra/emf/appearance/helper/VisualInformationPapyrusConstants.java
+++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.appearance/src/org/eclipse/papyrus/infra/emf/appearance/helper/VisualInformationPapyrusConstants.java
@@ -17,22 +17,22 @@ package org.eclipse.papyrus.infra.emf.appearance.helper;
public interface VisualInformationPapyrusConstants {
/** The qualified name. */
- public static String QUALIFIED_NAME = "QualifiedName";
+ public static String QUALIFIED_NAME = "QualifiedName"; //$NON-NLS-1$
/** The qualified name depth. */
- public static String QUALIFIED_NAME_DEPTH = "QualifiedNameDepth";
+ public static String QUALIFIED_NAME_DEPTH = "QualifiedNameDepth"; //$NON-NLS-1$
- public static String SHADOWFIGURE = "ShadowFigure";
+ public static String SHADOWFIGURE = "ShadowFigure"; //$NON-NLS-1$
- public static String SHADOWFIGURE_VALUE = "ShadowFigure_Value";
+ public static String SHADOWFIGURE_VALUE = "ShadowFigure_Value"; //$NON-NLS-1$
- public static String DISPLAY_NAMELABELICON = "displayNameLabelIcon";
+ public static String DISPLAY_NAMELABELICON = "displayNameLabelIcon"; //$NON-NLS-1$
- public static String DISPLAY_NAMELABELICON_VALUE = "displayNameLabelIcon_value";
+ public static String DISPLAY_NAMELABELICON_VALUE = "displayNameLabelIcon_value"; //$NON-NLS-1$
- public static String LAYOUTFIGURE = "layoutFigure";
+ public static String LAYOUTFIGURE = "layoutFigure"; //$NON-NLS-1$
- public static String LAYOUTFIGURE_VALUE = "layoutFigure_value";
+ public static String LAYOUTFIGURE_VALUE = "layoutFigure_value"; //$NON-NLS-1$
/**
* key for the appearance of properties or other specific display
@@ -40,21 +40,21 @@ public interface VisualInformationPapyrusConstants {
* @deprecated Use a StringListValueStyle instead. See {{@link #CUSTOM_MASK_LABEL}
*/
@Deprecated
- public static final String CUSTOM_APPEARENCE_ANNOTATION = "CustomAppearance_Annotation";
+ public static final String CUSTOM_APPEARENCE_ANNOTATION = "CustomAppearance_Annotation"; //$NON-NLS-1$
/**
* The name of the StringListValueStyle used for storing MaskLabels
*
* Replaces the former int-based EAnnotation ({@link #CUSTOM_APPEARENCE_ANNOTATION}, {@link #CUSTOM_APPEARANCE_MASK_VALUE})
*/
- public static final String CUSTOM_MASK_LABEL = "maskLabel";
+ public static final String CUSTOM_MASK_LABEL = "maskLabel"; //$NON-NLS-1$
/**
* this is a key of eAnnnotation that contains hypertext link or referenced document
**/
- public static final String HYPERLINK_DIAGRAM = "PapyrusHyperLink_Diagram";
+ public static final String HYPERLINK_DIAGRAM = "PapyrusHyperLink_Diagram"; //$NON-NLS-1$
- public static final String HYPERLINK_DIAGRAM_NAME = "diagram_name";
+ public static final String HYPERLINK_DIAGRAM_NAME = "diagram_name"; //$NON-NLS-1$
/**
* key for the appearance of properties or other specific display
@@ -62,5 +62,5 @@ public interface VisualInformationPapyrusConstants {
* @deprecated Use a StringListValueStyle instead. See {{@link #CUSTOM_MASK_LABEL}
*/
@Deprecated
- public static final String CUSTOM_APPEARANCE_MASK_VALUE = "CustomAppearance_MaskValue";
+ public static final String CUSTOM_APPEARANCE_MASK_VALUE = "CustomAppearance_MaskValue"; //$NON-NLS-1$
}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/pom.xml b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/pom.xml
index f060d90a431..3a1e20307a3 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/pom.xml
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/pom.xml
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<project>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.eclipse.papyrus</groupId>
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/databinding/custom/CustomBooleanStyleObservableValue.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/databinding/custom/CustomBooleanStyleObservableValue.java
index 53880fc4533..0b7ee484319 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/databinding/custom/CustomBooleanStyleObservableValue.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/databinding/custom/CustomBooleanStyleObservableValue.java
@@ -46,6 +46,6 @@ public class CustomBooleanStyleObservableValue extends AbstractCustomStyleObserv
if (value instanceof Boolean) {
return super.getCommand(value);
}
- throw new IllegalArgumentException("The value " + value + " is not a valid Boolean Value");
+ throw new IllegalArgumentException(String.format("The value %s is not a valid Boolean Value", value == null ? "null" : value.toString())); //$NON-NLS-1$ //$NON-NLS-2$
}
}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/databinding/custom/CustomDoubleStyleObservableValue.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/databinding/custom/CustomDoubleStyleObservableValue.java
index 1b98ea31d09..f8d84bcfd1f 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/databinding/custom/CustomDoubleStyleObservableValue.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/databinding/custom/CustomDoubleStyleObservableValue.java
@@ -10,7 +10,7 @@
*
* Contributors:
* Fanch BONNABESSE (ALL4TEC) fanch.bonnabesse@all4tec.net - Initial API and implementation
- *
+ *
*****************************************************************************/
package org.eclipse.papyrus.infra.gmfdiag.common.databinding.custom;
@@ -25,6 +25,7 @@ import org.eclipse.gmf.runtime.notation.View;
/**
*
* Implementation for an ObservableValue associated to a GMF custom style (DoubleValueStyle).
+ *
* @since 3.0
*
*/
@@ -36,7 +37,7 @@ public class CustomDoubleStyleObservableValue extends AbstractCustomStyleObserva
private final static double DEFAULT_VALUE = 0.0;
/**
- *
+ *
* Constructor.
*
* @param source
@@ -85,6 +86,6 @@ public class CustomDoubleStyleObservableValue extends AbstractCustomStyleObserva
BigDecimal number = new BigDecimal((Float) value);
return super.getCommand(number.doubleValue());
}
- throw new IllegalArgumentException("The value " + value + " is not a valid Double Value"); //$NON-NLS-1$ //$NON-NLS-2$
+ throw new IllegalArgumentException(String.format("The value %s is not a valid Double Value", value == null ? "null" : value.toString())); //$NON-NLS-1$ //$NON-NLS-2$
}
}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/databinding/custom/CustomEObjectStyleObservableValue.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/databinding/custom/CustomEObjectStyleObservableValue.java
index 034102a9969..79bfc374a20 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/databinding/custom/CustomEObjectStyleObservableValue.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/databinding/custom/CustomEObjectStyleObservableValue.java
@@ -47,6 +47,6 @@ public class CustomEObjectStyleObservableValue extends AbstractCustomStyleObserv
if (value instanceof EObject) {
return super.getCommand(value);
}
- throw new IllegalArgumentException("The value " + value + " is not a valid EObject Value");
+ throw new IllegalArgumentException(String.format("The value %s is not a valid EObject Value", value == null ? "null" : value.toString())); //$NON-NLS-1$ //$NON-NLS-2$
}
}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/databinding/custom/CustomIntStyleObservableValue.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/databinding/custom/CustomIntStyleObservableValue.java
index d7019348dd3..1435025c9c0 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/databinding/custom/CustomIntStyleObservableValue.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/databinding/custom/CustomIntStyleObservableValue.java
@@ -46,6 +46,6 @@ public class CustomIntStyleObservableValue extends AbstractCustomStyleObservable
if (value instanceof Integer) {
return super.getCommand(value);
}
- throw new IllegalArgumentException("The value " + value + " is not a valid Integer Value");
+ throw new IllegalArgumentException(String.format("The value %s is not a valid Integer Value", value == null ? "null" : value.toString())); //$NON-NLS-1$ //$NON-NLS-2$ s
}
}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/databinding/custom/CustomStringStyleObservableValue.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/databinding/custom/CustomStringStyleObservableValue.java
index 1df00e27f3c..8ec8ded06dc 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/databinding/custom/CustomStringStyleObservableValue.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/databinding/custom/CustomStringStyleObservableValue.java
@@ -46,6 +46,6 @@ public class CustomStringStyleObservableValue extends AbstractCustomStyleObserva
if (value instanceof String) {
return super.getCommand(value);
}
- throw new IllegalArgumentException("The value " + value + " is not a valid String Value");
+ throw new IllegalArgumentException(String.format("The value %s is not a valid String Value", value == null ? "null" : value.toString())); //$NON-NLS-1$ //$NON-NLS-2$
}
}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/databinding/DoubleDiagramViewObservaleValue.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/databinding/DoubleDiagramViewObservaleValue.java
index 651dfb4d955..1bc4de65bb4 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/databinding/DoubleDiagramViewObservaleValue.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/databinding/DoubleDiagramViewObservaleValue.java
@@ -1,3 +1,17 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
package org.eclipse.papyrus.infra.gmfdiag.properties.databinding;
import org.eclipse.core.databinding.observable.value.ValueDiff;
@@ -33,6 +47,7 @@ public class DoubleDiagramViewObservaleValue extends AbstractDiagramPreferencesO
*
* @return
*/
+ @Override
public final Object getValueType() {
return EcorePackage.eINSTANCE.getEFloat();
}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/databinding/RulersUnitObservableValue.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/databinding/RulersUnitObservableValue.java
index 4bf1cec5f3a..980ce299b06 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/databinding/RulersUnitObservableValue.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/databinding/RulersUnitObservableValue.java
@@ -1,3 +1,17 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
package org.eclipse.papyrus.infra.gmfdiag.properties.databinding;
import java.text.NumberFormat;
diff --git a/plugins/infra/services/org.eclipse.papyrus.infra.services.edit.ui/src/org/eclipse/papyrus/infra/services/edit/ui/databinding/PapyrusObservableList.java b/plugins/infra/services/org.eclipse.papyrus.infra.services.edit.ui/src/org/eclipse/papyrus/infra/services/edit/ui/databinding/PapyrusObservableList.java
index f809145b6c9..e7365290ac3 100644
--- a/plugins/infra/services/org.eclipse.papyrus.infra.services.edit.ui/src/org/eclipse/papyrus/infra/services/edit/ui/databinding/PapyrusObservableList.java
+++ b/plugins/infra/services/org.eclipse.papyrus.infra.services.edit.ui/src/org/eclipse/papyrus/infra/services/edit/ui/databinding/PapyrusObservableList.java
@@ -87,7 +87,7 @@ public class PapyrusObservableList extends EMFObservableList {
return commandWrapper.apply(provider.getEditCommand(requests.iterator().next()));
}
- CompositeCommand cc = new CompositeCommand("Edit list");
+ CompositeCommand cc = new CompositeCommand("Edit list"); //$NON-NLS-1$
for (IEditCommandRequest request : requests) {
ICommand cmd = provider.getEditCommand(request);
diff --git a/plugins/infra/services/org.eclipse.papyrus.infra.services.edit.ui/src/org/eclipse/papyrus/infra/services/edit/ui/databinding/PapyrusObservableValue.java b/plugins/infra/services/org.eclipse.papyrus.infra.services.edit.ui/src/org/eclipse/papyrus/infra/services/edit/ui/databinding/PapyrusObservableValue.java
index 77cd487defa..520d856a4a2 100644
--- a/plugins/infra/services/org.eclipse.papyrus.infra.services.edit.ui/src/org/eclipse/papyrus/infra/services/edit/ui/databinding/PapyrusObservableValue.java
+++ b/plugins/infra/services/org.eclipse.papyrus.infra.services.edit.ui/src/org/eclipse/papyrus/infra/services/edit/ui/databinding/PapyrusObservableValue.java
@@ -117,7 +117,7 @@ public class PapyrusObservableValue extends EMFObservableValue implements Aggreg
IElementEditService provider = ElementEditServiceUtils.getCommandProvider((EObject)getObserved());
if (provider != null) {
- CompositeCommand cc = new CompositeCommand("Edit value");
+ CompositeCommand cc = new CompositeCommand("Edit value"); //$NON-NLS-1$
if (oldValue instanceof EObject && eStructuralFeature instanceof EReference && ((EReference) eStructuralFeature).isContainment()) {
cc.add(provider.getEditCommand(new DestroyElementRequest((TransactionalEditingDomain) domain, (EObject) oldValue, false)));
diff --git a/plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/databinding/AppliedCommentsObservableList.java b/plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/databinding/AppliedCommentsObservableList.java
index 63df9e2893f..d007d75db67 100644
--- a/plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/databinding/AppliedCommentsObservableList.java
+++ b/plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/databinding/AppliedCommentsObservableList.java
@@ -120,7 +120,7 @@ public class AppliedCommentsObservableList extends PapyrusObservableList {
if (value instanceof Comment) {
- addAppliedCommentCommand = new CompoundCommand("Add applied comment");
+ addAppliedCommentCommand = new CompoundCommand("Add applied comment"); //$NON-NLS-1$
// Add the comment to source#ownedComment
SetRequest setRequest = new SetRequest((TransactionalEditingDomain) editingDomain, source, feature, value);
@@ -179,7 +179,7 @@ public class AppliedCommentsObservableList extends PapyrusObservableList {
public Command getRemoveAllCommand(Collection<?> values) {
Iterator<?> itr = values.iterator();
Element value;
- CompoundCommand removeAppliedCommentCommand = new CompoundCommand("Remove applied comment");
+ CompoundCommand removeAppliedCommentCommand = new CompoundCommand("Remove applied comment"); //$NON-NLS-1$
while (itr.hasNext()) {
value = (Element) itr.next();
Assert.isTrue(value instanceof Comment);
diff --git a/plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/databinding/ImportedPackageLocationObservableValue.java b/plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/databinding/ImportedPackageLocationObservableValue.java
index 4042517dccf..1cd5b629427 100644
--- a/plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/databinding/ImportedPackageLocationObservableValue.java
+++ b/plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/databinding/ImportedPackageLocationObservableValue.java
@@ -17,6 +17,7 @@ package org.eclipse.papyrus.uml.properties.databinding;
import org.eclipse.core.databinding.observable.value.AbstractObservableValue;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.papyrus.uml.properties.messages.Messages;
import org.eclipse.uml2.uml.Package;
/**
@@ -28,7 +29,7 @@ import org.eclipse.uml2.uml.Package;
public class ImportedPackageLocationObservableValue extends AbstractObservableValue {
/** The Constant UNKNOWN_LOCATION. */
- private static final String UNKNOWN_LOCATION = "Unknown";
+ private static final String UNKNOWN_LOCATION = Messages.ImportedPackageLocationObservableValue_Unknown;
/** The imported package. */
private Package importedPackage = null;
diff --git a/plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/datatype/StringDataTypeObservableValue.java b/plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/datatype/StringDataTypeObservableValue.java
index 4e7cdfce469..ebb85ab741f 100644
--- a/plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/datatype/StringDataTypeObservableValue.java
+++ b/plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/datatype/StringDataTypeObservableValue.java
@@ -42,6 +42,6 @@ public class StringDataTypeObservableValue extends PapyrusObservableValue implem
@Override
public String toString() {
- return getValue() == null ? "" : getValue().toString();
+ return getValue() == null ? "" : getValue().toString(); //$NON-NLS-1$
}
}
diff --git a/plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/messages/Messages.java b/plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/messages/Messages.java
index 78a0ce4e1cb..c90e2d1f5f8 100644
--- a/plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/messages/Messages.java
+++ b/plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/messages/Messages.java
@@ -41,6 +41,8 @@ public class Messages extends NLS {
public static String ExpressionEditor_BodyLabel;
+ public static String ImportedPackageLocationObservableValue_Unknown;
+
public static String ProfileApplicationEditor_ApplyProfile;
public static String ProfileApplicationEditor_ApplyProfilesDialogDescription;
diff --git a/plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/messages/messages.properties b/plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/messages/messages.properties
index af95abc6a7e..0d18af0101e 100644
--- a/plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/messages/messages.properties
+++ b/plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/messages/messages.properties
@@ -17,6 +17,7 @@ UMLNotationModelElement_DepthNone=None
ExpressionLanguageFactory_EditLanguage=Edit language
ExpressionLanguageFactory_LanguageDuplicateError=The same language cannot be used more than once
ExpressionLanguageFactory_SetNewLanguage=Set the new language
+ImportedPackageLocationObservableValue_Unknown=Unknown
MultiplicityPreference_MultiplicityEditor=Multiplicity Editor
MultiplicityPreference_SimpleModeDescription= is the edition of lower and upper values by one editor.
MultiplicityPreference_AdvancedModeDescription= is the edition of lower and upper values by two editors.
diff --git a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/commands/UndefineProfileCommand.java b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/commands/UndefineProfileCommand.java
index c7b11b1bdde..6e168a7b7da 100644
--- a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/commands/UndefineProfileCommand.java
+++ b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/commands/UndefineProfileCommand.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2015 CEA LIST and others.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,7 +10,7 @@
*
* Contributors:
* Gabriel Pascual (ALL4TEC) gabriel.pascual@all4tec.net - Initial API and implementation
- *
+ *
*****************************************************************************/
package org.eclipse.papyrus.uml.tools.commands;
@@ -35,17 +35,15 @@ import org.eclipse.uml2.uml.util.UMLUtil;
/**
* Removed all Profile Definitions of all Profile model.
- *
+ *
* @author Gabriel Pascual
+ * @since 4.1
*
*/
public class UndefineProfileCommand extends RecordingCommand {
- /** The Constant DECORATION_PROFILE_SERVICE_ERROR. */
- private static final String DECORATION_PROFILE_SERVICE_ERROR = "Impossible to display decoration warning for Profile"; //$NON-NLS-1$
-
/** The Constant COMMAND_TITLE. */
- private static final String COMMAND_TITLE = "Undefine Profile";
+ private static final String COMMAND_TITLE = "Undefine Profile"; //$NON-NLS-1$
/** The profile definition. */
private final PapyrusDefinitionAnnotation profileDefinition;
@@ -70,7 +68,7 @@ public class UndefineProfileCommand extends RecordingCommand {
super(editingDomain, COMMAND_TITLE, null);
this.rootProfile = rootProfile;
this.profileDefinition = annotation;
- profilesStack = new LinkedList<Profile>(Collections.singleton(rootProfile));
+ profilesStack = new LinkedList<>(Collections.singleton(rootProfile));
}
/**
diff --git a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/ExtensionRequiredObservableValue.java b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/ExtensionRequiredObservableValue.java
index 91c5670658d..5d12e8b13a3 100644
--- a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/ExtensionRequiredObservableValue.java
+++ b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/ExtensionRequiredObservableValue.java
@@ -68,7 +68,7 @@ public class ExtensionRequiredObservableValue extends AbstractObservableValue im
Boolean required = (Boolean) value;
if (extension.getOwnedEnds().isEmpty()) {
- Activator.log.warn("Unable to change the extension \"isRequired\" property");
+ Activator.log.warn("Unable to change the extension \"isRequired\" property"); //$NON-NLS-1$
}
observable.setValue(required ? MultiplicityParser.ONE : MultiplicityParser.OPTIONAL);
diff --git a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/NamedElementValidator.java b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/NamedElementValidator.java
index 726050de40c..b131eb0cb82 100644
--- a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/NamedElementValidator.java
+++ b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/NamedElementValidator.java
@@ -69,7 +69,7 @@ public class NamedElementValidator extends AbstractUMLValidator {
EList<NamedElement> listElement = ns.getMembers();
for (NamedElement namedElement : listElement) {
if ((self != namedElement) && !self.isDistinguishableFrom(namedElement, ns)) {
- return warning("Name is indistinguishable from another element in the Namespace");
+ return warning("Name is indistinguishable from another element in the Namespace"); //$NON-NLS-1$
}
}
} finally {
diff --git a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/OwnedAttributeHelper.java b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/OwnedAttributeHelper.java
index cbe58f1ac64..71cd6866ae4 100644
--- a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/OwnedAttributeHelper.java
+++ b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/OwnedAttributeHelper.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2014 CEA LIST and others.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,7 +10,7 @@
*
* Contributors:
* CEA LIST - Initial API and implementation
- *
+ *
*****************************************************************************/
package org.eclipse.papyrus.uml.tools.databinding;
@@ -35,9 +35,26 @@ import org.eclipse.uml2.uml.StructuredClassifier;
import org.eclipse.uml2.uml.Type;
import org.eclipse.uml2.uml.UMLPackage;
+/**
+ *
+ * This class provides methods to set the owner for UML Association
+ *
+ */
public class OwnedAttributeHelper {
- public static EStructuralFeature getFeatureForType(Type type) {
+ /**
+ *
+ * @param type
+ * a UML type
+ * @return
+ * the owned attribute feature for the given type, or <code>null</code> when not found
+ * @since 4.1
+ */
+ public static final EStructuralFeature getOwnedAttributeFeatureForType(final Type type) {
+ if (null == type) {
+ Activator.log.warn("The type is null!"); //$NON-NLS-1$
+ }
+
if (type instanceof StructuredClassifier) {
return UMLPackage.eINSTANCE.getStructuredClassifier_OwnedAttribute();
}
@@ -54,15 +71,42 @@ public class OwnedAttributeHelper {
return UMLPackage.eINSTANCE.getSignal_OwnedAttribute();
}
+
// Unknown type : we try to find the feature reflexively
- Activator.log.warn("Unknown type : " + type.eClass().getName());
+ final String eClassName = type.eClass().getName();
+ Activator.log.warn(String.format("Unknown type : %s", eClassName)); //$NON-NLS-1$
EStructuralFeature feature = type.eClass().getEStructuralFeature("ownedAttribute"); //$NON-NLS-1$
if (feature == null) {
- Activator.log.warn("Cannot find a valid feature for type " + type.eClass().getName());
+ Activator.log.warn(String.format("Cannot find a valid feature for type %s.", eClassName)); //$NON-NLS-1$
}
return feature;
}
-
+
+ /**
+ *
+ * @param type
+ * a UML type
+ * @return
+ * the owned attribute feature for the given type, or <code>null</code> when not found
+ *
+ * @deprecated since 4.1
+ * use org.eclipse.papyrus.uml.tools.databinding.OwnedAttributeHelper.getOwnedAttributeFeatureForType(Type) API instead
+ * This method will be removed in Papyrus 5.0, see bug 540875
+ */
+ @Deprecated
+ public static EStructuralFeature getFeatureForType(Type type) {
+ return getOwnedAttributeFeatureForType(type);
+ }
+
+ /**
+ *
+ * @param association
+ * an association
+ * @param memberEnd
+ * the member end of the association
+ * @return
+ * the command to use to set the owner of the association
+ */
public static ICommand getSetTypeOwnerForAssociationAttributeCommand(Association association, Property memberEnd) {
ICommand command = null;
Type ownerType;
@@ -74,10 +118,10 @@ public class OwnedAttributeHelper {
ownerType = ownerList.get(0);
}
- EStructuralFeature ownedAttributeFeature = getFeatureForType(ownerType);
+ EStructuralFeature ownedAttributeFeature = getOwnedAttributeFeatureForType(ownerType);
if (ownedAttributeFeature != null) {
- List<Property> attributeList = new ArrayList<Property>();
+ List<Property> attributeList = new ArrayList<>();
attributeList.addAll((EList<Property>) ownerType.eGet(ownedAttributeFeature));
attributeList.add(memberEnd);
diff --git a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/OwnerObservableValue.java b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/OwnerObservableValue.java
index 95070ffe783..70db19c0f96 100644
--- a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/OwnerObservableValue.java
+++ b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/OwnerObservableValue.java
@@ -166,7 +166,7 @@ public class OwnerObservableValue extends ReferenceCountedObservable.Value imple
this.currentValue = owner;
return new GMFtoEMFCommandWrapper(command);
} else {
- Activator.log.warn("Cannot modify the memberEnd owner");
+ Activator.log.warn("Cannot modify the memberEnd owner"); //$NON-NLS-1$
}
}
diff --git a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/PapyrusObservableList.java b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/PapyrusObservableList.java
index 25779e34b4b..c693b51a7cd 100644
--- a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/PapyrusObservableList.java
+++ b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/PapyrusObservableList.java
@@ -84,7 +84,7 @@ public class PapyrusObservableList extends EMFObservableList {
return new GMFtoEMFCommandWrapper(provider.getEditCommand(requests.iterator().next()));
}
- CompositeCommand cc = new CompositeCommand("Edit list");
+ CompositeCommand cc = new CompositeCommand("Edit list"); //$NON-NLS-1$
for (IEditCommandRequest request : requests) {
ICommand cmd = provider.getEditCommand(request);
diff --git a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/PapyrusObservableValue.java b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/PapyrusObservableValue.java
index 6f1df275730..71d2df83e84 100644
--- a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/PapyrusObservableValue.java
+++ b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/PapyrusObservableValue.java
@@ -45,7 +45,7 @@ import org.eclipse.papyrus.uml.tools.Activator;
* Papyrus commands
*
* @author Camille Letavernier
- * @deprecated Use the {@link org.eclipse.papyrus.infra.gmfdiag.common.databinding.GMFObservableList} API, instead
+ * @deprecated Use the {@link org.eclipse.papyrus.infra.gmfdiag.common.databinding.GMFObservableValue} API, instead
*/
@Deprecated
public class PapyrusObservableValue extends EMFObservableValue implements AggregatedObservable, CommandBasedObservableValue, ReferenceCountedObservable {
@@ -108,10 +108,10 @@ public class PapyrusObservableValue extends EMFObservableValue implements Aggreg
Object oldValue = getValue();
try {
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider((EObject)getObserved());
+ IElementEditService provider = ElementEditServiceUtils.getCommandProvider((EObject) getObserved());
if (provider != null) {
- CompositeCommand cc = new CompositeCommand("Edit value");
+ CompositeCommand cc = new CompositeCommand("Edit value"); //$NON-NLS-1$
if (oldValue instanceof EObject && eStructuralFeature instanceof EReference && ((EReference) eStructuralFeature).isContainment()) {
cc.add(provider.getEditCommand(new DestroyElementRequest((TransactionalEditingDomain) domain, (EObject) oldValue, false)));
diff --git a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/ProfileApplicationObservableList.java b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/ProfileApplicationObservableList.java
index cd383052c42..e2507a63d7d 100644
--- a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/ProfileApplicationObservableList.java
+++ b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/ProfileApplicationObservableList.java
@@ -278,7 +278,7 @@ public class ProfileApplicationObservableList extends WritableList implements IC
if (element instanceof Profile) {
profiles.add(EMFHelper.reloadIntoContext((Profile) element, umlSource));
} else {
- throw new IllegalArgumentException("The new value should only contain profiles");
+ throw new IllegalArgumentException("The new value should only contain profiles"); //$NON-NLS-1$
}
}
Command command = new ApplyProfileCommand(umlSource, profiles, (TransactionalEditingDomain) domain);
diff --git a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/ProvidedInterfaceObservableList.java b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/ProvidedInterfaceObservableList.java
index 22921b0b8fa..0cfaa80f199 100644
--- a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/ProvidedInterfaceObservableList.java
+++ b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/ProvidedInterfaceObservableList.java
@@ -98,7 +98,7 @@ public class ProvidedInterfaceObservableList extends PapyrusObservableList {
if (current instanceof Interface) {
if (!providedInterfaceList.contains(current)) {
// Added interface
- IEditCommandRequest request = new CreateRelationshipRequest(port.getType(), port.getType(), (EObject) current, ElementTypeRegistry.getInstance().getType("org.eclipse.papyrus.uml.InterfaceRealization"));
+ IEditCommandRequest request = new CreateRelationshipRequest(port.getType(), port.getType(), (EObject) current, ElementTypeRegistry.getInstance().getType("org.eclipse.papyrus.uml.InterfaceRealization")); //$NON-NLS-1$
requests.add(request);
} else {
// Common interfaces
diff --git a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/RequiredInterfaceObservableList.java b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/RequiredInterfaceObservableList.java
index e0ec2bfbe1b..9585acbb9f1 100644
--- a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/RequiredInterfaceObservableList.java
+++ b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/RequiredInterfaceObservableList.java
@@ -94,7 +94,7 @@ public class RequiredInterfaceObservableList extends PapyrusObservableList {
if (!requiredInterfacesList.contains(current)) {
// Added interface
- IEditCommandRequest request = new CreateRelationshipRequest(port.getType().eContainer(), port.getType(), (EObject) current, ElementTypeRegistry.getInstance().getType("org.eclipse.papyrus.uml.Usage"));
+ IEditCommandRequest request = new CreateRelationshipRequest(port.getType().eContainer(), port.getType(), (EObject) current, ElementTypeRegistry.getInstance().getType("org.eclipse.papyrus.uml.Usage")); //$NON-NLS-1$
requests.add(request);
} else {
diff --git a/plugins/views/properties/org.eclipse.papyrus.views.properties.toolsmiths/src/org/eclipse/papyrus/views/properties/toolsmiths/modelelement/GenericAttributeObservable.java b/plugins/views/properties/org.eclipse.papyrus.views.properties.toolsmiths/src/org/eclipse/papyrus/views/properties/toolsmiths/modelelement/GenericAttributeObservable.java
index 189d3687e88..9cdb56f3690 100644
--- a/plugins/views/properties/org.eclipse.papyrus.views.properties.toolsmiths/src/org/eclipse/papyrus/views/properties/toolsmiths/modelelement/GenericAttributeObservable.java
+++ b/plugins/views/properties/org.eclipse.papyrus.views.properties.toolsmiths/src/org/eclipse/papyrus/views/properties/toolsmiths/modelelement/GenericAttributeObservable.java
@@ -127,7 +127,7 @@ public class GenericAttributeObservable extends AbstractObservableValue {
EObject attribute = findAttribute();
EList<? extends EObject> collection = (EList<? extends EObject>) source.eGet(createIn);
- CompoundCommand command = new CompoundCommand(String.format("Set %s value", propertyPath)) {
+ CompoundCommand command = new CompoundCommand(String.format("Set %s value", propertyPath)) { //$NON-NLS-1$
@Override
public boolean prepare() {
diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/utils/ObservableListTest.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/utils/ObservableListTest.java
index dca1a94b232..1bd34621420 100644
--- a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/utils/ObservableListTest.java
+++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/utils/ObservableListTest.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2013 Cedric Dumoulin.
*
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -16,7 +16,10 @@
package org.eclipse.papyrus.infra.core.sasheditor.utils;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
import org.junit.After;
import org.junit.Before;
@@ -27,6 +30,7 @@ import org.junit.Test;
* @author cedric dumoulin
*
*/
+@SuppressWarnings("nls")
public class ObservableListTest {
/**
@@ -59,9 +63,9 @@ public class ObservableListTest {
public void testAddListener() {
ObservableList<String> list = new ObservableList<String>();
assertNotNull("list created", list);
-
- FakeObservableListener<String> listener = new FakeObservableListener<String>();
-
+
+ FakeObservableListener<String> listener = new FakeObservableListener<String>();
+
// add a listener
list.addListener(listener);
// Check if added
@@ -75,9 +79,9 @@ public class ObservableListTest {
public void testRemoveListener() {
ObservableList<String> list = new ObservableList<String>();
assertNotNull("list created", list);
-
- FakeObservableListener<String> listener = new FakeObservableListener<String>();
-
+
+ FakeObservableListener<String> listener = new FakeObservableListener<String>();
+
// add a listener
list.addListener(listener);
// Check if added
@@ -95,16 +99,16 @@ public class ObservableListTest {
public void testFireElementAddedEvent() {
ObservableList<String> list = new ObservableList<String>();
assertNotNull("list created", list);
-
- FakeObservableListener<String> listener = new FakeObservableListener<String>();
-
+
+ FakeObservableListener<String> listener = new FakeObservableListener<String>();
+
// add a listener
list.addListener(listener);
// Check event
-
+
list.fireElementAddedEvent("string1");
- assertEquals( "event fired", "string1", listener.getLastAddEvents() );
-
+ assertEquals("event fired", "string1", listener.getLastAddEvents());
+
}
/**
@@ -114,15 +118,15 @@ public class ObservableListTest {
public void testFireElementRemovedEvent() {
ObservableList<String> list = new ObservableList<String>();
assertNotNull("list created", list);
-
- FakeObservableListener<String> listener = new FakeObservableListener<String>();
-
+
+ FakeObservableListener<String> listener = new FakeObservableListener<String>();
+
// add a listener
list.addListener(listener);
// Check event
String element = "string1";
list.fireElementRemovedEvent(element);
- assertEquals( "event fired", element, listener.getLastRemoveEvents() );
+ assertEquals("event fired", element, listener.getLastRemoveEvents());
}
/**
@@ -132,19 +136,19 @@ public class ObservableListTest {
public void testAdd() {
ObservableList<String> list = new ObservableList<String>();
assertNotNull("list created", list);
-
- FakeObservableListener<String> listener = new FakeObservableListener<String>();
-
+
+ FakeObservableListener<String> listener = new FakeObservableListener<String>();
+
// add a listener
list.addListener(listener);
// Check event
-
+
String element = "string1";
list.add(element);
- assertEquals( "event fired", element, listener.getLastAddEvents() );
- assertEquals( "element added to list", element, list.get(list.size()-1) );
-
+ assertEquals("event fired", element, listener.getLastAddEvents());
+ assertEquals("element added to list", element, list.get(list.size() - 1));
+
}
/**
@@ -154,21 +158,21 @@ public class ObservableListTest {
public void testRemove() {
ObservableList<String> list = new ObservableList<String>();
assertNotNull("list created", list);
-
- FakeObservableListener<String> listener = new FakeObservableListener<String>();
-
+
+ FakeObservableListener<String> listener = new FakeObservableListener<String>();
+
// add a listener
list.addListener(listener);
// Check event
-
+
String element = "string1";
list.add(element);
- assertEquals( "element added to list", element, list.get(list.size()-1) );
+ assertEquals("element added to list", element, list.get(list.size() - 1));
list.remove(element);
- assertFalse( "element removed from list", list.contains(element) );
- assertEquals( "event fired", element, listener.getLastRemoveEvents() );
-
+ assertFalse("element removed from list", list.contains(element));
+ assertEquals("event fired", element, listener.getLastRemoveEvents());
+
}

Back to the top