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: EReferenceItemSemanticEditPolicy.java,v 1.4 2009/02/02 08:39:06 jlescot Exp $ /
package org.eclipse.emf.ecoretools.diagram.edit.policies;
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.View;

Generated:

Generated:
	}

Generated:
NOT
	protected Command getDestroyElementCommand(DestroyElementRequest req) {
		// Destroy representations from all over the notation model file
		List<View> representations = DestroyElementUtils.findRepresentations(getSemanticElement(), (View) getHost().getModel());
		for (View representationViewToDelete : representations) {
			cc.add(getGEFWrapper(new DestroyElementCommand(new DestroyElementRequest(getEditingDomain(), representationViewToDeletefalse))));
		}
		cc.add(getGEFWrapper(new DestroyElementCommand(req)));
		return cc.unwrap();
	}

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 null;
		}
		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