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 |
---|---|
private static BooleanProperty |
DOWNLOAD_ZOOMTODATA
true to zoom to entire newly downloaded data, false otherwise
|
protected java.util.List<java.lang.Class<? extends DownloadTask>> |
downloadTasks
the list of download tasks
|
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.
|
java.util.List<java.util.concurrent.Future<?>> |
openUrl(boolean newLayer,
boolean zoomToData,
java.lang.String url)
Open the given URL.
|
java.util.List<java.util.concurrent.Future<?>> |
openUrl(boolean newLayer,
java.lang.String url)
Open the given URL.
|
java.util.List<java.util.concurrent.Future<?>> |
openUrl(DownloadParams settings,
boolean zoomToData,
java.lang.String url)
Open the given URL.
|
java.util.List<java.util.concurrent.Future<?>> |
openUrl(DownloadParams settings,
java.lang.String url)
Open the given URL.
|
java.util.List<java.util.concurrent.Future<?>> |
openUrl(java.lang.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
|
protected void |
warnNoSuitableTasks(java.lang.String url)
Displays an error message dialog that no suitable tasks have been found for the given url.
|
checkAndConfirmOutlyingOperation, destroy, getLayerManager, getShortcut, initEnabledState, installAdapters, listenToLayerChange, listenToSelectionChange, setTooltip, updateEnabledState, updateEnabledState, updateEnabledStateOnCurrentSelection, updateEnabledStateOnCurrentSelection, updateEnabledStateOnModifiableSelection, waitFuture
private static final BooleanProperty USE_NEW_LAYER
private static final BooleanProperty DOWNLOAD_ZOOMTODATA
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 java.util.List<java.util.concurrent.Future<?>> 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 java.util.List<java.util.concurrent.Future<?>> openUrl(DownloadParams settings, java.lang.String url)
settings
- download settingsurl
- The URL to openpublic java.util.List<java.util.concurrent.Future<?>> openUrl(java.lang.String url)
USE_NEW_LAYER
preference to check if a new layer should be used.url
- The URL to openpublic java.util.List<java.util.concurrent.Future<?>> openUrl(boolean newLayer, boolean zoomToData, java.lang.String url)
newLayer
- true if the URL needs to be opened in a new layer, false otherwisezoomToData
- true to zoom to entire newly downloaded data, false otherwiseurl
- The URL to openpublic java.util.List<java.util.concurrent.Future<?>> openUrl(DownloadParams settings, boolean zoomToData, java.lang.String url)
settings
- download settingszoomToData
- true to zoom to entire newly downloaded data, false otherwiseurl
- The URL to openjava.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 addtrue
(as specified by Collection.add(E)
)