Package org.openstreetmap.josm.actions
Class OpenLocationAction
java.lang.Object
javax.swing.AbstractAction
org.openstreetmap.josm.actions.JosmAction
org.openstreetmap.josm.actions.OpenLocationAction
- All Implemented Interfaces:
ActionListener,Serializable,Cloneable,EventListener,Action,Destroyable
- Direct Known Subclasses:
OsmLinkPaster.NoWarnOpenLocationAction
Open an URL input dialog and load data from the given URL.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static classNested classes/interfaces inherited from class org.openstreetmap.josm.actions.JosmAction
JosmAction.ActiveLayerChangeAdapter, JosmAction.LayerChangeAdapter, JosmAction.SelectionChangeAdapter -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final BooleanPropertytrue to zoom to entire newly downloaded data, false otherwiseprotected final List<Class<? extends DownloadTask>>the list of download tasksprivate static final BooleanPropertytrue if the URL needs to be opened in a new layer, false otherwiseFields inherited from class org.openstreetmap.josm.actions.JosmAction
scFields inherited from class javax.swing.AbstractAction
changeSupport, enabledFields inherited from interface javax.swing.Action
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 Summary
ConstructorsModifierConstructorDescriptionCreate an open action.protectedOpenLocationAction(Shortcut shortcut) Create an open action. -
Method Summary
Modifier and TypeMethodDescriptionvoidfinal booleanaddDownloadTaskClass(Class<? extends DownloadTask> taskClass) Adds a new download task to the supported ones.(package private) Collection<DownloadTask>Asks the user which of the possible tasks to perform.private static DownloadParamsconfirmNoNewLayer(DownloadParams originalParams, String url) findDownloadTasks(String url, boolean isRemotecontrol) Replies the list of download tasks accepting the given url.Summarizes acceptable urls for error message purposes.Open the given URL.Open the given URL.Open the given URL.openUrl(DownloadParams settings, boolean zoomToData, String url) Open the given URL.openUrl(DownloadParams settings, String url) Open the given URL.protected voidremindUploadAddressHistory(HistoryComboBox cbHistory) Remind the current history in the preferencesprotected voidrestoreUploadAddressHistory(HistoryComboBox cbHistory) Restore the current history from the preferencesprotected voidDisplays an error message dialog that no suitable tasks have been found for the given url.Methods inherited from class org.openstreetmap.josm.actions.JosmAction
buildActiveLayerChangeAdapter, buildLayerChangeAdapter, checkAndConfirmOutlyingOperation, destroy, getLayerManager, getShortcut, initEnabledState, installAdapters, listenToLayerChange, listenToSelectionChange, setHelpId, setToolbarId, setTooltip, updateEnabledState, updateEnabledState, updateEnabledStateOnCurrentSelection, updateEnabledStateOnCurrentSelection, updateEnabledStateOnModifiableSelection, waitFutureMethods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
Field Details
-
USE_NEW_LAYER
true if the URL needs to be opened in a new layer, false otherwise -
DOWNLOAD_ZOOMTODATA
true to zoom to entire newly downloaded data, false otherwise -
downloadTasks
the list of download tasks
-
-
Constructor Details
-
OpenLocationAction
public OpenLocationAction()Create an open action. The name is "Open a file". -
OpenLocationAction
Create an open action. The name is "Open a file".- Parameters:
shortcut- action shortcut, can be null for subclasses
-
-
Method Details
-
restoreUploadAddressHistory
Restore the current history from the preferences- Parameters:
cbHistory- the history combo box
-
remindUploadAddressHistory
Remind the current history in the preferences- Parameters:
cbHistory- the history combo box
-
actionPerformed
-
findDownloadTasks
Replies the list of download tasks accepting the given url.- Parameters:
url- The URL to openisRemotecontrol- True if download request comes from remotecontrol.- Returns:
- The list of download tasks accepting the given url.
- Since:
- 5691
-
findSummaryDocumentation
Summarizes acceptable urls for error message purposes.- Returns:
- The HTML message to be displayed
- Since:
- 6031
-
openUrl
Open the given URL.- Parameters:
newLayer- true if the URL needs to be opened in a new layer, false otherwiseurl- The URL to open- Returns:
- the list of tasks that have been started successfully (can be empty).
- Since:
- 11986 (return type)
-
openUrl
Open the given URL.- Parameters:
settings- download settingsurl- The URL to open- Returns:
- the list of tasks that have been started successfully (can be empty).
- Since:
- 13927
-
openUrl
Open the given URL. This class checks theUSE_NEW_LAYERpreference to check if a new layer should be used.- Parameters:
url- The URL to open- Returns:
- the list of tasks that have been started successfully (can be empty).
- Since:
- 11986 (return type)
-
openUrl
Open the given URL.- Parameters:
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 open- Returns:
- the list of tasks that have been started successfully (can be empty).
- Since:
- 13261
-
openUrl
Open the given URL.- Parameters:
settings- download settingszoomToData- true to zoom to entire newly downloaded data, false otherwiseurl- The URL to open- Returns:
- the list of tasks that have been started successfully (can be empty).
- Since:
- 13927
-
confirmNoNewLayer
-
askWhichTasksToLoad
Asks the user which of the possible tasks to perform.- Parameters:
tasks- a list of possible tasks- Returns:
- the selected tasks from the user or an empty list if the dialog has been canceled
-
warnNoSuitableTasks
Displays an error message dialog that no suitable tasks have been found for the given url.- Parameters:
url- the given url
-
addDownloadTaskClass
Adds a new download task to the supported ones.- Parameters:
taskClass- The new download task to add- Returns:
true(as specified byCollection.add(E))
-