public class OpenLocationAction extends JosmAction
| Modifier and Type | Class and Description |
|---|---|
(package private) static class |
OpenLocationAction.WhichTasksToPerformDialog |
JosmAction.ActiveLayerChangeAdapter, JosmAction.LayerChangeAdapter, JosmAction.SelectionChangeAdapter| Modifier and Type | Field and Description |
|---|---|
protected java.util.List<java.lang.Class<? extends DownloadTask>> |
downloadTasks |
private static BooleanProperty |
USE_NEW_LAYER
true if the URL needs to be opened in a new layer, false otherwise
|
sc| Constructor and Description |
|---|
OpenLocationAction()
Create an open action.
|
| Modifier and Type | Method and Description |
|---|---|
void |
actionPerformed(java.awt.event.ActionEvent e) |
boolean |
addDownloadTaskClass(java.lang.Class<? extends DownloadTask> taskClass)
Adds a new download task to the supported ones.
|
(package private) java.util.Collection<DownloadTask> |
askWhichTasksToLoad(java.util.Collection<DownloadTask> tasks)
Asks the user which of the possible tasks to perform.
|
java.util.Collection<DownloadTask> |
findDownloadTasks(java.lang.String url,
boolean isRemotecontrol)
Replies the list of download tasks accepting the given url.
|
java.lang.String |
findSummaryDocumentation()
Summarizes acceptable urls for error message purposes.
|
void |
openUrl(boolean newLayer,
java.lang.String url)
Open the given URL.
|
boolean |
openUrl(java.lang.String url)
Open the given URL.
|
private boolean |
realOpenUrl(boolean newLayer,
java.lang.String 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
|
protected void |
warnNoSuitableTasks(java.lang.String url)
Displays an error message dialog that no suitable tasks have been found for the given url.
|
destroy, getLayerManager, getShortcut, initEnabledState, installAdapters, listenToLayerChange, listenToSelectionChange, setTooltip, updateEnabledState, updateEnabledState, updateEnabledStateOnCurrentSelection, waitFutureprivate static final BooleanProperty USE_NEW_LAYER
protected final transient java.util.List<java.lang.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(java.awt.event.ActionEvent e)
public java.util.Collection<DownloadTask> findDownloadTasks(java.lang.String url, boolean isRemotecontrol)
url - The URL to openisRemotecontrol - True if download request comes from remotecontrol.public java.lang.String findSummaryDocumentation()
public void openUrl(boolean newLayer, java.lang.String url)
newLayer - true if the URL needs to be opened in a new layer, false otherwiseurl - The URL to openpublic boolean openUrl(java.lang.String url)
USE_NEW_LAYER preference to check if a new layer should be used.url - The URL to opentrue if at least one task was started successfully.private boolean realOpenUrl(boolean newLayer, java.lang.String url)
java.util.Collection<DownloadTask> askWhichTasksToLoad(java.util.Collection<DownloadTask> tasks)
tasks - a list of possible tasksprotected void warnNoSuitableTasks(java.lang.String url)
url - the given urlpublic final boolean addDownloadTaskClass(java.lang.Class<? extends DownloadTask> taskClass)
taskClass - The new download task to addCollection.add(E))