Class URLWorker


  • public class URLWorker
    extends BackgroundTask<Object>
    This class is used to try to launch a URL in the user web browser. The class extends SwingWorker and tries to launch the URL using a WebBrowserLauncher object in the construct method. If there is a problem launching the user's browser, this class will display a WebBrowserErrorDialog to allow the user to copy to the system clipboard the URL we wanted to display. When is finished (successfully or unsuccessfully) it notifies the QuickSetupStepPanel passed in the constructor.
    • Constructor Detail

      • URLWorker

        public URLWorker​(QuickSetupStepPanel panel,
                         String url)
        Constructs a URLWorker.
        Parameters:
        panel - the panel that created this URLWorker and to which we will notify when we are over.
        url - the url to be displayed.
    • Method Detail

      • backgroundTaskCompleted

        public void backgroundTaskCompleted​(Object returnValue,
                                            Throwable throwable)
        Description copied from class: BackgroundTask
        This method will be invoked to indicate that the background task has completed. If processing completed successfully, then the Throwable argument will be null and the returnValue argument will contain the value returned by the processBackgroundTask method. If an exception or error was thrown, then the throwable argument will not be null.
        Specified by:
        backgroundTaskCompleted in class BackgroundTask<Object>
        Parameters:
        returnValue - The value returned by the processBackgroundTask method when processing completed, or null if no value was returned or an exception was encountered during processing.
        throwable - A Throwable instance (e.g., an exception) that was raised during processing, or null if all processing completed successfully.
      • getURL

        public String getURL()
        Returns the URL that we are trying to launch in the users browser.
        Returns:
        the URL that we are trying to launch in the users browser.