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 TypeMethodDescriptionvoid
addProgressListener
(ProgressListener progressListener) Get the textresources key of the progress.Get the id of the task.getType()
Get theProgressBean.Type
of the progress.getVars()
Get the variables (parameters for the placeholders in the label).void
removeProgressListener
(ProgressListener progressListener) void
updateAbsolute
(String labelKey, int total, int done) Set theProgressBean.Type
of the progress toProgressBean.Type.RUNNING_ABSOLUTE
and display the given label.void
updateAbsolute
(String labelKey, int total, int done, Map<String, String> vars) Set theProgressBean.Type
of the progress toProgressBean.Type.RUNNING_ABSOLUTE
and display the given label.void
Set theProgressBean.Type
of the progress toProgressBean.Type.CANCELLED
and display the default label (ProgressBean.DEFAULT_CANCELLED
) and notification (ProgressBean.DEFAULT_CANCELLED_NOTIFICATION
).void
updateCancelled
(String labelKey) Set theProgressBean.Type
of the progress toProgressBean.Type.CANCELLED
, display the given label and display the default notification (ProgressBean.DEFAULT_CANCELLED_NOTIFICATION
).void
updateCancelled
(String labelKey, String notificationKey) Set theProgressBean.Type
of the progress toProgressBean.Type.CANCELLED
and display the given label and notification.void
Set theProgressBean.Type
of the progress toProgressBean.Type.CANCELLED
and display the given label and notification.void
updateCancelled
(String labelKey, Map<String, String> vars) Set theProgressBean.Type
of the progress toProgressBean.Type.CANCELLED
, display the given label and display the default notification (ProgressBean.DEFAULT_CANCELLED_NOTIFICATION
).void
Set theProgressBean.Type
of the progress toProgressBean.Type.COMPLETED
and display the default label (ProgressBean.DEFAULT_COMPLETED
) and notification (ProgressBean.DEFAULT_COMPLETED_NOTIFICATION
).void
updateCompleted
(String labelKey) Set theProgressBean.Type
of the progress toProgressBean.Type.COMPLETED
, display the given label and display the default notification (ProgressBean.DEFAULT_COMPLETED_NOTIFICATION
).void
updateCompleted
(String labelKey, String notificationKey) Set theProgressBean.Type
of the progress toProgressBean.Type.COMPLETED
and display the given label and notification.void
updateCompleted
(String labelKey, String notificationKey, ProgressBean.NotificationType notificationType) Set theProgressBean.Type
of the progress toProgressBean.Type.COMPLETED
and display the given label and notification.void
updateCompleted
(String labelKey, String notificationKey, ProgressBean.NotificationType notificationType, Map<String, String> vars) Set theProgressBean.Type
of the progress toProgressBean.Type.COMPLETED
and display the given label and notification.void
Set theProgressBean.Type
of the progress toProgressBean.Type.COMPLETED
and display the given label and notification.void
updateCompleted
(String labelKey, Map<String, String> vars) Set theProgressBean.Type
of the progress toProgressBean.Type.COMPLETED
, display the given label and display the default notification (ProgressBean.DEFAULT_COMPLETED_NOTIFICATION
).void
Set theProgressBean.Type
of the progress toProgressBean.Type.FAILED
and display the default label (ProgressBean.DEFAULT_FAILED
) and notification (ProgressBean.DEFAULT_FAILED_NOTIFICATION
).void
updateFailed
(String labelKey) Set theProgressBean.Type
of the progress toProgressBean.Type.FAILED
, display the given label and display the default notification (ProgressBean.DEFAULT_FAILED_NOTIFICATION
).void
updateFailed
(String labelKey, String notificationKey) Set theProgressBean.Type
of the progress toProgressBean.Type.FAILED
and display the given label and notification.void
Set theProgressBean.Type
of the progress toProgressBean.Type.FAILED
and display the given label and notification.void
updateFailed
(String labelKey, Map<String, String> vars) Set theProgressBean.Type
of the progress toProgressBean.Type.FAILED
, display the given label and display the default notification (ProgressBean.DEFAULT_FAILED_NOTIFICATION
).void
updateInfinite
(String labelKey) Set theProgressBean.Type
of the progress toProgressBean.Type.RUNNING_INFINITE
and display the given label.void
updateInfinite
(String labelKey, Map<String, String> vars) Set theProgressBean.Type
of the progress toProgressBean.Type.RUNNING_INFINITE
and 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.Type
of 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.Type
of the progress toProgressBean.Type.RUNNING_INFINITE
and display the given label.- Parameters:
labelKey
- the key (text resources) of the label to display
-
updateInfinite
Set theProgressBean.Type
of the progress toProgressBean.Type.RUNNING_INFINITE
and 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.Type
of the progress toProgressBean.Type.RUNNING_ABSOLUTE
and 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.Type
of the progress toProgressBean.Type.RUNNING_ABSOLUTE
and 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.Type
of the progress toProgressBean.Type.COMPLETED
and display the default label (ProgressBean.DEFAULT_COMPLETED
) and notification (ProgressBean.DEFAULT_COMPLETED_NOTIFICATION
). -
updateCompleted
Set theProgressBean.Type
of 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.Type
of 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.Type
of the progress toProgressBean.Type.COMPLETED
and 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.Type
of the progress toProgressBean.Type.COMPLETED
and 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.Type
of the progress toProgressBean.Type.COMPLETED
and 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.Type
of the progress toProgressBean.Type.COMPLETED
and 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.Type
of the progress toProgressBean.Type.FAILED
and display the default label (ProgressBean.DEFAULT_FAILED
) and notification (ProgressBean.DEFAULT_FAILED_NOTIFICATION
). -
updateFailed
Set theProgressBean.Type
of 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.Type
of 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.Type
of the progress toProgressBean.Type.FAILED
and 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.Type
of the progress toProgressBean.Type.FAILED
and 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.Type
of the progress toProgressBean.Type.CANCELLED
and display the default label (ProgressBean.DEFAULT_CANCELLED
) and notification (ProgressBean.DEFAULT_CANCELLED_NOTIFICATION
). -
updateCancelled
Set theProgressBean.Type
of 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.Type
of 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.Type
of the progress toProgressBean.Type.CANCELLED
and 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.Type
of the progress toProgressBean.Type.CANCELLED
and 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.
-