Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Descher2014-07-16 20:37:35 +0000
committerMarco Descher2014-07-17 20:54:18 +0000
commit94f1a554239e21776e5c3014fb965f61c1d68ebc (patch)
tree384ac266e71e5a812129a7bed9a911ece475c3ff
parent14ced11e3d8ab4e0e6c058a3f6475b1269fc2b1e (diff)
downloadorg.eclipse.e4.tools-I20140717-2200.tar.gz
org.eclipse.e4.tools-I20140717-2200.tar.xz
org.eclipse.e4.tools-I20140717-2200.zip
Bug 429674 - Application Model Editor moves only single element in caseI20140717-2200
multiple elements are selected Signed-off-by: Marco Descher <marco@descher.at>
-rw-r--r--bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/ModelEditor.java18
1 files changed, 14 insertions, 4 deletions
diff --git a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/ModelEditor.java b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/ModelEditor.java
index 78a47c41..dfd00152 100644
--- a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/ModelEditor.java
+++ b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/ModelEditor.java
@@ -8,7 +8,7 @@
* Contributors:
* Tom Schindl <tom.schindl@bestsolution.at> - initial API and implementation
* Wim Jongman <wim.jongman@remainsoftware.com> - Maintenance
- * Marco Descher <marco@descher.at> - Bug395982, 426653, 422465
+ * Marco Descher <marco@descher.at> - Bug395982, 426653, 422465, 429674
* Lars Vogel <Lars.Vogel@gmail.com> - Ongoing maintenance
* Steven Spungin <steven@spungin.tv> - Bug 396902, 431755, 431735, 424730, 424730, 391089, 437236, 437552
******************************************************************************/
@@ -1609,8 +1609,7 @@ public class ModelEditor implements IGotoObject {
@Override
public void dragSetData(DragSourceEvent event) {
IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
- Object o = selection.getFirstElement();
- event.data = o;
+ event.data = selection.toArray();
}
}
@@ -1622,9 +1621,19 @@ public class ModelEditor implements IGotoObject {
this.domain = domain;
}
- @SuppressWarnings("unchecked")
@Override
public boolean performDrop(Object data) {
+ Object[] dropDataArray = (Object[]) data;
+ for (Object object : dropDataArray) {
+ boolean result = performSingleDrop(object);
+ if (!result)
+ return false;
+ }
+ return true;
+ }
+
+ @SuppressWarnings("unchecked")
+ public boolean performSingleDrop(Object data) {
if (getCurrentLocation() == LOCATION_ON) {
EStructuralFeature feature = null;
EObject parent = null;
@@ -1659,6 +1668,7 @@ public class ModelEditor implements IGotoObject {
((MElementContainer<MUIElement>) parent).setSelectedElement((MUIElement) data);
}
}
+ return true;
}
}
} else if (getCurrentLocation() == LOCATION_AFTER || getCurrentLocation() == LOCATION_BEFORE) {

Back to the top