Interface Progress
- All Known Implementing Classes:
ProgressImpl
public interface Progress
Represents the progress of a task and can be updated.
Usage example:
public Void call() {
Progress progress = context.getProgress();
// client.zipimport.extract_files=Archiv wird extrahiert
progress.updateInfinite( "client.zipimport.extract_archive" );
// do extract and count files...
// client.zipimport.import_files=:done von :total Dateien importiert
progress.updateAbsolute( "client.zipimport.import_files", totalCount, 0 );
for ( int i = 0; i < totalCount; i++ ) {
// do import files...
progress.updateAbsolute( "client.zipimport.import_files", totalCount, i + 1 );
}
// client.zipimport.cleanup=Aufräumen
progress.updateInfinite( "client.zipimport.cleanup" );
// do cleanup...
}
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddProgressListener(ProgressListener progressListener) Get the textresources key of the progress.Get the id of the task.getType()Get theProgressBean.Typeof the progress.getVars()Get the variables (parameters for the placeholders in the label).voidremoveProgressListener(ProgressListener progressListener) voidupdateAbsolute(String labelKey, int total, int done) Set theProgressBean.Typeof the progress toProgressBean.Type.RUNNING_ABSOLUTEand display the given label.voidupdateAbsolute(String labelKey, int total, int done, Map<String, String> vars) Set theProgressBean.Typeof the progress toProgressBean.Type.RUNNING_ABSOLUTEand display the given label.voidSet theProgressBean.Typeof the progress toProgressBean.Type.CANCELLEDand display the default label (ProgressBean.DEFAULT_CANCELLED) and notification (ProgressBean.DEFAULT_CANCELLED_NOTIFICATION).voidupdateCancelled(String labelKey) Set theProgressBean.Typeof the progress toProgressBean.Type.CANCELLED, display the given label and display the default notification (ProgressBean.DEFAULT_CANCELLED_NOTIFICATION).voidupdateCancelled(String labelKey, String notificationKey) Set theProgressBean.Typeof the progress toProgressBean.Type.CANCELLEDand display the given label and notification.voidSet theProgressBean.Typeof the progress toProgressBean.Type.CANCELLEDand display the given label and notification.voidupdateCancelled(String labelKey, Map<String, String> vars) Set theProgressBean.Typeof the progress toProgressBean.Type.CANCELLED, display the given label and display the default notification (ProgressBean.DEFAULT_CANCELLED_NOTIFICATION).voidSet theProgressBean.Typeof the progress toProgressBean.Type.COMPLETEDand display the default label (ProgressBean.DEFAULT_COMPLETED) and notification (ProgressBean.DEFAULT_COMPLETED_NOTIFICATION).voidupdateCompleted(String labelKey) Set theProgressBean.Typeof the progress toProgressBean.Type.COMPLETED, display the given label and display the default notification (ProgressBean.DEFAULT_COMPLETED_NOTIFICATION).voidupdateCompleted(String labelKey, String notificationKey) Set theProgressBean.Typeof the progress toProgressBean.Type.COMPLETEDand display the given label and notification.voidupdateCompleted(String labelKey, String notificationKey, ProgressBean.NotificationType notificationType) Set theProgressBean.Typeof the progress toProgressBean.Type.COMPLETEDand display the given label and notification.voidupdateCompleted(String labelKey, String notificationKey, ProgressBean.NotificationType notificationType, Map<String, String> vars) Set theProgressBean.Typeof the progress toProgressBean.Type.COMPLETEDand display the given label and notification.voidSet theProgressBean.Typeof the progress toProgressBean.Type.COMPLETEDand display the given label and notification.voidupdateCompleted(String labelKey, Map<String, String> vars) Set theProgressBean.Typeof the progress toProgressBean.Type.COMPLETED, display the given label and display the default notification (ProgressBean.DEFAULT_COMPLETED_NOTIFICATION).voidSet theProgressBean.Typeof the progress toProgressBean.Type.FAILEDand display the default label (ProgressBean.DEFAULT_FAILED) and notification (ProgressBean.DEFAULT_FAILED_NOTIFICATION).voidupdateFailed(String labelKey) Set theProgressBean.Typeof the progress toProgressBean.Type.FAILED, display the given label and display the default notification (ProgressBean.DEFAULT_FAILED_NOTIFICATION).voidupdateFailed(String labelKey, String notificationKey) Set theProgressBean.Typeof the progress toProgressBean.Type.FAILEDand display the given label and notification.voidSet theProgressBean.Typeof the progress toProgressBean.Type.FAILEDand display the given label and notification.voidupdateFailed(String labelKey, Map<String, String> vars) Set theProgressBean.Typeof the progress toProgressBean.Type.FAILED, display the given label and display the default notification (ProgressBean.DEFAULT_FAILED_NOTIFICATION).voidupdateInfinite(String labelKey) Set theProgressBean.Typeof the progress toProgressBean.Type.RUNNING_INFINITEand display the given label.voidupdateInfinite(String labelKey, Map<String, String> vars) Set theProgressBean.Typeof the progress toProgressBean.Type.RUNNING_INFINITEand display the given label.
-
Method Details
-
addProgressListener
-
removeProgressListener
-
getProgressListeners
List<ProgressListener> getProgressListeners() -
getTaskId
String getTaskId()Get the id of the task.- Returns:
- the id of the task
-
getType
ProgressBean.Type getType()Get theProgressBean.Typeof the progress.- Returns:
- the
ProgressBean.Type
-
getLabelKey
String getLabelKey()Get the textresources key of the progress.- Returns:
- the textressources key
-
getVars
Get the variables (parameters for the placeholders in the label).- Returns:
- the variables
-
updateInfinite
Set theProgressBean.Typeof the progress toProgressBean.Type.RUNNING_INFINITEand display the given label.- Parameters:
labelKey- the key (text resources) of the label to display
-
updateInfinite
Set theProgressBean.Typeof the progress toProgressBean.Type.RUNNING_INFINITEand display the given label.- Parameters:
labelKey- the key (text resources) of the label to displayvars- a map with the parameters to replace the placeholders in the label with
-
updateAbsolute
Set theProgressBean.Typeof the progress toProgressBean.Type.RUNNING_ABSOLUTEand display the given label.- Parameters:
labelKey- the key (text resources) of the label to displaytotal- the total count of the itemsdone- the count of the items that are already done
-
updateAbsolute
Set theProgressBean.Typeof the progress toProgressBean.Type.RUNNING_ABSOLUTEand display the given label.- Parameters:
labelKey- the key (text ressurces) of the label to displaytotal- the total count of the itemsdone- the count of the items that are already donevars- a map with the parameters to replace the placeholders in the label with
-
updateCompleted
void updateCompleted()Set theProgressBean.Typeof the progress toProgressBean.Type.COMPLETEDand display the default label (ProgressBean.DEFAULT_COMPLETED) and notification (ProgressBean.DEFAULT_COMPLETED_NOTIFICATION). -
updateCompleted
Set theProgressBean.Typeof the progress toProgressBean.Type.COMPLETED, display the given label and display the default notification (ProgressBean.DEFAULT_COMPLETED_NOTIFICATION).- Parameters:
labelKey- the key (text resources) of the label to display
-
updateCompleted
Set theProgressBean.Typeof the progress toProgressBean.Type.COMPLETED, display the given label and display the default notification (ProgressBean.DEFAULT_COMPLETED_NOTIFICATION).- Parameters:
labelKey- the key (text resources) of the label to displayvars- a map with the parameters to replace the placeholders in the label with.
-
updateCompleted
Set theProgressBean.Typeof the progress toProgressBean.Type.COMPLETEDand display the given label and notification.- Parameters:
labelKey- the key (text resources) of the label to displaynotificationKey- the key (text resources) of the notification to display
-
updateCompleted
Set theProgressBean.Typeof the progress toProgressBean.Type.COMPLETEDand display the given label and notification.- Parameters:
labelKey- the key (text resources) of the label to displaynotificationKey- the key (text resources) of the notification to displayvars- a map with the parameters to replace the placeholders in the label and also in the notification with.
-
updateCompleted
void updateCompleted(String labelKey, String notificationKey, ProgressBean.NotificationType notificationType) Set theProgressBean.Typeof the progress toProgressBean.Type.COMPLETEDand display the given label and notification.- Parameters:
labelKey- the key (text resources) of the label to displaynotificationKey- the key (text resources) of the notification to displaynotificationType- the type of the notification to display
-
updateCompleted
void updateCompleted(String labelKey, String notificationKey, ProgressBean.NotificationType notificationType, Map<String, String> vars) Set theProgressBean.Typeof the progress toProgressBean.Type.COMPLETEDand display the given label and notification.- Parameters:
labelKey- the key (text resources) of the label to displaynotificationKey- the key (text resources) of the notification to displaynotificationType- the type of the notification to displayvars- a map with the parameters to replace the placeholders in the label and also in the notification with.
-
updateFailed
void updateFailed()Set theProgressBean.Typeof the progress toProgressBean.Type.FAILEDand display the default label (ProgressBean.DEFAULT_FAILED) and notification (ProgressBean.DEFAULT_FAILED_NOTIFICATION). -
updateFailed
Set theProgressBean.Typeof the progress toProgressBean.Type.FAILED, display the given label and display the default notification (ProgressBean.DEFAULT_FAILED_NOTIFICATION).- Parameters:
labelKey- the key (text resources) of the label to display
-
updateFailed
Set theProgressBean.Typeof the progress toProgressBean.Type.FAILED, display the given label and display the default notification (ProgressBean.DEFAULT_FAILED_NOTIFICATION).- Parameters:
labelKey- the key (text resources) of the label to displayvars- a map with the parameters to replace the placeholders in the label with.
-
updateFailed
Set theProgressBean.Typeof the progress toProgressBean.Type.FAILEDand display the given label and notification.- Parameters:
labelKey- the key (text resources) of the label to displaynotificationKey- the key (text resources) of the notification to display
-
updateFailed
Set theProgressBean.Typeof the progress toProgressBean.Type.FAILEDand display the given label and notification.- Parameters:
labelKey- the key (text resources) of the label to displaynotificationKey- the key (text resources) of the notification to displayvars- a map with the parameters to replace the placeholders in the label and also in the notification with.
-
updateCancelled
void updateCancelled()Set theProgressBean.Typeof the progress toProgressBean.Type.CANCELLEDand display the default label (ProgressBean.DEFAULT_CANCELLED) and notification (ProgressBean.DEFAULT_CANCELLED_NOTIFICATION). -
updateCancelled
Set theProgressBean.Typeof the progress toProgressBean.Type.CANCELLED, display the given label and display the default notification (ProgressBean.DEFAULT_CANCELLED_NOTIFICATION).- Parameters:
labelKey- the key (text resources) of the label to display
-
updateCancelled
Set theProgressBean.Typeof the progress toProgressBean.Type.CANCELLED, display the given label and display the default notification (ProgressBean.DEFAULT_CANCELLED_NOTIFICATION).- Parameters:
labelKey- the key (text resources) of the label to displayvars- a map with the parameters to replace the placeholders in the label with.
-
updateCancelled
Set theProgressBean.Typeof the progress toProgressBean.Type.CANCELLEDand display the given label and notification.- Parameters:
labelKey- the key (text resources) of the label to displaynotificationKey- the key (text resources) of the notification to display
-
updateCancelled
Set theProgressBean.Typeof the progress toProgressBean.Type.CANCELLEDand display the given label and notification.- Parameters:
labelKey- the key (text resources) of the label to displaynotificationKey- the key (text resources) of the notification to displayvars- a map with the parameters to replace the placeholders in the label and also in the notification with.
-