Class TaskProgressView<T extends Task<?>>

  • All Implemented Interfaces:
    Styleable, EventTarget, Skinnable

    public class TaskProgressView<T extends Task<?>>
    extends Control
    The task progress view is used to visualize the progress of long running tasks. These tasks are created via the Task class. This view manages a list of such tasks and displays each one of them with their name, progress, and update messages.

    An optional graphic factory can be set to place a graphic in each row. This allows the user to more easily distinguish between different types of tasks.

    Screenshots

    The picture below shows the default appearance of the task progress view control:
    Screenshot of TaskProgressView

    Code Sample

     TaskProgressView<MyTask> view = new TaskProgressView<>();
     view.setGraphicFactory(task -> return new ImageView("db-access.png"));
     view.getTasks().add(new MyTask());
     
    • Constructor Detail

      • TaskProgressView

        public TaskProgressView()
        Constructs a new task progress view.
    • Method Detail

      • getTasks

        public final ObservableList<T> getTasks()
        Returns the list of tasks currently monitored by this view.
        Returns:
        the monitored tasks
      • isRetainTasks

        public final boolean isRetainTasks()
        Checks if tasks will not be removed when succeeded, cancelled or failed.
        Returns:
        boolean determines if tasks will be retained
      • setRetainTasks

        public final void setRetainTasks​(boolean retainTasks)
        Do not remove tasks when succeeded, cancelled or failed.
        Parameters:
        retainTasks - determines if tasks will be retained
      • getUserAgentStylesheet

        protected final String getUserAgentStylesheet​(Class<?> clazz,
                                                      String fileName)
        A helper method that ensures that the resource based lookup of the user agent stylesheet only happens once. Caches the external form of the resource.
        Parameters:
        clazz - the class used for the resource lookup
        fileName - the name of the user agent stylesheet
        Returns:
        the external form of the user agent stylesheet (the path)