@Override public void run(IAction action) { IProgressService progressService = PlatformUI.getWorkbench().getProgressService(); try { progressService.busyCursorWhile(this); } catch (InvocationTargetException e) { e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } }
/** * @deprecated * @param parent * @return the dialog */ private SelectionDialog createOpenTypeSelectionDialog2(Shell parent) { return new org.eclipse.jdt.internal.ui.dialogs.OpenTypeSelectionDialog2(parent, false, PlatformUI.getWorkbench().getProgressService(), null, IJavaSearchConstants.TYPE); }
/** * Get the progress service for the workbnech, * * @return IProgressService */ private IProgressService getWorkbenchProgressService() { return site.getWorkbenchWindow().getWorkbench().getProgressService(); }
private IRunnableContext getRunnableContext() { if (runnableContext == null) { return (fork, cancelable, runnable) -> { IProgressService manager = PlatformUI.getWorkbench().getProgressService(); manager.busyCursorWhile(runnable); }; } return runnableContext; }
public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException { PlatformUI.getWorkbench().getProgressService().run(fork, cancelable, runnable); }
private int guessFuzzFactor() { final int[] result = new int[] { -1 }; try { PlatformUI.getWorkbench().getProgressService().run(true, true, monitor -> result[0] = patcher.guessFuzzFactor(monitor)); } catch (InvocationTargetException ex) { // NeedWork } catch (InterruptedException ex) { // NeedWork } return result[0]; }
/** * The constructor. */ public InternalSearchUI() { fgInstance= this; fSearchJobs= new HashMap(); fSearchResultsManager= new QueryManager(); fPositionTracker= new PositionTracker(); fSearchViewManager= new SearchViewManager(fSearchResultsManager); PlatformUI.getWorkbench().getProgressService().registerIconForFamily(SearchPluginImages.DESC_VIEW_SEARCHRES, FAMILY_SEARCH); }
/** * The constructor. */ public InternalSearchUI() { fgInstance= this; fSearchJobs= new HashMap<>(); fSearchResultsManager= new QueryManager(); fPositionTracker= new PositionTracker(); fSearchViewManager= new SearchViewManager(fSearchResultsManager); PlatformUI.getWorkbench().getProgressService().registerIconForFamily(SearchPluginImages.DESC_VIEW_SEARCHRES, FAMILY_SEARCH); }
protected void applySourceAttachment(Shell shell, IClasspathEntry newEntry, IJavaProject project, IPath containerPath, boolean isReferencedEntry) { try { IRunnableWithProgress runnable= SourceAttachmentBlock.getRunnable(shell, newEntry, project, containerPath, isReferencedEntry); PlatformUI.getWorkbench().getProgressService().run(true, true, runnable); } catch (InvocationTargetException e) { String title= JavaEditorMessages.SourceAttachmentForm_attach_error_title; String message= JavaEditorMessages.SourceAttachmentForm_attach_error_message; ExceptionHandler.handle(e, shell, title, message); } catch (InterruptedException e) { // cancelled } }
protected void applySourceAttachment(Shell shell, IClasspathEntry newEntry, IJavaProject project, IPath containerPath, boolean isReferencedEntry) { try { IRunnableWithProgress runnable= SourceAttachmentBlock.getRunnable(shell, newEntry, project, containerPath, isReferencedEntry); PlatformUI.getWorkbench().getProgressService().run(true, true, runnable); } catch (InvocationTargetException e) { String title= JavaEditorMessages.SourceAttachmentForm_attach_error_title; String message= JavaEditorMessages.SourceAttachmentForm_attach_error_message; ExceptionHandler.handle(e, shell, title, message); } catch (InterruptedException e) { // cancelled } }
@Override public void preStartup() { // Register the build actions IProgressService service = PlatformUI.getWorkbench() .getProgressService(); ImageDescriptor newImage = IDEInternalWorkbenchImages .getImageDescriptor(IDEInternalWorkbenchImages.IMG_ETOOL_BUILD_EXEC); service.registerIconForFamily(newImage, ResourcesPlugin.FAMILY_MANUAL_BUILD); service.registerIconForFamily(newImage, ResourcesPlugin.FAMILY_AUTO_BUILD); }
protected void applySourceAttachment(Shell shell, IClasspathEntry newEntry, IJavaProject project, IPath containerPath) { try { IRunnableWithProgress runnable= SourceAttachmentBlock.getRunnable(shell, newEntry, project, containerPath); PlatformUI.getWorkbench().getProgressService().run(true, true, runnable); } catch (InvocationTargetException e) { String title= JavaEditorMessages.SourceAttachmentForm_attach_error_title; String message= JavaEditorMessages.SourceAttachmentForm_attach_error_message; ExceptionHandler.handle(e, shell, title, message); } catch (InterruptedException e) { // cancelled } }
private void ensureContentSaved() { if (activeEditor.isDirty()) { try { IRunnableWithProgress op = monitor -> activeEditor.doSave(monitor); PlatformUI.getWorkbench().getProgressService().runInUI(PDEPlugin.getActiveWorkbenchWindow(), op, PDEPlugin.getWorkspace().getRoot()); } catch (InvocationTargetException e) { PDEPlugin.logException(e); } catch (InterruptedException e) { } } }
private IProgressService getProgressService() { IEditorPart editor= getTextEditor(); if (editor != null) { IWorkbenchPartSite site= editor.getSite(); if (site != null) return editor.getSite().getAdapter(IWorkbenchSiteProgressService.class); } return PlatformUI.getWorkbench().getProgressService(); }
private IProgressService getProgressService() { IEditorPart editor= getTextEditor(); if (editor != null) { IWorkbenchPartSite site= editor.getSite(); if (site != null) return editor.getSite().getAdapter(IWorkbenchSiteProgressService.class); } return PlatformUI.getWorkbench().getProgressService(); }
public void handleSynchronize(boolean alert) { try { IProgressService service = PlatformUI.getWorkbench().getProgressService(); IProject project = fEditor.getCommonProject(); SynchronizationOperation op = new SynchronizationOperation(getProduct(), fEditor.getSite().getShell(), project); service.runInUI(service, op, PDEPlugin.getWorkspace().getRoot()); } catch (InterruptedException e) { } catch (InvocationTargetException e) { if (alert) MessageDialog.openError(fEditor.getSite().getShell(), "Synchronize", e.getTargetException().getMessage()); //$NON-NLS-1$ } }
private SelectionDialog createAllPackagesDialog(Shell shell) { IProgressService progressService= PlatformUI.getWorkbench().getProgressService(); IJavaSearchScope scope= SearchEngine.createWorkspaceScope(); int flag= PackageSelectionDialog.F_HIDE_EMPTY_INNER; PackageSelectionDialog dialog= new PackageSelectionDialog(shell, progressService, flag, scope); dialog.setFilter(""); //$NON-NLS-1$ dialog.setIgnoreCase(false); dialog.setMultipleSelection(false); return dialog; }
private SelectionDialog createAllPackagesDialog(Shell shell) throws JavaModelException{ IProgressService progressService= PlatformUI.getWorkbench().getProgressService(); IJavaSearchScope scope= SearchEngine.createWorkspaceScope(); int flag= PackageSelectionDialog.F_HIDE_EMPTY_INNER; PackageSelectionDialog dialog= new PackageSelectionDialog(shell, progressService, flag, scope); dialog.setFilter(""); //$NON-NLS-1$ dialog.setIgnoreCase(false); dialog.setMultipleSelection(false); return dialog; }
private SelectionDialog createAllPackagesDialog(Shell shell) { IProgressService progressService= PlatformUI.getWorkbench().getProgressService(); IJavaSearchScope scope= SearchEngine.createWorkspaceScope(); int flag= PackageSelectionDialog.F_HIDE_EMPTY_INNER; PackageSelectionDialog dialog= new PackageSelectionDialog(shell, progressService, flag, scope); dialog.setFilter(""); //$NON-NLS-1$ dialog.setIgnoreCase(false); dialog.setMultipleSelection(false); return dialog; }
@Override public void run() { if (fTextEditor == null || fTextEditor.getEditorInput() == null) return; try { PlatformUI.getWorkbench().getProgressService().busyCursorWhile(new FormatOperation(new Object[] {fTextEditor.getEditorInput()})); } catch (InvocationTargetException e) { PDEPlugin.log(e); } catch (InterruptedException e) { PDEPlugin.log(e); } }