Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/policies/AInterfaceAAttributeInterfaceCompartmentCanonicalEditPolicy.java')
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/policies/AInterfaceAAttributeInterfaceCompartmentCanonicalEditPolicy.java77
1 files changed, 77 insertions, 0 deletions
diff --git a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/policies/AInterfaceAAttributeInterfaceCompartmentCanonicalEditPolicy.java b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/policies/AInterfaceAAttributeInterfaceCompartmentCanonicalEditPolicy.java
new file mode 100644
index 0000000000..141a755943
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/policies/AInterfaceAAttributeInterfaceCompartmentCanonicalEditPolicy.java
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2004 - 2010 Eike Stepper (Berlin, Germany).
+ * 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Martin Fluegge - initial API and implementation
+ *
+ */
+package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies;
+
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.eclipse.emf.cdo.dawn.examples.acore.AcorePackage;
+import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.parts.AAttributeEditPart;
+import org.eclipse.emf.cdo.dawn.examples.acore.diagram.part.AcoreDiagramUpdater;
+import org.eclipse.emf.cdo.dawn.examples.acore.diagram.part.AcoreNodeDescriptor;
+import org.eclipse.emf.cdo.dawn.examples.acore.diagram.part.AcoreVisualIDRegistry;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy;
+import org.eclipse.gmf.runtime.notation.View;
+
+/**
+ * @generated
+ */
+public class AInterfaceAAttributeInterfaceCompartmentCanonicalEditPolicy extends CanonicalEditPolicy
+{
+
+ /**
+ * @generated
+ */
+ protected List getSemanticChildrenList()
+ {
+ View viewObject = (View)getHost().getModel();
+ LinkedList<EObject> result = new LinkedList<EObject>();
+ List<AcoreNodeDescriptor> childDescriptors = AcoreDiagramUpdater
+ .getAInterfaceAAttributeInterfaceCompartment_7001SemanticChildren(viewObject);
+ for (Iterator<AcoreNodeDescriptor> it = childDescriptors.iterator(); it.hasNext();)
+ {
+ AcoreNodeDescriptor d = it.next();
+ result.add(d.getModelElement());
+ }
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean isOrphaned(Collection semanticChildren, final View view)
+ {
+ int visualID = AcoreVisualIDRegistry.getVisualID(view);
+ switch (visualID)
+ {
+ case AAttributeEditPart.VISUAL_ID:
+ if (!semanticChildren.contains(view.getElement()))
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * @generated
+ */
+ protected EStructuralFeature getFeatureToSynchronize()
+ {
+ return AcorePackage.eINSTANCE.getABasicClass_Attributes();
+ }
+
+}

Back to the top