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: EAnnotationItemSemanticEditPolicy.java,v 1.4 2009/02/02 08:39:06 jlescot Exp $ /
 
 
 package org.eclipse.emf.ecoretools.diagram.edit.policies;
 
 import java.util.List;
 
 import  org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand;
 import  org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
 import  org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
 import  org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
 import  org.eclipse.gmf.runtime.notation.Node;
 import  org.eclipse.gmf.runtime.notation.View;

Generated:
 

Generated:
 
 	}

Generated:
NOT
 
 	protected Command getDestroyElementCommand(DestroyElementRequest req) {
 		View view = (View) getHost().getModel();
 		if (view.getEAnnotation("Shortcut") != null) { //$NON-NLS-1$
 			req.setElementToDestroy(view);
 		} else {
 			// Destoy shorcuts all over from all over the notation model file
 			List<View> shortcutViews = DestroyElementUtils.findShortcutViews(getSemanticElement(), (View) getHost().getModel());
 			for (View shortcutViewToDelete : shortcutViews) {
 				cc.add(getGEFWrapper(new DestroyElementCommand(new DestroyElementRequest(getEditingDomain(), shortcutViewToDeletefalse))));
 			}
 		}
 
 		cc.add(getGEFWrapper(new DestroyElementCommand(req)));
 		return cc.unwrap();
 	}

Generated:
 
 	protected void addDestroyChildNodesCommand(CompoundCommand cmd) {
 		View view = (View) getHost().getModel();
 		EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
 		if (annotation != null) {
 			return;
 		}
 		for (Iterator it = view.getChildren().iterator(); it.hasNext();) {
 			Node node = (Node) it.next();
 			switch (EcoreVisualIDRegistry.getVisualID(node)) {
 				for (Iterator cit = node.getChildren().iterator(); cit.hasNext();) {
 					Node cnode = (Node) cit.next();
 					switch (EcoreVisualIDRegistry.getVisualID(cnode)) {
 						break;
 					}
 				}
 				break;
 			}
 		}
 	}

Generated:
 
	protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
		Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
		return command != null ? command : super.getCreateRelationshipCommand(req);
	}

Generated:
	protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
		if (. == req.getElementType()) {
			return getGEFWrapper(new EAnnotationReferencesCreateCommand(reqreq.getSource(), req.getTarget()));
		}
		return null;
	}

Generated:
	protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
		if (. == req.getElementType()) {
			return getGEFWrapper(new EAnnotationReferencesCreateCommand(reqreq.getSource(), req.getTarget()));
		}
		return null;
	}

Returns command to reorient EReference based link. New link target or source should be the domain model element associated with this node.

Generated:
	protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
		switch (getVisualID(req)) {
		}
	}
New to GrepCode? Check out our FAQ X