Klasse Progress
java.lang.Object
com.inet.viewer.Progress
- Alle implementierten Schnittstellen:
Runnable
- Bekannte direkte Unterklassen:
ExportProgress, PrinterJobProgress
Class for all progresses, which should be handled as a Progress of the report viewer. A progress
encapsulates a special task with a state (such as idle, running or complete) and a value
(23 of 120) of its progress. To start the progress call the
startProgress() method and
the progress will perform its run method. In this method call setProgress(int), setTotalProgress(int),
setStatus(int) to propagate the status of the progress.
The progress will be registered at the ProgressPool and will inform its listeners
about property changes such as its status, current step and total steps.
Depending on the progress type the progress will be displayed at the StatusBar
or not.- Seit:
- 7.0
-
Feldübersicht
FelderModifikator und TypFeldBeschreibungstatic final StringThe property ProgressIndeterminate for PropertyChangeEventsstatic final StringThe property ProgressStatus for PropertyChangeEventsstatic final StringThe property ProgressStep for PropertyChangeEventsstatic final StringThe property ProgressTotal for PropertyChangeEventsprotected final PropertyChangeSupportFOR INTERNAL USE ONLYstatic final intThe progress was canceledstatic final intThe progress was successfully completedstatic final intThe progress was canceled due to an errorstatic final intThe progress idlesstatic final intThe progress has been created but has not been started yetstatic final intThe progress has not been created yetstatic final intThe progress is runningstatic final intThe type is export progress, which means the progress will be shown as export progress in the status barstatic final intThe type is invisible, do not show this progress in the status bar *static final intThe type is navigation progress, which means the progress will be shown as navigation progress in the status barstatic final intThe type is print progress, which means the progress will be shown as printing progress in the status barstatic final intThe type is search progress, which means the progress will be shown as search progress in the status bar -
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungProgress(ReportView reportView, int type) Creates a new progress object with the given type and sets it as being "indeterminate" (that is, a "busy"/"not busy" progress) or determinate (that is, with clearly defined steps - step 1 of 5, step 2 of 5, etc.)Progress(Component parent, ViewerContext viewerContext, int type) Creates a new progress object with the given type and sets it as being "indeterminate" (that is, a "busy"/"not busy" progress) or determinate (that is, with clearly defined steps - step 1 of 5, step 2 of 5, etc.) -
Methodenübersicht
Modifikator und TypMethodeBeschreibungvoidAdds a PropertyChangeListener to this progress.abstract voidcancel()Call this method to force a cancel of the progress - which must also set both of the states "finished" and "canceled" to true.protected voidcleanUp()Final clean up of the progress: unregister all property change listeners, etc.Returns the last error message of this Progress.abstract StringgetName()The name of the daemon thread.intUse this method to get the current step of this progress .Returns the ReportView to which this progress belongs.intReturns the status of this Progress.intUse this method to get the total steps (e.g. pages) to go.intgetType()Returns the type of the progress, which can be one of the following types.booleanReturns whether this progress has been canceled - progresses which can be canceled should overload this method.booleanReturns whether this progress has been stopped due to an error - progresses which can be stopped due to an error should overload this method.booleanReturn true if the progress has stopped its task.booleanReturns whether this progress is indeterminate, that is, only a "busy" or "not busy" progress.voidRemoves a PropertyChangeListener from this progress.voidsetErrorMessage(String msg) Sets an error message for this progress to pass failure information to the viewer.voidsetIndeterminate(boolean indeterminate) Set the status of the progress to indeterminate or determined.voidsetProgress(int step) Use this method to set the progress and to inform all registered listeners about the current step.voidsetStatus(int status) Call this method to set the status of this progress.voidsetTotalProgress(int total) Use this method to inform all registered listeners about the total steps (e.g. pages) to go.voidShows an error dialog for this error message.final voidCall this method to start the progress.voidThis method will block until the progress has finished it task.
-
Felddetails
-
TYPE_PAGELOADER
public static final int TYPE_PAGELOADERThe type is navigation progress, which means the progress will be shown as navigation progress in the status bar- Seit:
- 7.0
- Siehe auch:
-
TYPE_PRINT
public static final int TYPE_PRINTThe type is print progress, which means the progress will be shown as printing progress in the status bar- Seit:
- 7.0
- Siehe auch:
-
TYPE_EXPORT
public static final int TYPE_EXPORTThe type is export progress, which means the progress will be shown as export progress in the status bar- Seit:
- 7.0
- Siehe auch:
-
TYPE_SEARCH
public static final int TYPE_SEARCHThe type is search progress, which means the progress will be shown as search progress in the status bar- Seit:
- 7.0
- Siehe auch:
-
TYPE_INVISIBLE
public static final int TYPE_INVISIBLEThe type is invisible, do not show this progress in the status bar *- Seit:
- 7.0
- Siehe auch:
-
STATUS_NOT_INITIALIZED
public static final int STATUS_NOT_INITIALIZEDThe progress has not been created yet- Seit:
- 7.0
- Siehe auch:
-
STATUS_INITIALIZED
public static final int STATUS_INITIALIZEDThe progress has been created but has not been started yet- Seit:
- 7.0
- Siehe auch:
-
STATUS_RUNNING
public static final int STATUS_RUNNINGThe progress is running- Seit:
- 7.0
- Siehe auch:
-
STATUS_COMPLETED
public static final int STATUS_COMPLETEDThe progress was successfully completed- Seit:
- 7.0
- Siehe auch:
-
STATUS_CANCELED
public static final int STATUS_CANCELEDThe progress was canceled- Seit:
- 7.0
- Siehe auch:
-
STATUS_ERROR
public static final int STATUS_ERRORThe progress was canceled due to an error- Seit:
- 7.0
- Siehe auch:
-
STATUS_IDLE
public static final int STATUS_IDLEThe progress idles- Seit:
- 7.0
- Siehe auch:
-
PROP_PROGRESS_STATUS
The property ProgressStatus for PropertyChangeEvents- Seit:
- 7.0
- Siehe auch:
-
PROP_PROGRESS_TOTAL
The property ProgressTotal for PropertyChangeEvents- Seit:
- 7.0
- Siehe auch:
-
PROP_PROGRESS_STEP
The property ProgressStep for PropertyChangeEvents- Seit:
- 7.0
- Siehe auch:
-
PROP_PROGRESS_INDETERMINATE
The property ProgressIndeterminate for PropertyChangeEvents- Seit:
- 7.0
- Siehe auch:
-
propertySupporter
FOR INTERNAL USE ONLY
-
-
Konstruktordetails
-
Progress
Creates a new progress object with the given type and sets it as being "indeterminate" (that is, a "busy"/"not busy" progress) or determinate (that is, with clearly defined steps - step 1 of 5, step 2 of 5, etc.) The Progress will register itself to the viewer ProgressPool, which handles all progresses.- Parameter:
reportView- The ReportView of this progress.type- E.g. NAVIGATION, PRINT, EXPORT, SEARCH or a custom defined constant.- Seit:
- 7.0
-
Progress
Creates a new progress object with the given type and sets it as being "indeterminate" (that is, a "busy"/"not busy" progress) or determinate (that is, with clearly defined steps - step 1 of 5, step 2 of 5, etc.) This Progress will NOT registered to the viewer ProgressPool. It is useful for export without report preview.- Parameter:
parent- Component, used for showErrorviewerContext- ViewerContext, used for showErrortype- E.g. NAVIGATION, PRINT, EXPORT, SEARCH or a custom defined constant.- Seit:
- 7.6
-
-
Methodendetails
-
startProgress
public final void startProgress()Call this method to start the progress. The progress will register itself at the ProgressPool of the Viewer.- Löst aus:
ViewerException- when progress is already running- Seit:
- 7.0
-
getName
The name of the daemon thread.- Gibt zurück:
- the name of the daemon thread.
- Seit:
- 7.0
-
cancel
public abstract void cancel()Call this method to force a cancel of the progress - which must also set both of the states "finished" and "canceled" to true. Please note: some progresses may not be stoppable.- Seit:
- 7.0
-
getType
public int getType()Returns the type of the progress, which can be one of the following types.- Gibt zurück:
- Type of the progress
- Seit:
- 7.0
- Siehe auch:
-
waitUntilFinished
public void waitUntilFinished()This method will block until the progress has finished it task.- Seit:
- 7.0
-
isIndeterminate
public boolean isIndeterminate()Returns whether this progress is indeterminate, that is, only a "busy" or "not busy" progress. If not, this progress has specific steps and can be determined how far it is finished.- Gibt zurück:
- Whether this progress is indeterminate, that is, only a "busy" or "not busy" progress.
- Seit:
- 7.0
-
setIndeterminate
public void setIndeterminate(boolean indeterminate) Set the status of the progress to indeterminate or determined.- Parameter:
indeterminate- True if the progress should be indeterminate.- Seit:
- 7.0
-
setStatus
public void setStatus(int status) Call this method to set the status of this progress. The status could beSTATUS_INITIALIZED,STATUS_RUNNING,STATUS_IDLE,STATUS_CANCELED,STATUS_COMPLETED,STATUS_ERROR. If the status isSTATUS_ERRORusedsetErrorMessage(String),showError(Throwable)to give a reason for this error. All registered listeners will be informed about this change.- Parameter:
status- Status of this progress- Seit:
- 7.0
-
isFinished
public boolean isFinished()Return true if the progress has stopped its task. The status of the Progress can be complete, canceled or error.- Gibt zurück:
- whether the progress has stopped
- Seit:
- 7.0
-
isCanceled
public boolean isCanceled()Returns whether this progress has been canceled - progresses which can be canceled should overload this method.- Gibt zurück:
- Whether this progress has been canceled
- Seit:
- 7.0
-
isErrored
public boolean isErrored()Returns whether this progress has been stopped due to an error - progresses which can be stopped due to an error should overload this method.- Gibt zurück:
- Whether this progress has been stopped due to an error
- Seit:
- 7.0
-
setTotalProgress
public void setTotalProgress(int total) Use this method to inform all registered listeners about the total steps (e.g. pages) to go. If total is set to zero the progress will be declared as inactive (status = Progress.STATUS_IDLE).- Parameter:
total- steps to go- Seit:
- 7.0
-
getTotalProgress
public int getTotalProgress()Use this method to get the total steps (e.g. pages) to go.- Gibt zurück:
- steps to go
- Seit:
- 7.0
-
setProgress
public void setProgress(int step) Use this method to set the progress and to inform all registered listeners about the current step.- Parameter:
step- Steps made in the progress so far (1-based)- Seit:
- 7.0
-
getProgress
public int getProgress()Use this method to get the current step of this progress .- Gibt zurück:
- current step of the progress
- Seit:
- 7.0
-
getReportView
Returns the ReportView to which this progress belongs.- Gibt zurück:
- The ReportView of this progress.
- Seit:
- 7.0
-
getStatus
public int getStatus()Returns the status of this Progress. The could beSTATUS_INITIALIZED,STATUS_RUNNING,STATUS_IDLE,STATUS_CANCELED,STATUS_COMPLETED,STATUS_ERROR- Gibt zurück:
- Return the status of this Progress
- Seit:
- 7.0
-
getErrorMessage
Returns the last error message of this Progress.- Gibt zurück:
- The last error of this Progress.
- Seit:
- 7.0
-
setErrorMessage
Sets an error message for this progress to pass failure information to the viewer.- Parameter:
msg- error message- Seit:
- 7.0
-
showError
Shows an error dialog for this error message. If there is no ReportView it will print a stacktrace to the console. It is calling setErrorMessage(String) and setStatus(STATUS_ERROR) before the error message is show.- Parameter:
th- The exception to show in the error dialog.- Seit:
- 7.0
- Siehe auch:
-
addPropertyChangeListener
Adds a PropertyChangeListener to this progress. All registered listeners will be informed if the status of the progress changes.- Parameter:
l- PropertyChangeListener- Seit:
- 7.0
-
removePropertyChangeListener
Removes a PropertyChangeListener from this progress.- Parameter:
l- PropertyChangeListener- Seit:
- 7.0
-
cleanUp
protected void cleanUp()Final clean up of the progress: unregister all property change listeners, etc.- Seit:
- 8.0
-