Package org.opends.quicksetup.util
Class URLWorker
- java.lang.Object
-
- org.opends.quicksetup.util.BackgroundTask<Object>
-
- org.opends.quicksetup.util.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 Summary
Constructors Constructor Description URLWorker(QuickSetupStepPanel panel, String url)Constructs a URLWorker.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbackgroundTaskCompleted(Object returnValue, Throwable throwable)This method will be invoked to indicate that the background task has completed.StringgetURL()Returns the URL that we are trying to launch in the users browser.ObjectprocessBackgroundTask()Performs all processing associated with the task.-
Methods inherited from class org.opends.quicksetup.util.BackgroundTask
startBackgroundTask
-
-
-
-
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
-
processBackgroundTask
public Object processBackgroundTask() throws WebBrowserException
Description copied from class:BackgroundTaskPerforms all processing associated with the task.- Specified by:
processBackgroundTaskin classBackgroundTask<Object>- Returns:
- An
Objectwith information about the processing performed for this task, ornullif no return value is needed. - Throws:
WebBrowserException
-
backgroundTaskCompleted
public void backgroundTaskCompleted(Object returnValue, Throwable throwable)
Description copied from class:BackgroundTaskThis method will be invoked to indicate that the background task has completed. If processing completed successfully, then theThrowableargument will benulland thereturnValueargument will contain the value returned by theprocessBackgroundTaskmethod. If an exception or error was thrown, then thethrowableargument will not benull.- Specified by:
backgroundTaskCompletedin classBackgroundTask<Object>- Parameters:
returnValue- The value returned by theprocessBackgroundTaskmethod when processing completed, ornullif no value was returned or an exception was encountered during processing.throwable- AThrowableinstance (e.g., an exception) that was raised during processing, ornullif 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.
-
-