public void run() { IProgressMonitor monitor = pmd.getProgressMonitor(); while ( pmd.getShell() == null || ( !pmd.getShell().isDisposed() && !monitor.isCanceled() ) ) { try { Thread.sleep( 100 ); } catch ( InterruptedException e ) { // Ignore } } if ( monitor.isCanceled() ) { // Disconnect and see what happens! try { trans.stopAll(); } catch ( Exception e ) { /* Ignore */ } } } };
public void run() { IProgressMonitor monitor = pmd.getProgressMonitor(); while ( pmd.getShell() == null || ( !pmd.getShell().isDisposed() && !monitor.isCanceled() ) ) { try { Thread.sleep( 250 ); } catch ( InterruptedException e ) { // Ignore sleep interruption exception } } if ( monitor.isCanceled() ) { // Disconnect and see what happens! try { transMeta.cancelQueries(); } catch ( Exception e ) { // Ignore cancel errors } } } };
public void run() { IProgressMonitor monitor = pmd.getProgressMonitor(); while ( pmd.getShell() == null || ( !pmd.getShell().isDisposed() && !monitor.isCanceled() ) ) { try { Thread.sleep( 100 ); } catch ( InterruptedException e ) { // Ignore } } if ( monitor.isCanceled() ) { // Disconnect and see what happens! try { db.cancelQuery(); } catch ( Exception e ) { // Ignore } } } };
public void run() { IProgressMonitor monitor = pmd.getProgressMonitor(); while ( pmd.getShell() == null || ( !pmd.getShell().isDisposed() && !monitor.isCanceled() ) ) { try { Thread.sleep( 250 ); } catch ( InterruptedException e ) { // Ignore } } if ( monitor.isCanceled() ) { // Disconnect and see what happens! try { db.cancelQuery(); } catch ( Exception e ) { // Ignore } } } };
public void run() { IProgressMonitor monitor = pmd.getProgressMonitor(); while ( pmd.getShell() == null || ( !pmd.getShell().isDisposed() && !monitor.isCanceled() ) ) { try { Thread.sleep( 100 ); } catch ( InterruptedException e ) { // Ignore } } if ( monitor.isCanceled() ) { // Disconnect and see what happens! try { db.cancelQuery(); } catch ( Exception e ) { // Ignore } } } };
@Override public void run() { IProgressMonitor monitor = pmd.getProgressMonitor(); while ( pmd.getShell() == null || ( !pmd.getShell().isDisposed() && !monitor.isCanceled() ) ) { try { Thread.sleep( 250 ); } catch ( InterruptedException e ) { // Ignore } } if ( monitor.isCanceled() ) { // Disconnect and see what happens! try { transMeta.cancelQueries(); } catch ( Exception e ) { // Ignore } } } };
/** * Enables the cancel button (asynchronously). * * @param b * The state to set the button to. */ private void asyncSetOperationCancelButtonEnabled(final boolean b) { if (getShell() != null) { getShell().getDisplay().asyncExec(new Runnable() { public void run() { setOperationCancelButtonEnabled(b); } }); } }
/** * Clear the cursors in the dialog. * * @since 3.0 */ protected void clearCursors() { if (cancel != null && !cancel.isDisposed()) { cancel.setCursor(null); } Shell shell = getShell(); if (shell != null && !shell.isDisposed()) { shell.setCursor(null); } if (arrowCursor != null) { arrowCursor.dispose(); } arrowCursor = null; }
/** * Clear the cursors in the dialog. */ protected void clearCursors() { if (cancel != null && !cancel.isDisposed()) { cancel.setCursor(null); } Shell shell = getShell(); if (shell != null && !shell.isDisposed()) { shell.setCursor(null); } if (arrowCursor != null) { arrowCursor.dispose(); } if (waitCursor != null) { waitCursor.dispose(); } arrowCursor = null; waitCursor = null; }
/** * Clear the cursors in the dialog. * * @since 3.0 */ protected void clearCursors() { if (cancel != null && !cancel.isDisposed()) { cancel.setCursor(null); } Shell shell = getShell(); if (shell != null && !shell.isDisposed()) { shell.setCursor(null); } if (arrowCursor != null) { arrowCursor.dispose(); } if (waitCursor != null) { waitCursor.dispose(); } arrowCursor = null; waitCursor = null; }
/** * This implementation of IRunnableContext#run(boolean, boolean, * IRunnableWithProgress) runs the given <code>IRunnableWithProgress</code> * using the progress monitor for this progress dialog and blocks until the * runnable has been run, regardless of the value of <code>fork</code>. * The dialog is opened before the runnable is run, and closed after it * completes. It is recommended that <code>fork</code> is set to true in * most cases. If <code>fork</code> is set to <code>false</code>, the * runnable will run in the UI thread and it is the runnable's * responsibility to call <code>Display.readAndDispatch()</code> to ensure * UI responsiveness. */ @Override public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException { setCancelable(cancelable); try { aboutToRun(); // Let the progress monitor know if they need to update in UI Thread progressMonitor.forked = fork; ModalContext.run(runnable, fork, getProgressMonitor(), getShell() .getDisplay()); } finally { finishedRun(); } }
/** * This implementation of IRunnableContext#run(boolean, boolean, * IRunnableWithProgress) runs the given <code>IRunnableWithProgress</code> * using the progress monitor for this progress dialog and blocks until the * runnable has been run, regardless of the value of <code>fork</code>. * The dialog is opened before the runnable is run, and closed after it * completes. It is recommended that <code>fork</code> is set to true in * most cases. If <code>fork</code> is set to <code>false</code>, the * runnable will run in the UI thread and it is the runnable's * responsibility to call <code>Display.readAndDispatch()</code> to ensure * UI responsiveness. */ @Override public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException { setCancelable(cancelable); try { aboutToRun(); // Let the progress monitor know if they need to update in UI Thread progressMonitor.forked = fork; ModalContext.run(runnable, fork, getProgressMonitor(), getShell() .getDisplay()); } finally { finishedRun(); } }