private static void handleMissingView(final Object id) { ExecutionException e = new ExecutionException("View could not be found: " + id); //$NON-NLS-1$ StatusUtil.handleStatus(e, StatusManager.SHOW); } }
private String getCurrentBranch(Repository repository) throws ExecutionException { try { return repository.getBranch(); } catch (IOException e) { throw new ExecutionException(UIText.RebaseCurrentRefCommand_ErrorGettingCurrentBranchMessage, e); } } }
private String getFullBranch(Repository repository) throws ExecutionException { try { return repository.getFullBranch(); } catch (IOException e) { throw new ExecutionException( UIText.RebaseCurrentRefCommand_ErrorGettingCurrentBranchMessage, e); } } }
public Object execute(ExecutionEvent event) throws ExecutionException { IJavaElement javaElement= (IJavaElement) event.getObjectParameterForExecution(PARAM_ID_ELEMENT_REF); try { IEditorPart editorPart= JavaUI.openInEditor(javaElement); JavaUI.revealInEditor(editorPart, javaElement); } catch (JavaModelException ex) { throw new ExecutionException("Error opening java element in editor", ex); //$NON-NLS-1$ } catch (PartInitException ex) { throw new ExecutionException("Error opening java element in editor", ex); //$NON-NLS-1$ } return null; }
private static void incorrectTypeFound(ExecutionEvent event, String name, Class expectedType, Class wrongType) throws ExecutionException { throw new ExecutionException("Incorrect type for " //$NON-NLS-1$ + name + " found while executing " //$NON-NLS-1$ + event.getCommand().getId() + ", expected " + expectedType.getName() //$NON-NLS-1$ + " found " + wrongType.getName()); //$NON-NLS-1$ }
@Override public Object execute(ExecutionEvent event) throws ExecutionException { IJavaElement javaElement= (IJavaElement) event.getObjectParameterForExecution(PARAM_ID_ELEMENT_REF); try { IEditorPart editorPart= JavaUI.openInEditor(javaElement); JavaUI.revealInEditor(editorPart, javaElement); } catch (JavaModelException ex) { throw new ExecutionException("Error opening java element in editor", ex); //$NON-NLS-1$ } catch (PartInitException ex) { throw new ExecutionException("Error opening java element in editor", ex); //$NON-NLS-1$ } return null; }
public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { try { // attempt to save the state of the workspace ResourcesPlugin.getWorkspace().save(true, monitor); return Status.OK_STATUS; } catch (CoreException e) { throw new ExecutionException(e.getMessage(), e); } } }
public Object execute(ExecutionEvent event) throws ExecutionException { String baseline = event .getParameter(HistoryViewCommands.BASELINE_TARGET); Repository repo = getRepository(event); if (baseline == null) throw new ExecutionException( UIText.ResetQuickdiffBaselineHandler_NoTargetMessage); try { GitQuickDiffProvider.setBaselineReference(repo, baseline); } catch (IOException e) { throw new ExecutionException(e.getMessage(), e); } return null; } }
@Override public Object execute(ExecutionEvent event) throws ExecutionException { IJavaElement javaElement= (IJavaElement) event.getObjectParameterForExecution(PARAM_ID_ELEMENT_REF); try { IEditorPart editorPart= JavaUI.openInEditor(javaElement); JavaUI.revealInEditor(editorPart, javaElement); } catch (JavaModelException ex) { throw new ExecutionException("Error opening java element in editor", ex); //$NON-NLS-1$ } catch (PartInitException ex) { throw new ExecutionException("Error opening java element in editor", ex); //$NON-NLS-1$ } return null; }
protected Repository getRepository(ExecutionEvent event) throws ExecutionException { IWorkbenchPart part = getPart(event); if (!(part instanceof ReflogView)) throw new ExecutionException( UIText.AbstractReflogCommandHandler_NoInput); return (((ReflogView) part).getRepository()); }
private static void noVariableFound(ExecutionEvent event, String name) throws ExecutionException { throw new ExecutionException("No " + name //$NON-NLS-1$ + " found while executing " + event.getCommand().getId()); //$NON-NLS-1$ }
@Override public Object execute(ExecutionEvent event) throws ExecutionException { locationURI = event.getParameter("org.eclipse.ui.window.quickMenu.uri"); //$NON-NLS-1$ if (locationURI == null) { throw new ExecutionException("locatorURI must not be null"); //$NON-NLS-1$ } creator.createMenu(); return null; }
private Object getInput(ExecutionEvent event) throws ExecutionException { IWorkbenchPart part = getPart(event); if (!(part instanceof IHistoryView)) throw new ExecutionException( UIText.AbstractHistoryCommanndHandler_NoInputMessage); return (((IHistoryView) part).getHistoryPage().getInput()); }
@Override @Deprecated public Object execute(final ExecutionEvent event) throws ExecutionException { try { return execute(event.getParameters()); } catch (final org.eclipse.ui.commands.ExecutionException e) { throw new ExecutionException(e.getMessage(), e.getCause()); } }
public Object execute(ExecutionEvent event) throws ExecutionException { Repository repo = getRepository(event); String baseline = ((RevCommit) getSelection(getPage()).getFirstElement()) .getId().name(); if (baseline == null) throw new ExecutionException( UIText.ResetQuickdiffBaselineHandler_NoTargetMessage); try { GitQuickDiffProvider.setBaselineReference(repo, baseline); } catch (IOException e) { throw new ExecutionException(e.getMessage(), e); } return null; }
public Object execute(ExecutionEvent event) throws ExecutionException { IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event); IWorkbenchPage page = window.getActivePage(); if (page == null) { throw new ExecutionException("No active workbench window"); //$NON-NLS-1$ } List<IBuildElement> elements = BuildsUiInternal.getElements(event); open(page, elements); return null; }
public Object execute(ExecutionEvent event) throws ExecutionException { ISelection selection = HandlerUtil.getCurrentSelection(event); if (selection instanceof IStructuredSelection) { Mode mode = Mode.SUMMARY; String kind = event.getParameter("kind"); if (kind != null) { try { mode = Mode.valueOf(kind); } catch (IllegalArgumentException e) { throw new ExecutionException(NLS.bind("Invalid kind ''{0}'' specified", kind)); } } copyDetails(BuildsUiInternal.getElements(event), mode); } return null; }
public Object execute(ExecutionEvent event) throws ExecutionException { RepositoriesView view; try { view = (RepositoriesView) PlatformUI.getWorkbench() .getActiveWorkbenchWindow().getActivePage().showView( RepositoriesView.VIEW_ID); ShowInContext ctx = new ShowInContext(ResourcesPlugin.getWorkspace().getRoot(), getSelection(event)); view.show(ctx); } catch (PartInitException e) { throw new ExecutionException(e.getMessage(), e); } return null; }
public Object execute(ExecutionEvent event) throws ExecutionException { IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event); IWorkbenchPage page = window.getActivePage(); if (page == null) { throw new ExecutionException("No active workbench window"); //$NON-NLS-1$ } ISelection selection = HandlerUtil.getCurrentSelection(event); if (selection instanceof IStructuredSelection) { Object item = ((IStructuredSelection) selection).getFirstElement(); if (item instanceof IBuildPlan) { IBuildPlan plan = (IBuildPlan) item; TestResultManager.showInJUnitView(plan); } } return null; }
public Object execute(ExecutionEvent event) throws ExecutionException { ITextViewer viewer = getTextViewer(event); if (viewer != null) { TextViewerDeleteLineTarget target = new TextViewerDeleteLineTarget(viewer); try { ITextSelection textSelection = (ITextSelection) viewer.getSelectionProvider().getSelection(); target.deleteLine(viewer.getDocument(), textSelection, type, copyToClipboard); } catch (BadLocationException e) { throw new ExecutionException(e.getMessage(), e); } } return null; }