Package uk.ac.starlink.topcat
Class DownloadDialog
java.lang.Object
uk.ac.starlink.topcat.DownloadDialog
Provides a dialogue that disposes of a URL by downloading the resource
to a location specified interactively by the user.
- Since:
- 15 Jun 2018
- Author:
- Mark Taylor
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract File
Acquires a destination File for a downloaded resource by interacting with the user.static DownloadDialog
createSwingDialog
(Component parent) Returns an instance of this class based on a Swing JFileChooser.static DownloadDialog
createSystemDialog
(Component parent) Returns an instance of this class based on an AWT FileDialog.userDownload
(URL url) Downloads the resource from a given URL to a file selected interactively by the user.
-
Constructor Details
-
DownloadDialog
public DownloadDialog()
-
-
Method Details
-
chooseFileEdt
Acquires a destination File for a downloaded resource by interacting with the user. This method is invoked on the Event Dispatch Thread.- Returns:
- user-selected destination file, or null if the operation is cancelled
-
userDownload
Downloads the resource from a given URL to a file selected interactively by the user. This method is not invoked on the Event Dispatch Thread.- Parameters:
url
- location of resource to download- Returns:
- operation outcome
-
createSystemDialog
Returns an instance of this class based on an AWT FileDialog. This provides less consistency, but possibly tighter system interaction.- Parameters:
parent
- parent component- Returns:
- dialog
-
createSwingDialog
Returns an instance of this class based on a Swing JFileChooser. This provides a GUI that is consistent between different platforms.- Parameters:
parent
- parent component- Returns:
- dialog
-