Class PleaseWaitRunnable

    • Constructor Detail

      • PleaseWaitRunnable

        protected PleaseWaitRunnable​(String title)
        Create the runnable object with a given message for the user.
        Parameters:
        title - message for the user
      • PleaseWaitRunnable

        protected PleaseWaitRunnable​(String title,
                                     boolean ignoreException)
        Create the runnable object with a given message for the user.
        Parameters:
        title - message for the user
        ignoreException - If true, exception will be silently ignored. If false then exception will be handled by showing a dialog. When this runnable is executed using executor framework then use false unless you read result of task (because exception will get lost if you don't)
      • PleaseWaitRunnable

        protected PleaseWaitRunnable​(Component parent,
                                     String title,
                                     boolean ignoreException)
        Create the runnable object with a given message for the user
        Parameters:
        parent - the parent component for the please wait dialog. Must not be null.
        title - message for the user
        ignoreException - If true, exception will be silently ignored. If false then exception will be handled by showing a dialog. When this runnable is executed using executor framework then use false unless you read result of task (because exception will get lost if you don't)
        Throws:
        IllegalArgumentException - if parent is null
      • PleaseWaitRunnable

        protected PleaseWaitRunnable​(String title,
                                     ProgressMonitor progressMonitor,
                                     boolean ignoreException)
        Create the runnable object with a given message for the user
        Parameters:
        title - message for the user
        progressMonitor - progress monitor
        ignoreException - If true, exception will be silently ignored. If false then exception will be handled by showing a dialog. When this runnable is executed using executor framework then use false unless you read result of task (because exception will get lost if you don't)
    • Method Detail

      • afterFinish

        protected void afterFinish()
        Can be overridden if something needs to run after progress monitor is closed.
      • run

        public final void run()
        Specified by:
        run in interface Runnable
      • cancel

        protected abstract void cancel()
        User pressed cancel button.
      • finish

        protected abstract void finish()
        Finish up the data work. Is guaranteed to be called if realRun is called. Finish is called in the gui thread just after the dialog disappeared.
      • canRunInBackground

        public ProgressTaskId canRunInBackground()
        Task can run in background if returned value != null. Note that it's tasks responsibility to ensure proper synchronization, PleaseWaitRunnable doesn't with it.
        Returns:
        If returned value is != null then task can run in background. TaskId could be used in future for "Always run in background" checkbox