Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamille Letavernier2014-04-03 13:16:37 -0400
committerCamille Letavernier2014-04-03 13:16:37 -0400
commit03e9731e722278e6a6d64d6144f0038ea3437309 (patch)
tree0eb30190fef42e3bc7fb31a606a07ee028b3947d
parent199d5323303095c78adf9a714aab73c1e5081541 (diff)
downloadorg.eclipse.papyrus-03e9731e722278e6a6d64d6144f0038ea3437309.tar.gz
org.eclipse.papyrus-03e9731e722278e6a6d64d6144f0038ea3437309.tar.xz
org.eclipse.papyrus-03e9731e722278e6a6d64d6144f0038ea3437309.zip
[Releng] (Re-) add EMF Facet to the master build (Required through the
remaining MoDisco dependency)
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/editor/MoDiscoDropAdapter.java22
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/util/ActionUtil.java22
-rw-r--r--releng/org.eclipse.mdt.papyrus.releng.buckminster/papyrus-trunk-nightly/build.rmap8
3 files changed, 30 insertions, 22 deletions
diff --git a/plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/editor/MoDiscoDropAdapter.java b/plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/editor/MoDiscoDropAdapter.java
index 64403b82f2a..efd6d56b7c2 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/editor/MoDiscoDropAdapter.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/editor/MoDiscoDropAdapter.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2010 CEA LIST.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -13,27 +13,27 @@ package org.eclipse.papyrus.customization.properties.editor;
import java.util.Collection;
-import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.emf.edit.ui.dnd.EditingDomainViewerDropAdapter;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.papyrus.customization.properties.util.ActionUtil;
+import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
import org.eclipse.swt.widgets.Widget;
/**
* An adapter for Drag & Drop in the Context editor. The default Ecore drag & drop
* is not compatible with the EMF Facet Tree Elements
- *
+ *
* @author Camille Letavernier
*/
public class MoDiscoDropAdapter extends EditingDomainViewerDropAdapter {
/**
- *
+ *
* Constructor.
- *
+ *
* @param domain
* The Editing domain for this Drop Adapter
* @param viewer
@@ -45,19 +45,19 @@ public class MoDiscoDropAdapter extends EditingDomainViewerDropAdapter {
@Override
protected Collection<?> extractDragSource(Object object) {
- if(object instanceof ISelection)
+ if(object instanceof ISelection) {
return super.extractDragSource(ActionUtil.getAdaptedSelection((ISelection)object));
- else
+ } else {
return super.extractDragSource(object);
+ }
}
@Override
protected Object extractDropTarget(Widget item) {
Object dropTarget = super.extractDropTarget(item);
- if(dropTarget instanceof IAdaptable) {
- Object adapter = ((IAdaptable)dropTarget).getAdapter(EObject.class);
- if(adapter != null)
- return adapter;
+ EObject eObject = EMFHelper.getEObject(dropTarget);
+ if(eObject != null) {
+ return eObject;
}
return dropTarget;
diff --git a/plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/util/ActionUtil.java b/plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/util/ActionUtil.java
index a93321213d0..1d3e003df7d 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/util/ActionUtil.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/util/ActionUtil.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2010 CEA LIST.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -20,12 +20,13 @@ import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
/**
* Utility class for Actions
- *
+ *
* @author Camille Letavernier
- *
+ *
*/
public class ActionUtil {
@@ -36,7 +37,7 @@ public class ActionUtil {
* themselves. This method adapts a collections of such objects to their
* underlying EObjects, so that EMF can handle them.
* Objects that cannot be adapted remain as-is in the collection.
- *
+ *
* @param selection
* The collection to adapt
* @return
@@ -62,7 +63,7 @@ public class ActionUtil {
* themselves. This method adapts a ISelection of such objects to their
* underlying EObjects, so that EMF can handle them.
* Objects that cannot be adapted remain as-is in the selection.
- *
+ *
* @param sourceSelection
* The selection to adapt
* @return
@@ -76,12 +77,11 @@ public class ActionUtil {
Iterator<?> it = currentSelection.iterator();
while(it.hasNext()) {
Object object = it.next();
- if(object instanceof IAdaptable) {
- EObject eObject = (EObject)((IAdaptable)object).getAdapter(EObject.class);
- if(eObject != null)
- newSelection.add(eObject);
- else
- newSelection.add(object);
+ EObject eObject = EMFHelper.getEObject(object);
+ if(eObject != null) {
+ newSelection.add(eObject);
+ } else {
+ newSelection.add(object);
}
}
diff --git a/releng/org.eclipse.mdt.papyrus.releng.buckminster/papyrus-trunk-nightly/build.rmap b/releng/org.eclipse.mdt.papyrus.releng.buckminster/papyrus-trunk-nightly/build.rmap
index b3a7c55c245..fe633c83c75 100644
--- a/releng/org.eclipse.mdt.papyrus.releng.buckminster/papyrus-trunk-nightly/build.rmap
+++ b/releng/org.eclipse.mdt.papyrus.releng.buckminster/papyrus-trunk-nightly/build.rmap
@@ -462,6 +462,14 @@
</rm:uri>
</rm:provider>
+ <!-- EMF Facet -->
+ <rm:provider componentTypes="eclipse.feature,osgi.bundle" mutable="false" readerType="p2" source="false">
+ <!-- updateFrom("EMF Facet",0) -->
+ <rm:uri format="{0}/facet/updates/integration/0.4.0/I201402271523/">
+ <bc:propertyRef key="eclipse.downloads"/>
+ </rm:uri>
+ </rm:provider>
+
<!-- MoDisco -->
<rm:provider componentTypes="eclipse.feature,osgi.bundle" mutable="false" readerType="p2" source="false">
<!-- updateFrom("MoDisco",0) -->

Back to the top