Package editor.util
Class ProgressFeedback
java.lang.Object
editor.util.ProgressFeedback
- All Implemented Interfaces:
IProgressCallback,ActionListener,EventListener
A helper class for displaying a
ProgressWindow while a task
executes in a worker thread.-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedProgressFeedback(String strNotice, boolean bHideAbortButton, boolean bShowInStudioGlassPane) Construct a ProgressFeedback with a given text notice. -
Method Summary
Modifier and TypeMethodDescriptionvoidintbooleanincrementProgress(String strMessage, String... args) booleanisAbort()Should the operation abort?voidSignals that the operation is completestatic <T> TrunWithPossibleDialog(Callable<T> callable, String message) protected static ProgressFeedbackrunWithProgress(IRunnableWithProgress task, ProgressFeedback progressFeedback) static ProgressFeedbackrunWithProgress(String strNotice, IRunnableWithProgress task) A helper method that executes a task in a worker thread and displays feedback in a progress windows.static ProgressFeedbackrunWithProgress(String strNotice, IRunnableWithProgress task, boolean bHideAbortBtn) static ProgressFeedbackrunWithProgress(String strNotice, IRunnableWithProgress task, boolean bHideAbortBtn, boolean bShowInStudioGlassPane) voidsetLength(int iLength) How long is this operation in units?booleanupdateProgress(int iProgress, String strMessage, String... args) Call this when a unit of progress completes.booleanupdateProgress(String strMessage, String... args) Call this to update the progress message without modifying the amount of progress completed.
-
Constructor Details
-
ProgressFeedback
protected ProgressFeedback(String strNotice, boolean bHideAbortButton, boolean bShowInStudioGlassPane) Construct a ProgressFeedback with a given text notice.- Parameters:
strNotice- The text notice to display in the ProgressWindow.bHideAbortButton- will hide abort buttonbShowInStudioGlassPane- will show in studio pane
-
-
Method Details
-
runWithProgress
A helper method that executes a task in a worker thread and displays feedback in a progress windows.- Parameters:
strNotice- The text notice to display in the ProgressWindow.task- The task to execute in a separate (worker) thread.
-
runWithProgress
public static ProgressFeedback runWithProgress(String strNotice, IRunnableWithProgress task, boolean bHideAbortBtn) -
runWithProgress
public static ProgressFeedback runWithProgress(String strNotice, IRunnableWithProgress task, boolean bHideAbortBtn, boolean bShowInStudioGlassPane) -
runWithProgress
protected static ProgressFeedback runWithProgress(IRunnableWithProgress task, ProgressFeedback progressFeedback) -
runWithPossibleDialog
-
setLength
public void setLength(int iLength) Description copied from interface:IProgressCallbackHow long is this operation in units? For a StagedProgressFeedback, this moves to the next stage- Specified by:
setLengthin interfaceIProgressCallback- Parameters:
iLength- The number of units the operation is expected to execute.
-
updateProgress
Description copied from interface:IProgressCallbackCall this when a unit of progress completes.- Specified by:
updateProgressin interfaceIProgressCallback- Parameters:
iProgress- The unit of progress completed.strMessage- A short message describing the progress.- Returns:
- Whether or not the operation should abort. True to abort operation.
-
incrementProgress
- Specified by:
incrementProgressin interfaceIProgressCallback
-
updateProgress
Description copied from interface:IProgressCallbackCall this to update the progress message without modifying the amount of progress completed.- Specified by:
updateProgressin interfaceIProgressCallback
-
getProgress
public int getProgress()- Specified by:
getProgressin interfaceIProgressCallback
-
isAbort
public boolean isAbort()Description copied from interface:IProgressCallbackShould the operation abort?- Specified by:
isAbortin interfaceIProgressCallback- Returns:
- True if the operation should abort.
-
actionPerformed
- Specified by:
actionPerformedin interfaceActionListener
-
operationComplete
public void operationComplete()Description copied from interface:IProgressCallbackSignals that the operation is complete- Specified by:
operationCompletein interfaceIProgressCallback
-