Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Fluegge2010-08-02 20:54:19 +0000
committerMartin Fluegge2010-08-02 20:54:19 +0000
commit9b839f3f7756e44ae9369889e806a87288d022fe (patch)
tree89667f27e2cfde8dd6085f3073088824efac1b6a /plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram.dawn
parent3f89dc58eecb285edc2d90a57273b923a360810c (diff)
downloadcdo-9b839f3f7756e44ae9369889e806a87288d022fe.tar.gz
cdo-9b839f3f7756e44ae9369889e806a87288d022fe.tar.xz
cdo-9b839f3f7756e44ae9369889e806a87288d022fe.zip
[320193] [Dawn] Provide a flexible testing environment for UI tests
https://bugs.eclipse.org/bugs/show_bug.cgi?id=320193
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram.dawn')
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram.dawn/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/policies/DawnACoreRootCanonicalEditPolicy.java40
1 files changed, 40 insertions, 0 deletions
diff --git a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram.dawn/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/policies/DawnACoreRootCanonicalEditPolicy.java b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram.dawn/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/policies/DawnACoreRootCanonicalEditPolicy.java
index f1011b2eb6..db87de310b 100644
--- a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram.dawn/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/policies/DawnACoreRootCanonicalEditPolicy.java
+++ b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram.dawn/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/policies/DawnACoreRootCanonicalEditPolicy.java
@@ -12,6 +12,15 @@ package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies;
import org.eclipse.emf.cdo.dawn.examples.acore.diagram.part.AcoreDiagramEditorPlugin;
+import org.eclipse.emf.ecore.EObject;
+
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest.ViewDescriptor;
+import org.eclipse.gmf.runtime.notation.View;
+
+import java.util.ArrayList;
+import java.util.List;
+
/**
* @author Martin Fluegge
*/
@@ -24,6 +33,37 @@ public class DawnACoreRootCanonicalEditPolicy extends ACoreRootCanonicalEditPoli
AcoreDiagramEditorPlugin.getInstance().logInfo("Running DawnAcoreCanonicalEditPolicy instead of original one");
}
+ @Override
+ protected CreateViewRequest getCreateViewRequest(List<ViewDescriptor> descriptors)
+ {
+ List<View> viewChildren = getViewChildren();
+
+ List<ViewDescriptor> tbr = new ArrayList<CreateViewRequest.ViewDescriptor>();
+
+ for (ViewDescriptor desc : descriptors)
+ {
+ EObject obj = (EObject)((CanonicalElementAdapter)desc.getElementAdapter()).getRealObject();
+
+ boolean found = false;
+
+ for (View view : viewChildren)
+ {
+ if (view.getElement().equals(obj))
+ {
+ found = true;
+ break;
+ }
+ }
+ if (!found)
+ {
+ tbr.add(desc);
+ }
+ }
+
+ descriptors.removeAll(tbr);
+
+ return new CreateViewRequest(descriptors);
+ }
// @Override
// protected List getSemanticChildrenList()
// {

Back to the top