protected void run( IRunnableWithProgress runnable ) { try { getViewSite().getWorkbenchWindow().run( true, true, runnable ); } catch ( InvocationTargetException e ) { // TODO Auto-generated catch block e.printStackTrace(); } catch ( InterruptedException e ) { // TODO Auto-generated catch block e.printStackTrace(); } }
public void undoDocumentChanges() { final ISourceViewer viewer = editor.getInternalSourceViewer(); try { editor.getSite().getWorkbenchWindow().run(false, true, new IRunnableWithProgress() { public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { if (viewer instanceof ITextViewerExtension6) { IUndoManager undoManager = ((ITextViewerExtension6) viewer).getUndoManager(); if (undoManager instanceof IUndoManagerExtension) { IUndoManagerExtension undoManagerExtension = (IUndoManagerExtension) undoManager; IUndoContext undoContext = undoManagerExtension.getUndoContext(); IOperationHistory operationHistory = OperationHistoryFactory.getOperationHistory(); while (undoManager.undoable()) { if (startingUndoOperation != null && startingUndoOperation.equals(operationHistory.getUndoOperation(undoContext))) return; undoManager.undo(); } } } } }); syncUtil.waitForReconciler(editor); } catch (Exception e) { LOG.error(e.getMessage(), e); } } }
public static void run(IRunnableWithProgress runnable) { try { PlatformUI.getWorkbench().getActiveWorkbenchWindow().run(true, true, runnable); } catch (InvocationTargetException e) { Utils.handleError(getStandardDisplay().getActiveShell(), e, null, null); } catch (InterruptedException e2) { // Nothing to be done } }
public static void run(IRunnableWithProgress runnable) { try { PlatformUI.getWorkbench().getActiveWorkbenchWindow().run(true, true, runnable); } catch (InvocationTargetException e) { Utils.handleError(getStandardDisplay().getActiveShell(), e, null, null); } catch (InterruptedException e2) { // Nothing to be done } }
private IStatus export(JarPackageData[] jarPackages) { Shell shell= getShell(); IJarExportRunnable op= jarPackages[0].createJarExportRunnable(jarPackages, shell); try { PlatformUI.getWorkbench().getActiveWorkbenchWindow().run(false, true, op); //PlatformUI.getWorkbench().getProgressService().run(false, true, op); // see bug 118152 } catch (InvocationTargetException ex) { if (ex.getTargetException() != null) { ExceptionHandler.handle(ex, shell, JarPackagerMessages.CreateJarActionDelegate_jarExportError_title, JarPackagerMessages.CreateJarActionDelegate_jarExportError_message); return null; } } catch (InterruptedException e) { // do nothing on cancel return null; } return op.getStatus(); }
private IStatus export(JarPackageData[] jarPackages) { Shell shell= getShell(); IJarExportRunnable op= jarPackages[0].createJarExportRunnable(jarPackages, shell); try { PlatformUI.getWorkbench().getActiveWorkbenchWindow().run(false, true, op); //PlatformUI.getWorkbench().getProgressService().run(false, true, op); // see bug 118152 } catch (InvocationTargetException ex) { if (ex.getTargetException() != null) { ExceptionHandler.handle(ex, shell, JarPackagerMessages.CreateJarActionDelegate_jarExportError_title, JarPackagerMessages.CreateJarActionDelegate_jarExportError_message); return null; } } catch (InterruptedException e) { // do nothing on cancel return null; } return op.getStatus(); }
private IStatus export(JarPackageData[] jarPackages) { Shell shell= getShell(); IJarExportRunnable op= jarPackages[0].createJarExportRunnable(jarPackages, shell); try { PlatformUI.getWorkbench().getActiveWorkbenchWindow().run(false, true, op); //PlatformUI.getWorkbench().getProgressService().run(false, true, op); // see bug 118152 } catch (InvocationTargetException ex) { if (ex.getTargetException() != null) { ExceptionHandler.handle(ex, shell, JarPackagerMessages.CreateJarActionDelegate_jarExportError_title, JarPackagerMessages.CreateJarActionDelegate_jarExportError_message); return null; } } catch (InterruptedException e) { // do nothing on cancel return null; } return op.getStatus(); }
fEditor.getSite().getWorkbenchWindow().run(false, true, new IRunnableWithProgress() { @Override public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
protected void createSuperTypeControl(final Composite parent) { try { PlatformUI.getWorkbench().getActiveWorkbenchWindow().run(false, false, new IRunnableWithProgress() { public void run(final IProgressMonitor monitor) throws InvocationTargetException { try { createSuperTypeCombo(monitor, parent); } catch (JavaModelException exception) { throw new InvocationTargetException(exception); } finally { monitor.done(); } } }); } catch (InvocationTargetException exception) { ExceptionHandler.handle(exception, getShell(), RefactoringMessages.PullUpInputPage_pull_Up, RefactoringMessages.PullUpInputPage_exception); } catch (InterruptedException exception) { Assert.isTrue(false); } }
public void markAdditionalRequiredMembersAsMembersToPushDown() { try { PlatformUI.getWorkbench().getActiveWorkbenchWindow().run(false, false, new IRunnableWithProgress() { public void run(final IProgressMonitor pm) throws InvocationTargetException { try { getPushDownRefactoring().getPushDownProcessor().computeAdditionalRequiredMembersToPushDown(pm); updateWizardPage(null, true); } catch (final JavaModelException e) { throw new InvocationTargetException(e); } finally { pm.done(); } } }); } catch (final InvocationTargetException e) { ExceptionHandler.handle(e, getShell(), RefactoringMessages.PushDownInputPage_Push_Down, RefactoringMessages.PushDownInputPage_Internal_Error); } catch (final InterruptedException e) { Assert.isTrue(false);// not cancelable } }
public void markAdditionalRequiredMembersAsMembersToPushDown() { try { PlatformUI.getWorkbench().getActiveWorkbenchWindow().run(false, false, new IRunnableWithProgress() { @Override public void run(final IProgressMonitor pm) throws InvocationTargetException { try { fProcessor.computeAdditionalRequiredMembersToPushDown(pm); updateWizardPage(null, true); } catch (final JavaModelException e) { throw new InvocationTargetException(e); } finally { pm.done(); } } }); } catch (final InvocationTargetException e) { ExceptionHandler.handle(e, getShell(), RefactoringMessages.PushDownInputPage_Push_Down, RefactoringMessages.PushDownInputPage_Internal_Error); } catch (final InterruptedException e) { Assert.isTrue(false);// not cancelable } }
public void markAdditionalRequiredMembersAsMembersToPushDown() { try { PlatformUI.getWorkbench().getActiveWorkbenchWindow().run(false, false, new IRunnableWithProgress() { @Override public void run(final IProgressMonitor pm) throws InvocationTargetException { try { fProcessor.computeAdditionalRequiredMembersToPushDown(pm); updateWizardPage(null, true); } catch (final JavaModelException e) { throw new InvocationTargetException(e); } finally { pm.done(); } } }); } catch (final InvocationTargetException e) { ExceptionHandler.handle(e, getShell(), RefactoringMessages.PushDownInputPage_Push_Down, RefactoringMessages.PushDownInputPage_Internal_Error); } catch (final InterruptedException e) { Assert.isTrue(false);// not cancelable } }
public void run(final IStructuredSelection selection) { try { PlatformUI.getWorkbench().getActiveWorkbenchWindow().run(true, true, new WorkbenchRunnableAdapter(new IWorkspaceRunnable() { public void run(IProgressMonitor pm) throws CoreException { try{ IPackageFragmentRoot[] roots= getRootsToRemove(selection); pm.beginTask(ActionMessages.RemoveFromClasspathAction_Removing, roots.length); for (int i= 0; i < roots.length; i++) { int jCoreFlags= IPackageFragmentRoot.NO_RESOURCE_MODIFICATION | IPackageFragmentRoot.ORIGINATING_PROJECT_CLASSPATH; roots[i].delete(IResource.NONE, jCoreFlags, new SubProgressMonitor(pm, 1)); } } finally { pm.done(); } } })); } catch (InvocationTargetException e) { ExceptionHandler.handle(e, getShell(), ActionMessages.RemoveFromClasspathAction_exception_dialog_title, ActionMessages.RemoveFromClasspathAction_Problems_occurred); } catch (InterruptedException e) { // canceled } }
@Override public void run(final IStructuredSelection selection) { try { PlatformUI.getWorkbench().getActiveWorkbenchWindow().run(true, true, new WorkbenchRunnableAdapter(new IWorkspaceRunnable() { @Override public void run(IProgressMonitor pm) throws CoreException { try{ IPackageFragmentRoot[] roots= getRootsToRemove(selection); pm.beginTask(ActionMessages.RemoveFromClasspathAction_Removing, roots.length); for (int i= 0; i < roots.length; i++) { int jCoreFlags= IPackageFragmentRoot.NO_RESOURCE_MODIFICATION | IPackageFragmentRoot.ORIGINATING_PROJECT_CLASSPATH; roots[i].delete(IResource.NONE, jCoreFlags, new SubProgressMonitor(pm, 1)); } } finally { pm.done(); } } })); } catch (InvocationTargetException e) { ExceptionHandler.handle(e, getShell(), ActionMessages.RemoveFromClasspathAction_exception_dialog_title, ActionMessages.RemoveFromClasspathAction_Problems_occurred); } catch (InterruptedException e) { // canceled } }
@Override public void run(final IStructuredSelection selection) { try { PlatformUI.getWorkbench().getActiveWorkbenchWindow().run(true, true, new WorkbenchRunnableAdapter(new IWorkspaceRunnable() { @Override public void run(IProgressMonitor pm) throws CoreException { try{ IPackageFragmentRoot[] roots= getRootsToRemove(selection); pm.beginTask(ActionMessages.RemoveFromClasspathAction_Removing, roots.length); for (int i= 0; i < roots.length; i++) { int jCoreFlags= IPackageFragmentRoot.NO_RESOURCE_MODIFICATION | IPackageFragmentRoot.ORIGINATING_PROJECT_CLASSPATH; roots[i].delete(IResource.NONE, jCoreFlags, new SubProgressMonitor(pm, 1)); } } finally { pm.done(); } } })); } catch (InvocationTargetException e) { ExceptionHandler.handle(e, getShell(), ActionMessages.RemoveFromClasspathAction_exception_dialog_title, ActionMessages.RemoveFromClasspathAction_Problems_occurred); } catch (InterruptedException e) { // canceled } }
protected void createSuperTypeControl(final Composite parent) { try { PlatformUI.getWorkbench().getActiveWorkbenchWindow().run(true, false, new IRunnableWithProgress() { @Override public void run(final IProgressMonitor monitor) throws InvocationTargetException { try { fCandidateTypes= fProcessor.getCandidateTypes(new RefactoringStatus(), monitor); } catch (JavaModelException exception) { throw new InvocationTargetException(exception); } finally { monitor.done(); } } }); createSuperTypeCombo(parent); } catch (InvocationTargetException exception) { ExceptionHandler.handle(exception, getShell(), RefactoringMessages.PullUpInputPage_pull_Up, RefactoringMessages.PullUpInputPage_exception); } catch (InterruptedException exception) { Assert.isTrue(false); } }
protected void createSuperTypeControl(final Composite parent) { try { PlatformUI.getWorkbench().getActiveWorkbenchWindow().run(true, false, new IRunnableWithProgress() { @Override public void run(final IProgressMonitor monitor) throws InvocationTargetException { try { fCandidateTypes= fProcessor.getCandidateTypes(new RefactoringStatus(), monitor); } catch (JavaModelException exception) { throw new InvocationTargetException(exception); } finally { monitor.done(); } } }); createSuperTypeCombo(parent); } catch (InvocationTargetException exception) { ExceptionHandler.handle(exception, getShell(), RefactoringMessages.PullUpInputPage_pull_Up, RefactoringMessages.PullUpInputPage_exception); } catch (InterruptedException exception) { Assert.isTrue(false); } }
PlatformUI.getWorkbench().getActiveWorkbenchWindow().run(true, true, new WorkbenchRunnableAdapter(operation)); } catch (InvocationTargetException e) { ExceptionHandler.handle(e, getShell(),
PlatformUI.getWorkbench().getActiveWorkbenchWindow().run(true, true, new WorkbenchRunnableAdapter(operation)); } catch (InvocationTargetException e) { ExceptionHandler.handle(e, getShell(),
PlatformUI.getWorkbench().getActiveWorkbenchWindow().run(true, true, new WorkbenchRunnableAdapter(operation)); } catch (InvocationTargetException e) { ExceptionHandler.handle(e, getShell(),