public boolean isCanceled() { return monitor.isCanceled(); }
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 ) throws InvocationTargetException, InterruptedException { db = new Database( Spoon.loggingObject, dbMeta ); try { db.connect(); result = db.getQueryFields( sql, false ); if ( monitor.isCanceled() ) { throw new InvocationTargetException( new Exception( "This operation was cancelled!" ) ); } } catch ( Exception e ) { throw new InvocationTargetException( e, "Problem encountered determining query fields: " + e.toString() ); } finally { db.disconnect(); } } };
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 } } } };
public void run( IProgressMonitor monitor ) throws InvocationTargetException, InterruptedException { db = new Database( Spoon.loggingObject, dbMeta ); try { db.connect(); String sql = dbMeta.getDatabaseInterface().getSelectCountStatement( tableName ); RowMetaAndData row = db.getOneRow( sql ); size = row.getRowMeta().getInteger( row.getData(), 0 ); if ( monitor.isCanceled() ) { throw new InvocationTargetException( new Exception( "This operation was cancelled!" ) ); } } catch ( KettleException e ) { throw new InvocationTargetException( e, "Couldn't get a result because of an error :" + e.toString() ); } finally { db.disconnect(); } } };
if ( monitor.isCanceled() ) { return null; monitor .beginTask( BaseMessages.getString( PKG, "GetXMLDateLoopNodesImportProgressDialog.Task.ReadingDocument" ), 1 ); if ( monitor.isCanceled() ) { return null; monitor.beginTask( BaseMessages.getString( PKG, "GetXMLDateLoopNodesImportProgressDialog.Task.ReadingNode" ), 1 ); if ( monitor.isCanceled() ) { return null; monitor.subTask( BaseMessages.getString( PKG, "GetXMLDateLoopNodesImportProgressDialog.Task.FetchNodes" ) ); if ( monitor.isCanceled() ) { return null; if ( monitor.isCanceled() ) { return null;
if ( monitor.isCanceled() ) { return null; monitor .beginTask( BaseMessages.getString( PKG, "GetXMLDateLoopNodesImportProgressDialog.Task.ReadingDocument" ), 1 ); if ( monitor.isCanceled() ) { return null; monitor.beginTask( BaseMessages.getString( PKG, "GetXMLDateLoopNodesImportProgressDialog.Task.ReadingNode" ), 1 ); if ( monitor.isCanceled() ) { return null; monitor.subTask( BaseMessages.getString( PKG, "GetXMLDateLoopNodesImportProgressDialog.Task.FetchNodes" ) ); if ( monitor.isCanceled() ) { return null; if ( monitor.isCanceled() ) { return null;
private void addLoopXPath( Node node, IProgressMonitor monitor ) { Element ce = (Element) node; monitor.worked( 1 ); // List child for ( int j = 0; j < ce.nodeCount(); j++ ) { if ( monitor.isCanceled() ) { return; } Node cnode = ce.node( j ); if ( !Utils.isEmpty( cnode.getName() ) ) { Element cce = (Element) cnode; if ( !listpath.contains( cnode.getPath() ) ) { nr++; monitor.subTask( BaseMessages.getString( PKG, "GetXMLDateLoopNodesImportProgressDialog.Task.FetchNodes", String.valueOf( nr ) ) ); monitor.subTask( BaseMessages.getString( PKG, "GetXMLDateLoopNodesImportProgressDialog.Task.AddingNode", cnode.getPath() ) ); listpath.add( cnode.getPath() ); } // let's get child nodes if ( cce.nodeCount() > 1 ) { addLoopXPath( cnode, monitor ); } } } }
&& !trans.isFinished() && !progressMonitor.isCanceled() ) { if ( progressMonitor.isCanceled() ) { cancelled = true; trans.stopAll();
pmd.run( true, true, op ); if ( !pmd.getProgressMonitor().isCanceled() && isFeedback ) {
while ( !errorFound && line != null && ( linenr <= samples || samples == 0 ) && !monitor.isCanceled() ) { monitor.subTask( BaseMessages.getString( PKG, "TextFileCSVImportProgressDialog.Task.ScanningLine", "" + linenr ) );
while ( !errorFound && line != null && ( linenr <= samples || samples == 0 ) && !monitor.isCanceled() ) { monitor.subTask( BaseMessages.getString( PKG, "TextFileCSVImportProgressDialog.Task.ScanningLine", "" + linenr ) );
for ( int i = 0; i < tables.length && !monitor.isCanceled(); i++ ) { monitor.setTaskName( BaseMessages.getString( PKG, "Spoon.RipDB.Monitor.ProcessingTable" ) + tables[i] + "]..." );
private void forwardCancellation() { if (!this.cancelRequested && this.monitor.isCanceled()) { this.tokenSource.cancel(); this.cancelRequested = true; } } }
public Hover hover(TextDocumentPositionParams position, IProgressMonitor monitor) { ITypeRoot unit = JDTUtils.resolveTypeRoot(position.getTextDocument().getUri()); List<Either<String, MarkedString>> content = null; if (unit != null && !monitor.isCanceled()) { content = computeHover(unit, position.getPosition().getLine(), position.getPosition().getCharacter(), monitor); } else { content = Collections.singletonList(Either.forLeft("")); } Hover $ = new Hover(); $.setContents(content); return $; }
@Override public void runInToolingApi(CancellationTokenSource tokenSource, IProgressMonitor monitor) throws Exception { SubMonitor progress = SubMonitor.convert(monitor); progress.setWorkRemaining(2); CancellationToken token = tokenSource.token(); op1.runInToolingApi(tokenSource, progress.newChild(1)); if (monitor.isCanceled() && token.isCancellationRequested()) { throw new OperationCanceledException(); } op2.runInToolingApi(tokenSource, progress.newChild(1)); }