Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPauline DEVILLE2017-09-01 14:36:51 +0000
committerJeremie Tatibouet2017-09-04 11:04:09 +0000
commit41640805198e2b0cdef47c02a0225c1659140f1c (patch)
tree19689da2c2fb24c3a91193f5be81ba6433e3cdfb /plugins/uml
parentc4bd7da5e40a44e8adc2bb01d063794bcd7faf41 (diff)
downloadorg.eclipse.papyrus-41640805198e2b0cdef47c02a0225c1659140f1c.tar.gz
org.eclipse.papyrus-41640805198e2b0cdef47c02a0225c1659140f1c.tar.xz
org.eclipse.papyrus-41640805198e2b0cdef47c02a0225c1659140f1c.zip
Bug 521408 - [Core] The property advanced tab should use treeviewer
-Bug fix introduce by https://git.eclipse.org/r/103709 . Can only edit EReference in the advance tab. -Change dialog label Change-Id: I245bc912ad8a66c004c035219e8e0991f4d0924e Signed-off-by: Pauline DEVILLE <pauline.deville@cea.fr>
Diffstat (limited to 'plugins/uml')
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/messages/Messages.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/messages/messages.properties3
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/sheet/UMLPropertySource.java14
3 files changed, 13 insertions, 6 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/messages/Messages.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/messages/Messages.java
index dc570a910dc..ec2603154ac 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/messages/Messages.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/messages/Messages.java
@@ -84,6 +84,8 @@ public class Messages extends NLS {
public static String CreateOrSelectTypeDialog_SelectNewTypeContainerDialogMessage;
+ public static String UMLPropertySource_ElementSelection;
+
static {
// initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/messages/messages.properties b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/messages/messages.properties
index 7986221e649..53259754edc 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/messages/messages.properties
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/messages/messages.properties
@@ -32,4 +32,5 @@ CreateOrSelectTypeDialog_SelectTypeDialogTitle=Type selection
CreateOrSelectTypeDialog_SelectTypeDialogMessage=Select a type
CreateOrSelectTypeDialog_SelectNewTypeContainerDialogTitle=Type container selection
-CreateOrSelectTypeDialog_SelectNewTypeContainerDialogMessage=Select the container for the new type \ No newline at end of file
+CreateOrSelectTypeDialog_SelectNewTypeContainerDialogMessage=Select the container for the new type
+UMLPropertySource_ElementSelection=Element Selection
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/sheet/UMLPropertySource.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/sheet/UMLPropertySource.java
index cf1fd717e06..9af03f38922 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/sheet/UMLPropertySource.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/sheet/UMLPropertySource.java
@@ -34,6 +34,7 @@ import org.eclipse.papyrus.infra.widgets.editors.MultipleValueSelectionDialog;
import org.eclipse.papyrus.infra.widgets.editors.TreeSelectorDialog;
import org.eclipse.papyrus.infra.widgets.providers.UnsetObject;
import org.eclipse.papyrus.infra.widgets.selectors.ReferenceSelector;
+import org.eclipse.papyrus.uml.diagram.common.messages.Messages;
import org.eclipse.papyrus.uml.tools.providers.UMLContentProvider;
import org.eclipse.papyrus.uml.tools.providers.UMLLabelProvider;
import org.eclipse.swt.widgets.Composite;
@@ -87,9 +88,12 @@ public class UMLPropertySource extends PropertySource {
CellEditor result = null;
final Object genericFeature = itemPropertyDescriptor.getFeature(object);
+ if (!(genericFeature instanceof EReference)) {
+ return super.createPropertyEditor(composite);
+ }
// If it is a single reference
- Object initialSelection = ((EObject) object).eGet((EStructuralFeature) genericFeature);
- if (genericFeature instanceof EReference && !((EReference) genericFeature).isMany()) {
+ if (!((EReference) genericFeature).isMany()) {
+ Object initialSelection = ((EObject) object).eGet((EStructuralFeature) genericFeature);
final ILabelProvider editLabelProvider = getEditLabelProvider();
result = new ExtendedDialogCellEditor(composite, editLabelProvider) {
@Override
@@ -97,7 +101,7 @@ public class UMLPropertySource extends PropertySource {
CustomUMLContentProvider provider = new CustomUMLContentProvider((EObject) object, (EStructuralFeature) genericFeature);
provider.addTemporaryElement(UnsetObject.instance);
TreeSelectorDialog dialog = new TreeSelectorDialog(cellEditorWindow.getShell());
- dialog.setTitle("Select type");
+ dialog.setTitle(Messages.UMLPropertySource_ElementSelection);
dialog.setContentProvider(provider);
dialog.setLabelProvider(new UMLLabelProvider());
Object[] selectedValue = { initialSelection };
@@ -131,7 +135,7 @@ public class UMLPropertySource extends PropertySource {
dialog.setInitialElementSelections((List) initialSelection);
dialog.setLabelProvider(new UMLLabelProvider());
dialog.setContextElement(object);
- dialog.setTitle("Element Selection");
+ dialog.setTitle(Messages.UMLPropertySource_ElementSelection);
Object toReturn = null;
if (dialog.open() == Window.OK) {
@@ -178,7 +182,7 @@ public class UMLPropertySource extends PropertySource {
if (element != null) {
result = element.equals(UnsetObject.instance);
// avoid that we can validate on an element that is not owned by the classifier itself
- if ((feature instanceof ENamedElement) && ((ENamedElement) feature).getName().equals("classifierBehavior")) {
+ if ((feature instanceof ENamedElement) && ((ENamedElement) feature).getName().equals("classifierBehavior")) { //$NON-NLS-1$
if (element instanceof EObjectTreeElement) {
return isOwned(object, ((EObjectTreeElement) element).getEObject());
}

Back to the top