| /******************************************************************************* |
| * Copyright (c) 2006 Borland Software Corporation and others. |
| * 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: |
| * Borland Software Corporation - initial API and implementation |
| *******************************************************************************/ |
| package org.eclipse.gmf.examples.mindmap.diagram.edit.policies; |
| |
| import java.util.Iterator; |
| import java.util.LinkedList; |
| import java.util.List; |
| |
| import org.eclipse.emf.ecore.EObject; |
| import org.eclipse.gmf.examples.mindmap.diagram.edit.parts.ThreadItemEditPart; |
| import org.eclipse.gmf.examples.mindmap.diagram.part.MindmapVisualIDRegistry; |
| import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy; |
| import org.eclipse.gmf.runtime.notation.View; |
| |
| /** |
| * @generated |
| */ |
| public class Thread_ThreadItemCompartmentCanonicalEditPolicy extends CanonicalEditPolicy { |
| |
| /** |
| * @generated |
| */ |
| protected List getSemanticChildrenList() { |
| List result = new LinkedList(); |
| EObject modelObject = ((View) getHost().getModel()).getElement(); |
| View viewObject = (View) getHost().getModel(); |
| EObject nextValue; |
| int nodeVID; |
| for (Iterator values = ((org.eclipse.gmf.examples.mindmap.Thread) modelObject).getItems().iterator(); values.hasNext();) { |
| nextValue = (EObject) values.next(); |
| nodeVID = MindmapVisualIDRegistry.getNodeVisualID(viewObject, nextValue); |
| if (ThreadItemEditPart.VISUAL_ID == nodeVID) { |
| result.add(nextValue); |
| } |
| } |
| return result; |
| } |
| |
| /** |
| * @generated |
| */ |
| protected boolean shouldDeleteView(View view) { |
| return view.isSetElement() && view.getElement() != null; |
| } |
| |
| /** |
| * @generated |
| */ |
| protected String getDefaultFactoryHint() { |
| return null; |
| } |
| |
| } |