Class FileDownloadWindow
java.lang.Object
com.biglybt.ui.swt.FileDownloadWindow
- All Implemented Interfaces:
TorrentDownloaderCallBackInterface, IProgressReportConstants
public class FileDownloadWindow
extends Object
implements TorrentDownloaderCallBackInterface, IProgressReportConstants
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Runnable(package private) String(package private) String(package private) TorrentDownloader(package private) booleanprivate int(package private) TorrentDownloaderCallBackInterface(package private) String(package private) org.eclipse.swt.widgets.Shell(package private) IProgressReporter(package private) String(package private) Map(package private) String(package private) TorrentOpenOptionsFields inherited from interface IProgressReportConstants
AUTO_CLOSE, BORDER, MANAGER_EVENT_ADDED, MANAGER_EVENT_REMOVED, MANAGER_EVENT_UPDATED, MODAL, MSG_TYPE_ERROR, MSG_TYPE_INFO, MSG_TYPE_LOG, NONE, REPORT_TYPE_CANCEL, REPORT_TYPE_DISPOSED, REPORT_TYPE_DONE, REPORT_TYPE_ERROR, REPORT_TYPE_INIT, REPORT_TYPE_MODE_CHANGE, REPORT_TYPE_PROPERTY_CHANGED, REPORT_TYPE_RETRY, REPORTER_TYPE_DEFAULT, REPORTER_VISIBILITY_SYSTEM, REPORTER_VISIBILITY_USER, RETVAL_OK, RETVAL_OK_TO_DISPOSE, SHOW_TOOLBAR, STANDALONE -
Constructor Summary
ConstructorsModifierConstructorDescriptionFileDownloadWindow(org.eclipse.swt.widgets.Shell parent, String url, String referrer, Map request_properties, boolean force_dialog) FileDownloadWindow(org.eclipse.swt.widgets.Shell parent, String url, String referrer, Map request_properties, TorrentOpenOptions torrentOptions, TorrentDownloaderCallBackInterface listener) Create a file download window.privateFileDownloadWindow(org.eclipse.swt.widgets.Shell parent, String url, String referrer, Map request_properties, TorrentOpenOptions torrentOptions, TorrentDownloaderCallBackInterface listener, Runnable callOnError) FileDownloadWindow(org.eclipse.swt.widgets.Shell parent, String url, String referrer, Map request_properties, Runnable runOnError) Create a file download window. -
Method Summary
Modifier and TypeMethodDescriptionprivate StringgetFileName(String url) Brute-force extraction of the torrent file name or title from the given URLprivate StringgetShortURL(String url) Returns a shortened version of the given urlprivate booleanprivate voidinit()private voidInitializes the reporter and show the download dialog if it is not suppressedvoidTorrentDownloaderEvent(int state, TorrentDownloader inf) private voidupdate()
-
Field Details
-
downloader
TorrentDownloader downloader -
listener
TorrentDownloaderCallBackInterface listener -
force_dialog
boolean force_dialog -
callOnError
-
pReporter
IProgressReporter pReporter -
parent
org.eclipse.swt.widgets.Shell parent -
original_url
String original_url -
decoded_url
String decoded_url -
referrer
String referrer -
request_properties
Map request_properties -
dirName
String dirName -
shortURL
String shortURL -
torrentOptions
TorrentOpenOptions torrentOptions -
lastState
private int lastState
-
-
Constructor Details
-
FileDownloadWindow
-
FileDownloadWindow
public FileDownloadWindow(org.eclipse.swt.widgets.Shell parent, String url, String referrer, Map request_properties, TorrentOpenOptions torrentOptions, TorrentDownloaderCallBackInterface listener) Create a file download window. If no listener is supplied, torrent will be added when download is complete. If a listener is supplied, caller handles it- Parameters:
parent-url-referrer-listener-
-
FileDownloadWindow
private FileDownloadWindow(org.eclipse.swt.widgets.Shell parent, String url, String referrer, Map request_properties, TorrentOpenOptions torrentOptions, TorrentDownloaderCallBackInterface listener, Runnable callOnError) -
FileDownloadWindow
-
-
Method Details
-
handleByProtocol
private boolean handleByProtocol() -
init
private void init() -
setupAndShowDialog
private void setupAndShowDialog()Initializes the reporter and show the download dialog if it is not suppressed -
TorrentDownloaderEvent
- Specified by:
TorrentDownloaderEventin interfaceTorrentDownloaderCallBackInterface
-
update
private void update() -
getShortURL
-
getFileName
-