Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAsma Smaoui2017-12-05 09:59:20 -0500
committerPatrick Tessier2018-11-23 13:17:28 -0500
commit07059884d867f9b3ae5219b2234220a355ccb0ff (patch)
tree02858192c5bd3d4faeba3542d85e97c2e8e8f0c2
parentf99031e71783b0ad2deee82396d7e43853a8fe4a (diff)
downloadorg.eclipse.papyrus-07059884d867f9b3ae5219b2234220a355ccb0ff.tar.gz
org.eclipse.papyrus-07059884d867f9b3ae5219b2234220a355ccb0ff.tar.xz
org.eclipse.papyrus-07059884d867f9b3ae5219b2234220a355ccb0ff.zip
Bug 528156 - [Model Explorer][New Relation-ship] change the dialog
content provider to include text-filter and an History widget Change-Id: I6819f4c7312830bd529713b513fafdafdbcd7a3d Signed-off-by: Asma Smaoui <asma.smaoui@cea.fr> (cherry picked from commit a08aefe458f053a7783d4c57ac44e4673ceb35ce)
-rw-r--r--plugins/infra/newchild/org.eclipse.papyrus.infra.newchild/src/org/eclipse/papyrus/infra/newchild/CreationMenuFactory.java14
1 files changed, 11 insertions, 3 deletions
diff --git a/plugins/infra/newchild/org.eclipse.papyrus.infra.newchild/src/org/eclipse/papyrus/infra/newchild/CreationMenuFactory.java b/plugins/infra/newchild/org.eclipse.papyrus.infra.newchild/src/org/eclipse/papyrus/infra/newchild/CreationMenuFactory.java
index 7401920e7aa..00054905268 100644
--- a/plugins/infra/newchild/org.eclipse.papyrus.infra.newchild/src/org/eclipse/papyrus/infra/newchild/CreationMenuFactory.java
+++ b/plugins/infra/newchild/org.eclipse.papyrus.infra.newchild/src/org/eclipse/papyrus/infra/newchild/CreationMenuFactory.java
@@ -13,6 +13,7 @@
* CEA LIST - Initial API and implementation
* Patrik Nandorf (Ericsson AB) patrik.nandorf@ericsson.com - Bug 425565
* Christian W. Damus - bug 485220
+ * Asma Smaoui asma.smaoui@cea.fr - bug 528156
*
*****************************************************************************/
package org.eclipse.papyrus.infra.newchild;
@@ -34,6 +35,7 @@ import org.eclipse.emf.ecore.EClassifier;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.gmf.runtime.common.core.command.ICommand;
import org.eclipse.gmf.runtime.emf.type.core.ElementTypeRegistry;
@@ -61,7 +63,9 @@ import org.eclipse.papyrus.infra.services.edit.utils.RequestCacheEntries;
import org.eclipse.papyrus.infra.services.labelprovider.service.LabelProviderService;
import org.eclipse.papyrus.infra.services.semantic.service.SemanticService;
import org.eclipse.papyrus.infra.types.ElementTypeConfiguration;
+import org.eclipse.papyrus.infra.ui.emf.providers.EMFGraphicalContentProvider;
import org.eclipse.papyrus.infra.ui.emf.providers.strategy.SemanticEMFContentProvider;
+import org.eclipse.papyrus.infra.ui.emf.utils.ProviderHelper;
import org.eclipse.papyrus.infra.ui.providers.DelegatingPapyrusContentProvider;
import org.eclipse.papyrus.infra.ui.providers.ISemanticContentProviderFactory;
import org.eclipse.papyrus.infra.widgets.editors.TreeSelectorDialog;
@@ -551,9 +555,10 @@ public class CreationMenuFactory {
.filter(Objects::nonNull)
.reduce(ISemanticContentProviderFactory::compose);
+ ResourceSet rs= eobject.eResource().getResourceSet();
ITreeContentProvider delegate = factory.orElse(SemanticEMFContentProvider::new)
- .createSemanticContentProvider(eobject.eResource().getResourceSet());
-
+ .createSemanticContentProvider(rs);
+
ITreeContentProvider contentProvider = new DelegatingPapyrusContentProvider(delegate) {
@Override
public boolean isValidValue(Object element) {
@@ -579,8 +584,11 @@ public class CreationMenuFactory {
}
};
+
+ EMFGraphicalContentProvider graphicalContentProvider = ProviderHelper.encapsulateProvider(contentProvider, rs, "target");
+
TreeSelectorDialog dialog = new TreeSelectorDialog(Display.getDefault().getActiveShell());
- dialog.setContentProvider(contentProvider);
+ dialog.setContentProvider(graphicalContentProvider);
dialog.setLabelProvider(labelProvider);
dialog.setMessage("Choose the target element");
dialog.setTitle("Target Element Selection");

Back to the top