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 Contributors: Anyware Technologies - initial API and implementation $Id:,v 1.8 2009/01/29 09:57:44 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.diagram.ui.editpolicies.CanonicalEditPolicy;
import  org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;

Update and editpart triggering the pseudo canonical edit policy
creation : 2 janv. 2008

Gilles Cannenterre
public class UpdateEditPartCommand extends AbstractTransactionalCommand {
	private EditPart part;
		this. = part;
	protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable infothrows ExecutionException {
		if ( == null) {
			return CommandResult.newWarningCommandResult(.null);
		if (editPolicy instanceof CanonicalEditPolicy) {
			((CanonicalEditPolicy) editPolicy).refresh();
		return CommandResult.newOKCommandResult();
New to GrepCode? Check out our FAQ X