Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2007 Anyware Technologies 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: Anyware Technologies - initial API and implementation $Id: EPackageContentsCanonicalEditPolicy.java,v 1.5 2009/02/02 08:39:06 jlescot Exp $ /
 
 
 package org.eclipse.emf.ecoretools.diagram.edit.policies;
 
 import java.util.List;
 import java.util.Set;
 
 import  org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy;
 import  org.eclipse.gmf.runtime.notation.View;

Generated:
 
 public class EPackageContentsCanonicalEditPolicy extends CanonicalEditPolicy {

Generated:
 

Generated:
 
 	protected List getSemanticChildrenList() {
 		View viewObject = (View) getHost().getModel();
 		List result = new LinkedList();
 		for (Iterator it = EcoreDiagramUpdater.getEPackageContents_5003SemanticChildren(viewObject).iterator(); it.hasNext();) {
 		}
 		return result;
 	}

Generated:
NOT
 
 	protected boolean isOrphaned(Collection semanticChildrenfinal View view) {
 		if (view.getEAnnotation("Shortcut") != null) {//$NON-NLS-1$
 			return EcoreDiagramUpdater.isShortcutOrphaned(view);
 		}
 		int visualID = EcoreVisualIDRegistry.getVisualID(view);
 		switch (visualID) {
 			return !semanticChildren.contains(view.getElement()) || visualID != EcoreVisualIDRegistry.getNodeVisualID((View) getHost().getModel(), view.getElement());
 		}
 		return false;
 	}

Generated:
 
 	protected String getDefaultFactoryHint() {
 		return null;
 	}

Generated:
 
 	protected Set getFeaturesToSynchronize() {
 		if ( == null) {
 		}
 	}

See also:
org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy#refreshSemantic()
 
 	protected void refreshSemantic() {
 	}

Delete orphaned views
	protected void deleteOrphanedViews() {
		// Don't try to refresh children if the semantic element
		// cannot be resolved.
		if (resolveSemanticElement() == null) {
			return;
		}
		// Current views
		List viewChildren = getViewChildren();
		List semanticChildren = new ArrayList(getSemanticChildrenList());
		List orphaned = cleanCanonicalSemanticChildren(viewChildrensemanticChildren);
		boolean changed = false;
		// Delete all the remaining oprphaned views
		if (!orphaned.isEmpty()) {
			changed = deleteViews(orphaned.iterator());
		}
	}
New to GrepCode? Check out our FAQ X