Community
Participate
Working Groups
id="org.eclipse.emf.ecp.emfstore.ui.revertAllOperations"
name="Revert">
</command>
<command
id="org.eclipse.emf.ecp.emfstore.ui.showHistoryView"
name="showHistoryView">
</extension>
<extension
point="org.eclipse.ui.menus">
</and>
</visibleWhen>
commandId="org.eclipse.emf.ecp.emfstore.ui.showHistoryView"
icon="icons/historyview.png"
label="Show Historyview"
style="push"
tooltip="Shows the HistoryView">
<visibleWhen
checkEnabled="false">
<and>
<count
value="1">
</count>
<iterate>
<instanceof
value="org.eclipse.emf.ecp.core.ECPProject">
</instanceof>
<test
property="org.eclipse.emf.ecp.core.project.providerName"
value="org.eclipse.emf.ecp.emfstore.provider">
</test>
</iterate>
</menuContribution>
<menuContribution
locationURI="popup:org.eclipse.emf.ecp.ui.ModelRepositoriesView?after=additions">
class="org.eclipse.emf.ecp.emfstore.internal.ui.handler.RevertAllOperationsHandler"
commandId="org.eclipse.emf.ecp.emfstore.ui.revertAllOperations">
</handler>
<handler
class="org.eclipse.emf.ecp.emfstore.internal.ui.handler.ShowHistoryHandler"
commandId="org.eclipse.emf.ecp.emfstore.ui.showHistoryView">
<enabledWhen>
<with
variable="selection">
<iterate
ifEmpty="false"
operator="or">
property="org.eclipse.emf.ecp.emfstore.ui.testers.isShared"
value="true">
</with>
</enabledWhen>
point="org.eclipse.ui.decorators">
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.model.ProjectSpace;
import org.eclipse.emf.emfstore.client.ui.controller.UIShowHistoryController;
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;
public class ShowHistoryHandler extends AbstractHandler {
/*
* (non-Javadoc)
* @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
*/
public Object execute(ExecutionEvent event) throws ExecutionException {
InternalProject project = (InternalProject) ((IStructuredSelection) HandlerUtil.getCurrentSelection(event))
.getFirstElement();
if (project == null) {
return null;
}
ProjectSpace projectSpace = EMFStoreProvider.INSTANCE.getProjectSpace(project);
if (projectSpace != null) {
new UIShowHistoryController(HandlerUtil.getActiveShell(event), projectSpace).execute();