/** * Currently determinate task can be switched to indeterminate mode. */ @Override public void switchToIndeterminate() { if (handle != null) { handle.switchToIndeterminate(); } } }
@Override void switchToIndeterminate() { handle.switchToIndeterminate(); }
public @Override void transferCompleted(TransferEvent e) { LOG.fine("completed"); handle.switchToIndeterminate(); }
public @Override void transferError(TransferEvent e) { LOG.log(Level.FINE, "error transferring", e.getException()); handle.switchToIndeterminate(); }
@Override public void operationStart(Operation operation, Collection<TransferFile> forFiles) { if (operations.isEmpty()) { assert workUnits >= 0 : workUnits + " :: " + forFiles; progressHandle.start(workUnits); } operations.offerFirst(operation); if (operation == Operation.LIST) { progressHandle.progress(NbBundle.getMessage(RemoteCommand.class, "LBL_ListingFiles", forFiles.iterator().next().getName())); progressHandle.switchToIndeterminate(); } }
@Override public void addUnits(Collection<TransferFile> files) { progressHandle.switchToIndeterminate(); workUnits += getWorkUnits(files); progressHandle.switchToDeterminate(workUnits); }
@Override public void run() { ProgressHandle handle = ProgressHandleFactory.createHandle(displayName); handle.start(); handle.switchToIndeterminate(); try { ref.set(operation.run(handle)); } finally { handle.finish(); } } }, displayName, new AtomicBoolean(false), true, 0, 0);
@Override public void beginTask(String taskName, int totalWork) { this.progressHandle.setDisplayName(taskName); this.progressHandle.start(totalWork, -1); if (this.isIndeterminate) { this.progressHandle.switchToIndeterminate(); } if (this.console != null) { this.console.setVisible(true); } }
@Override public void run() { final ProgressHandle h = ProgressHandleFactory.createHandle(getName()); h.start(); h.switchToIndeterminate(); try { doPaste(); } catch (java.io.IOException ioe) { Exceptions.printStackTrace(ioe); } finally { h.finish(); } } });
public TaskWorker(UserCredentialsRepository repository, Task<T> task) { this.userCredentialsRepository = repository; this.task = task; assert SwingUtilities.isEventDispatchThread(); handle = ProgressHandle.createHandle("Sonar"); handle.start(); handle.switchToIndeterminate(); try{ this.task.init(); }catch(Throwable t){ handle.finish(); handle=null; throw t; } }
private void applyPatch() { String progressFormat = NbBundle.getMessage(AttachmentsPanel.class,"Attachment.applyPatch.progress"); //NOI18N String progressMessage = MessageFormat.format(progressFormat, getFilename()); final ProgressHandle handle = ProgressHandleFactory.createHandle(progressMessage); handle.start(); handle.switchToIndeterminate(); Support.getInstance().getParallelRP().post( new Runnable() { @Override public void run() { IDEServices ideServices = Support.getInstance().getIDEServices(); if(ideServices != null) { try { ideServices.applyPatch(saveToTempFile()); } catch (IOException ex) { LOG.log(Level.WARNING, ex.getMessage(), ex); } finally { handle.finish(); } } } }); }
panel = new SearchPanel(ProgressHandleFactory.createProgressComponent(progress)); progress.start(); progress.switchToIndeterminate(); final Dialog[] dialog = new Dialog[1]; try {
final ProgressHandle handle = ProgressHandleFactory.createHandle(progressMessage); handle.start(); handle.switchToIndeterminate(); Support.getInstance().getParallelRP().post(new Runnable() { @Override
public void scanningStarted(IndexingContext ctx) { handle = ProgressHandleFactory.createHandle("Indexing Repo : " + (ri!=null? ri.getName() : indexingContext.getId())); if (debug) { writer.println("Indexing Repo : " + (ri!=null? ri.getName():ctx.getId())); writer.println("Index Directory : " + ctx.getIndexDirectory().toString()); writer.println("--------------------------------------------------------"); writer.println("Scanning started at " + SimpleDateFormat.getInstance().format(new Date())); } handle.start(); handle.switchToIndeterminate(); tstart = System.currentTimeMillis(); }
private void saveToFile() { final File file = new FileChooserBuilder(AttachmentsPanel.class) .setFilesOnly(true).showSaveDialog(); if (file != null) { String progressFormat = NbBundle.getMessage( SaveAttachmentAction.class, "Attachment.saveToFile.progress"); //NOI18N String progressMessage = MessageFormat.format(progressFormat, getFilename()); final ProgressHandle handle = ProgressHandleFactory.createHandle(progressMessage); handle.start(); handle.switchToIndeterminate(); Support.getInstance().getParallelRP().post(new Runnable() { @Override public void run() { try { getAttachmentData(file); } catch (IOException ioex) { LOG.log(Level.INFO, ioex.getMessage(), ioex); } finally { handle.finish(); } } }); } }
@Messages({"LBL_Preparing=Preparing...", "#{0} - the name of the file being formatted", "LBL_Formatting=Formatting: {0}", "LBL_BulkFormatting=Formatting"}) private static void doFormat(ProgressHandle handle, AtomicBoolean cancel) throws IOException { try { handle.switchToIndeterminate(); handle.progress(Bundle.LBL_Preparing());
public void modelProjectForDataSources(Project currentProj) { project = currentProj; ModelSet.addModelSetsListener(modelingListener); topComponent = TopComponent.getRegistry().getActivated(); topComponent.setCursor(Utilities.createProgressCursor(topComponent)); String progressBarLabel = org.openide.util.NbBundle.getMessage(DataSourceResolver.class, "LBL_ProgressBar"); //NOI18N try { // model project FacesModelSet modelSet = FacesModelSet.startModeling(project); if (modelSet == null) { handle = ProgressHandleFactory.createHandle(progressBarLabel); handle.start(); handle.switchToIndeterminate(); } // If modeling has been completed then terminate the progress cursor and update the project if (modelSet != null) { if (handle != null) { handle.finish(); } ModelSet.removeModelSetsListener(modelingListener); ProjectDataSourceTracker.refreshDataSourceReferences(project); update(project); } } finally { topComponent.setCursor(null); } }
Project nue = null; try { handle.switchToIndeterminate(); handle.switchToDeterminate(5); int currentWorkDone = 0;
activeServerProgressValue = serverProgress; } else if (serverProgress == CommonConstants.SERVER_PROGRESS_INDETERMINATE) { progressHandle.switchToIndeterminate(); } else { if (serverProgress > activeServerProgressValue) {