Line | |
---|
1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.gui.download;
|
---|
3 |
|
---|
4 | /**
|
---|
5 | * Defines an interface for different download sources.
|
---|
6 | * <p>
|
---|
7 | * Plugins may implement this to provide new download sources to the main download dialog.
|
---|
8 | * @param <T> The type of the data that a download source uses.
|
---|
9 | * @since 12652
|
---|
10 | */
|
---|
11 | public interface DownloadSource<T> {
|
---|
12 |
|
---|
13 | /**
|
---|
14 | * Creates a panel with GUI specific for the download source.
|
---|
15 | * @param dialog the parent download dialog, as {@code DownloadDialog.getInstance()} might not be initialized yet
|
---|
16 | * @return Returns {@link AbstractDownloadSourcePanel}.
|
---|
17 | * @since 12900
|
---|
18 | */
|
---|
19 | AbstractDownloadSourcePanel<T> createPanel(DownloadDialog dialog);
|
---|
20 |
|
---|
21 | /**
|
---|
22 | * Downloads the data.
|
---|
23 | * @param data The required data for the download source.
|
---|
24 | * @param settings The global settings of the download dialog, see {@link DownloadDialog}.
|
---|
25 | */
|
---|
26 | void doDownload(T data, DownloadSettings settings);
|
---|
27 |
|
---|
28 | /**
|
---|
29 | * Returns a string representation of this download source.
|
---|
30 | * @return A string representation of this download source.
|
---|
31 | */
|
---|
32 | String getLabel();
|
---|
33 |
|
---|
34 | /**
|
---|
35 | * Defines whether this download source should be visible only in the expert mode.
|
---|
36 | * @return Returns {@code true} if the download source should be visible only in the
|
---|
37 | * expert mode, {@code false} otherwise.
|
---|
38 | */
|
---|
39 | boolean onlyExpert();
|
---|
40 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.