/** * 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 new ProgressHandle(new InternalHandle(displayName, allowToCancel, false, 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 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, Cancellable allowToCancel, Action linkOutput) { return new ProgressHandle(new InternalHandle(displayName, allowToCancel, true, linkOutput)); }
/** * Create a progress ui handle for a task that is not triggered by explicit user action. * @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 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 createSystemHandle(String displayName, Cancellable allowToCancel, Action linkOutput) { return new ProgressHandle(new InternalHandle(displayName, allowToCancel, false, linkOutput)); }