Class TaskAwareExecutor
java.lang.Object
com.evolveum.midpoint.gui.impl.page.admin.abstractrole.component.TaskAwareExecutor
Executes arbitrary code that needs a
Task
and an OperationResult
.
Creates a task, executes the code, and then handles any errors.
Displays the operation result.
Created to avoid repeating these actions throughout GUI code.
This class is NOT SERIALIZABLE (although it probably could be made so); neither the instances of TaskAwareExecutor.Executable
and TaskAwareExecutor.ExecutableVoid
are. Please do not store these objects in Wicket components (directly or indirectly).
TODO the treatment of "void" methods is not good now (two methods + ugly names); to be improved-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
static interface
-
Constructor Summary
ConstructorDescriptionTaskAwareExecutor
(@NotNull PageBase pageBase, @NotNull org.apache.wicket.ajax.AjaxRequestTarget ajaxRequestTarget, @NotNull String operation) -
Method Summary
Modifier and TypeMethodDescriptionIf true, only non-success status is shown (in feedback panel).<X> X
run
(@NotNull TaskAwareExecutor.Executable<X> executable) Returns `null` in case of error; even in cases where the originalTaskAwareExecutor.Executable.execute(Task, OperationResult)
_implementation_ is marked as `@NotNull`.void
runVoid
(@NotNull TaskAwareExecutor.ExecutableVoid executable) TODO better namewithCustomFeedbackPanel
(org.apache.wicket.Component panel) If the feedback panel is different from the default one.withOpResultOptions
(OpResult.Options options) Options for rendering the operation result.
-
Constructor Details
-
TaskAwareExecutor
-
-
Method Details
-
hideSuccessfulStatus
If true, only non-success status is shown (in feedback panel). -
withOpResultOptions
Options for rendering the operation result. -
withCustomFeedbackPanel
If the feedback panel is different from the default one. -
run
Returns `null` in case of error; even in cases where the originalTaskAwareExecutor.Executable.execute(Task, OperationResult)
_implementation_ is marked as `@NotNull`. -
runVoid
TODO better name
-