Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'sandbox/org.eclipse.papyrus.newchild/src/org/eclipse/papyrus/newchild/policies/ReplaceFillPolicy.java')
-rw-r--r--sandbox/org.eclipse.papyrus.newchild/src/org/eclipse/papyrus/newchild/policies/ReplaceFillPolicy.java37
1 files changed, 37 insertions, 0 deletions
diff --git a/sandbox/org.eclipse.papyrus.newchild/src/org/eclipse/papyrus/newchild/policies/ReplaceFillPolicy.java b/sandbox/org.eclipse.papyrus.newchild/src/org/eclipse/papyrus/newchild/policies/ReplaceFillPolicy.java
new file mode 100644
index 00000000000..d3fb1baa3fe
--- /dev/null
+++ b/sandbox/org.eclipse.papyrus.newchild/src/org/eclipse/papyrus/newchild/policies/ReplaceFillPolicy.java
@@ -0,0 +1,37 @@
+/*****************************************************************************
+ * Copyright (c) 2011 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.newchild.policies;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.papyrus.newchild.MenuItem;
+import org.eclipse.papyrus.newchild.menu.FillElement;
+import org.eclipse.papyrus.newchild.menu.FillerFactory;
+import org.eclipse.papyrus.newchild.ncpolicy.ReplacePolicy;
+
+
+public class ReplaceFillPolicy extends AbstractFillPolicy {
+
+ public void fill(IMenuManager menuManager, EObject parentEObject, EClass eClass, EStructuralFeature role, EObject selectedEObject) {
+ for(MenuItem menuItem : getPolicy().getReplaceWith()) {
+ FillElement filler = FillerFactory.instance.getFiller(menuItem, selectedEObject);
+ filler.fill(menuManager);
+ }
+ }
+
+ public ReplacePolicy getPolicy() {
+ return (ReplacePolicy)policy;
+ }
+
+}

Back to the top