/***************************************************************************** * Copyright (c) 2010 CEA LIST. * * * 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: * Ansgar Radermacher (CEA LIST) ansgar.radermacher@cea.fr - Initial API and implementation * *****************************************************************************/ package org.eclipse.papyrus.infra.services.validation.commands; import org.eclipse.core.commands.ExecutionException; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.resource.Resource; import org.eclipse.emf.transaction.util.TransactionUtil; import org.eclipse.gmf.runtime.common.core.command.CommandResult; public class ValidateDelMarkersFromModelCommand extends AbstractValidateCommand { public ValidateDelMarkersFromModelCommand (EObject selectedElement) { super ("Delete markers from model", TransactionUtil.getEditingDomain (selectedElement), selectedElement); } /** * {@inheritDoc} */ @Override protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { Resource resource = getResource(); if ((resource != null) && (eclipseResourcesUtil != null)) { eclipseResourcesUtil.deleteMarkers(getResource()); } return null; } }