} else if (panels instanceof ProgressInstantiatingIterator) { err.fine("is ProgressInstantiatingIterator"); handle = ProgressHandleFactory.createHandle (PROGRESS_BAR_DISPLAY_NAME); final JComponent progressComp = ProgressHandleFactory.createProgressComponent (handle); final JLabel detailComp = ProgressHandleFactory.createDetailLabelComponent (handle); Mutex.EVENT.readAccess( new Runnable() { @Override } else if (panels instanceof AsynchronousInstantiatingIterator) { err.fine("is AsynchronousInstantiatingIterator"); handle = ProgressHandleFactory.createHandle (PROGRESS_BAR_DISPLAY_NAME); final JComponent progressComp = ProgressHandleFactory.createProgressComponent (handle); final JLabel mainLabelComp = ProgressHandleFactory.createMainLabelComponent (handle); Mutex.EVENT.readAccess( new Runnable() { @Override handle.start (); err.log (Level.FINE, "Show progressPanel later.");
public synchronized ProgressDisplayer showProgress(String message) { ph = ProgressHandleFactory.createHandle(message); ph.start(); return DEFAULT; }
/** * Create a handle for a long lasting task that is not triggered by explicit user action. * Such tasks have lower priority in the UI. * @param displayName to be shown in the progress UI * @return an instance of {@link org.netbeans.api.progress.ProgressHandle}, initialized but not started. */ public static ProgressHandle createSystemHandle(String displayName) { return createSystemHandle(displayName, null); }
@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);
/** * finish the task, remove the task's component from the progress bar UI, any additional incoming events from the * contributors will be ignored. */ public synchronized void finish() { if (finished) { return; } finished = true; handle.finish(); }
/** * Create a progress ui handle for a long lasting task. * @param linkOutput an <code>Action</code> instance that links the running task in the progress bar * to an output of the task. The action is assumed to open the apropriate component with the task's output. * @param displayName to be shown in the progress UI * @return an instance of {@link org.netbeans.api.progress.ProgressHandle}, initialized but not started. * */ public static ProgressHandle createHandle(String displayName, Action linkOutput) { return createHandle(displayName, null, linkOutput); }
/** * start the progress indication for the task with an initial time estimate, shows the progress in the UI, events from the contributors are * expected after this call. * @param estimate estimated time to process the task in seconds */ public synchronized void start(long estimate) { handle.start(WORKUNITS, estimate); current = 0; }
/** * Notify the user about completed workunits. * This method has to be called after calling <code>start</code> method and before calling <code>finish</code> method (the task has to be running). * @param workunit a cumulative number of workunits completed so far */ public void progress(int workunit) { progress(null, workunit); }
/** * have the component in custom location, don't include in the status bar. */ JComponent extractComponent() { return ProgressHandleFactory.createProgressComponent(handle); }
/** * Get the task title component for use in custom dialogs, the task won't * show in the progress bar anymore. The text of the label is changed by calls to <code>ProgressHandle.setDisplayName()</code> method * @return the component to use in custom UI. * @since org.netbeans.api.progress 1.8 */ public static JLabel createMainLabelComponent(ProgressHandle handle) { return handle.extractMainLabel(); }
public synchronized ProgressDisplayer showProgress(String message, ProgressController controller) { ph = ProgressHandleFactory.createHandle(message, controller); ph.start(); return DEFAULT; }
public synchronized void close() { if (ph != null) { ph.finish(); ph = null; } } };
/** * Create a progress ui handle for a long lasting task. * @param allowToCancel either null, if the task cannot be cancelled or * an instance of {@link org.openide.util.Cancellable} that will be called when user * triggers cancel of the task. * @param displayName to be shown in the progress UI * @return an instance of {@link org.netbeans.api.progress.ProgressHandle}, initialized but not started. * @deprecated Use {@link ProgressHandle#createHandle(java.lang.String, org.openide.util.Cancellable)}. */ public static ProgressHandle createHandle(String displayName, Cancellable allowToCancel) { return createHandle(displayName, allowToCancel, null); }
/** * start the progress indication for a task with known number of steps. * <code>start</code> method can be called just once. * @param workunits total number of workunits that will be processed */ public void start(int workunits) { start(workunits, -1); }
/** * Create a cancelable handle for a task that is not triggered by explicit user action. * Such tasks have lower priority in the UI. * @param displayName to be shown in the progress UI * @param allowToCancel either null, if the task cannot be cancelled or * an instance of {@link org.openide.util.Cancellable} that will be called when user * triggers cancel of the task. * @return an instance of {@link org.netbeans.api.progress.ProgressHandle}, initialized but not started. */ public static ProgressHandle createSystemHandle(String displayName, Cancellable allowToCancel) { return createSystemHandle(displayName, allowToCancel, null); }
public synchronized ProgressDisplayer showProgress(String caption, String message, ProgressController controller) { ph = ProgressHandleFactory.createHandle(message, controller); ph.start(); return DEFAULT; }
void close() { if (handle != null) { handle.finish(); } } }
/** * Create a progress ui handle for a long lasting task. * @param displayName to be shown in the progress UI * @return an instance of {@link org.netbeans.api.progress.ProgressHandle}, initialized but not started. */ public static ProgressHandle createHandle(String displayName) { return createHandle(displayName, null, null); }
/*************************************************************************** * * **************************************************************************/ private void startProgressHandle() { if (name != null) { progressHandle = ProgressHandleFactory.createHandle(name); progressHandle.start(); } } }
/** * Create a progress ui handle for a long lasting task. * @param allowToCancel either null, if the task cannot be cancelled or * an instance of {@link org.openide.util.Cancellable} that will be called when user * triggers cancel of the task. * @param displayName to be shown in the progress UI * @return an instance of {@link org.netbeans.api.progress.ProgressHandle}, initialized but not started. */ public static ProgressHandle createHandle(String displayName, Cancellable allowToCancel) { return createHandle(displayName, allowToCancel, null); }