protected void buttonPressed(int buttonId) { switch (buttonId) { case IDialogConstants.PROCEED_ID: CommonUtils.runCommand(ActionCommands.COMMIT_ACTION, new StructuredSelection(repository)); break; case IDialogConstants.ABORT_ID: CommonUtils.runCommand( ResetCommand.ID, new StructuredSelection(new RepositoryNode(null, repository))); break; case IDialogConstants.SKIP_ID: CommonUtils.runCommand( ActionCommands.STASH_CREATE, new StructuredSelection(new RepositoryNode(null, repository))); break; } super.buttonPressed(buttonId); }
public Object execute(ExecutionEvent event) throws ExecutionException { RevCommit commit = getSelectedCommit(event); Repository repo = getRepository(event); if (repo == null) return null; final IStructuredSelection selected = new StructuredSelection(new RepositoryCommit(repo, commit)); CommonUtils.runCommand( org.eclipse.egit.ui.internal.commit.command.CherryPickHandler.ID, selected); return null; }
/** * Return <code>IHandlerService</code>. The default implementation uses the workbench window's * service locator. Subclasses may override to access the service by using a local service * locator. * * @return <code>IHandlerService</code> using the workbench window's service locator. Can be * <code>null</code> if the service could not be found. */ protected IHandlerService getHandlerService() { return CommonUtils.getService(PlatformUI.getWorkbench(), IHandlerService.class); }