public class OpenLocationAction extends JosmAction
JosmAction.LayerChangeAdapter, JosmAction.SelectionChangeAdapter
Modifier and Type | Field and Description |
---|---|
protected List<Class<? extends DownloadTask>> |
downloadTasks |
sc
changeSupport, enabled
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON
Constructor and Description |
---|
OpenLocationAction()
Create an open action.
|
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(ActionEvent e) |
boolean |
addDownloadTaskClass(Class<? extends DownloadTask> taskClass)
Adds a new download task to the supported ones.
|
(package private) Collection<DownloadTask> |
askWhichTasksToLoad(Collection<DownloadTask> tasks)
Asks the user which of the possible tasks to perform.
|
Collection<DownloadTask> |
findDownloadTasks(String url,
boolean isRemotecontrol)
Replies the list of download tasks accepting the given url.
|
String |
findSummaryDocumentation()
Summarizes acceptable urls for error message purposes.
|
void |
openUrl(boolean newLayer,
String url)
Open the given URL.
|
protected void |
remindUploadAddressHistory(HistoryComboBox cbHistory)
Remind the current history in the preferences
|
protected void |
restoreUploadAddressHistory(HistoryComboBox cbHistory)
Restore the current history from the preferences
|
(package private) void |
warnNoSuitableTasks(String url)
Displays an error message dialog that no suitable tasks have been found for the given url.
|
destroy, getCurrentDataSet, getEditLayer, getShortcut, initEnabledState, installAdapters, setTooltip, updateEnabledState, updateEnabledState
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
protected final transient List<Class<? extends DownloadTask>> downloadTasks
public OpenLocationAction()
protected void restoreUploadAddressHistory(HistoryComboBox cbHistory)
cbHistory
- the history combo boxprotected void remindUploadAddressHistory(HistoryComboBox cbHistory)
cbHistory
- the history combo boxpublic void actionPerformed(ActionEvent e)
public Collection<DownloadTask> findDownloadTasks(String url, boolean isRemotecontrol)
url
- The URL to openisRemotecontrol
- True if download request comes from remotecontrol.public String findSummaryDocumentation()
public void openUrl(boolean newLayer, String url)
newLayer
- true if the URL needs to be opened in a new layer, false otherwiseurl
- The URL to openCollection<DownloadTask> askWhichTasksToLoad(Collection<DownloadTask> tasks)
tasks
- a list of possible tasksvoid warnNoSuitableTasks(String url)
url
- the given urlpublic final boolean addDownloadTaskClass(Class<? extends DownloadTask> taskClass)
taskClass
- The new download task to addCollection.add(E)
)