| /******************************************************************************* |
| * Copyright (c) 2007, 2010 BMW Car IT, Technische Universitaet Muenchen, and others. |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License 2.0 |
| * which accompanies this distribution, and is available at |
| * https://www.eclipse.org/legal/epl-2.0/ |
| * |
| * SPDX-License-Identifier: EPL-2.0 |
| * |
| * Contributors: |
| * BMW Car IT - Initial API and implementation |
| * Technische Universitaet Muenchen - Major refactoring and extension |
| *******************************************************************************/ |
| package org.eclipse.emf.edapt.history.presentation.action; |
| |
| import org.eclipse.core.commands.AbstractHandler; |
| import org.eclipse.core.commands.ExecutionEvent; |
| import org.eclipse.jface.viewers.ISelection; |
| import org.eclipse.jface.viewers.IStructuredSelection; |
| import org.eclipse.ui.handlers.HandlerUtil; |
| |
| /** |
| * Action to check whether changes in the history are breaking |
| * |
| * @author herrmama |
| * @author $Author$ |
| * @version $Rev$ |
| * @levd.rating RED Rev: |
| */ |
| public class CheckBreakingHandler extends AbstractHandler { |
| |
| /** {@inheritDoc} */ |
| @Override |
| public Object execute(ExecutionEvent event) { |
| final ISelection selection = HandlerUtil.getCurrentSelection(event); |
| if (selection instanceof IStructuredSelection) { |
| final IStructuredSelection structuredSelection = (IStructuredSelection) selection; |
| final ExtendedValidateAction validateAction = new ExtendedValidateAction(); |
| validateAction.updateSelection(structuredSelection); |
| validateAction.setActiveWorkbenchPart(HandlerUtil.getActivePart(event)); |
| validateAction.run(); |
| |
| } |
| return null; |
| } |
| } |