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: EAnnotationReferencesCreateCommand.java,v 1.4 2009/02/02 08:39:07 jlescot Exp $ /
 
 
 package org.eclipse.emf.ecoretools.diagram.edit.commands;
 
 import  org.eclipse.core.runtime.IAdaptable;
 import  org.eclipse.core.runtime.IProgressMonitor;
 import  org.eclipse.gmf.runtime.common.core.command.CommandResult;
 import  org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
 import  org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;

Generated:
 
 public class EAnnotationReferencesCreateCommand extends EditElementCommand {

Generated:
 
 	private final EObject source;

Generated:
 
 	private final EObject target;

Generated:
 
 	public EAnnotationReferencesCreateCommand(CreateRelationshipRequest requestEObject sourceEObject target) {
 		super(request.getLabel(), nullrequest);
 		this. = source;
 		this. = target;
 	}

Generated:
 
 	public boolean canExecute() {
 		if ( == null &&  == null) {
 			return false;
 		}
 		if ( != null && false ==  instanceof EAnnotation) {
 			return false;
 		}
 		if ( != null && false ==  instanceof EObject) {
 			return false;
 		}
 		if (getSource() == null) {
 			return true// link creation is in progress; source is not defined
 			// yet
 		}
 		// target may be null here but it's possible to check constraint
 		return EcoreBaseItemSemanticEditPolicy.LinkConstraints.canCreateEAnnotationReferences_3001(getSource(), getTarget());
 	}

Generated:
 
 	protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable infothrows ExecutionException {
 		if (!canExecute()) {
 			throw new ExecutionException("Invalid arguments in create link command"); //$NON-NLS-1$
 		}
 
 		if (getSource() != null && getTarget() != null) {
 		}
 		return CommandResult.newOKCommandResult();
 
 	}

Generated:
 
 	protected void setElementToEdit(EObject element) {
 	}

Generated:
 
 	protected EAnnotation getSource() {
 		return (EAnnotation;
 	}

Generated:
	protected EObject getTarget() {
		return (EObject;
	}
New to GrepCode? Check out our FAQ X