summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Roldan Betancort2008-12-19 07:11:55 (EST)
committerVictor Roldan Betancort2008-12-19 07:11:55 (EST)
commit55e502264d0c0ea02fed296bebbc8a2354bf69bb (patch)
tree93a828cf2d93da0dd866617a0a7e64d6acc8a5f7
parent96a7f3967147f01f4f2c86372bd89c6a8c182d05 (diff)
downloadcdo-55e502264d0c0ea02fed296bebbc8a2354bf69bb.zip
cdo-55e502264d0c0ea02fed296bebbc8a2354bf69bb.tar.gz
cdo-55e502264d0c0ea02fed296bebbc8a2354bf69bb.tar.bz2
[252167] [UI] CDOEditor Drag And Drop doesn't work the same way Sample Ecore Editor does.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=252167
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOEditor.java42
1 files changed, 42 insertions, 0 deletions
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOEditor.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOEditor.java
index 88c1cfe..156c4ea 100644
--- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOEditor.java
+++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOEditor.java
@@ -7,6 +7,7 @@
*
* Contributors:
* Eike Stepper - initial API and implementation
+ * Victor Roldan Betancort - maintenance
**************************************************************************/
package org.eclipse.emf.cdo.internal.ui.editor;
@@ -40,8 +41,10 @@ import org.eclipse.emf.common.command.BasicCommandStack;
import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.common.command.CommandStack;
import org.eclipse.emf.common.command.CommandStackListener;
+import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.Notifier;
import org.eclipse.emf.common.ui.MarkerHelper;
import org.eclipse.emf.common.ui.editor.ProblemEditorPart;
import org.eclipse.emf.common.ui.viewer.IViewerProvider;
@@ -1037,6 +1040,9 @@ public class CDOEditor extends MultiPageEditorPart implements IEditingDomainProv
ResourceSet resourceSet = view.getResourceSet();
editingDomain = new AdapterFactoryEditingDomain(adapterFactory, commandStack, resourceSet);
+ // This adapter provides the EditingDomain of the Editor
+ resourceSet.eAdapters().add(new EditingDomainProviderAdapter());
+
String resourcePath = editorInput.getResourcePath();
if (resourcePath == null)
{
@@ -2388,4 +2394,40 @@ public class CDOEditor extends MultiPageEditorPart implements IEditingDomainProv
}
}
}
+
+ /**
+ * Adapter that provides the current EditingDomain
+ *
+ * @since 2.0
+ */
+ private class EditingDomainProviderAdapter implements Adapter, IEditingDomainProvider
+ {
+ public boolean isAdapterForType(Object arg0)
+ {
+ if (arg0 == IEditingDomainProvider.class)
+ {
+ return true;
+ }
+ return false;
+ }
+
+ public EditingDomain getEditingDomain()
+ {
+ return editingDomain;
+ }
+
+ public Notifier getTarget()
+ {
+ return null;
+ }
+
+ public void notifyChanged(Notification notification)
+ {
+ }
+
+ public void setTarget(Notifier newTarget)
+ {
+ }
+ }
+
}