blob: 4eb11c86e9ed80d01db81c0018cca56dd0931715 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2011-2013 EclipseSource Muenchen GmbH and others.
*
* 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:
* Eugen Neufeld - initial API and implementation
*
*******************************************************************************/
package org.eclipse.emf.ecp.emfstore.internal.ui.handler;
import org.eclipse.emf.ecp.emfstore.core.internal.EMFStoreProvider;
import org.eclipse.emf.ecp.spi.core.InternalProject;
import org.eclipse.emf.emfstore.client.ESLocalProject;
import org.eclipse.emf.emfstore.internal.client.ui.controller.UIMergeController;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.ui.handlers.HandlerUtil;
/**
* A MergeBranch Handler. This allows to merge a branch.
*
* @author Eugen Neufeld
*
*/
public class MergeBranchHandler extends AbstractHandler {
/** {@inheritDoc} */
public Object execute(ExecutionEvent event) throws ExecutionException {
InternalProject project = (InternalProject) ((IStructuredSelection) HandlerUtil.getActiveMenuSelection(event))
.getFirstElement();
ESLocalProject localProject = EMFStoreProvider.INSTANCE.getProjectSpace(project);
// TODO EMFStore Constructor is missing
new UIMergeController(HandlerUtil.getActiveShell(event), localProject).execute();
return null;
}
}