Package org.openstreetmap.josm.actions
Class OpenFileAction
- java.lang.Object
-
- javax.swing.AbstractAction
-
- org.openstreetmap.josm.actions.JosmAction
-
- org.openstreetmap.josm.actions.DiskAccessAction
-
- org.openstreetmap.josm.actions.OpenFileAction
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.io.Serializable
,java.lang.Cloneable
,java.util.EventListener
,javax.swing.Action
,Destroyable
public class OpenFileAction extends DiskAccessAction
Open a file chooser dialog and select a file to import.- Since:
- 1146
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
OpenFileAction.OpenFileTask
Task to open files.-
Nested classes/interfaces inherited from class org.openstreetmap.josm.actions.JosmAction
JosmAction.ActiveLayerChangeAdapter, JosmAction.LayerChangeAdapter, JosmAction.SelectionChangeAdapter
-
-
Field Summary
Fields Modifier and Type Field Description static ExtensionFileFilter
URL_FILE_FILTER
TheExtensionFileFilter
matching .url files-
Fields inherited from class org.openstreetmap.josm.actions.JosmAction
sc
-
-
Constructor Summary
Constructors Constructor Description OpenFileAction()
Create an open action.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
actionPerformed(java.awt.event.ActionEvent e)
static java.util.concurrent.Future<?>
openFiles(java.util.List<java.io.File> fileList)
Open a list of files.static java.util.concurrent.Future<?>
openFiles(java.util.List<java.io.File> fileList, Options... options)
Open a list of files.protected void
updateEnabledState()
Override in subclasses to update the enabled state of the action when something in the JOSM state changes, i.e.-
Methods inherited from class org.openstreetmap.josm.actions.DiskAccessAction
createAndOpenFileChooser, createAndOpenFileChooser, createAndOpenFileChooser, createAndOpenFileChooser, createAndOpenFileChooser, showSavedNotification, showSavingNotification
-
Methods inherited from class org.openstreetmap.josm.actions.JosmAction
buildActiveLayerChangeAdapter, buildLayerChangeAdapter, checkAndConfirmOutlyingOperation, destroy, getLayerManager, getShortcut, initEnabledState, installAdapters, listenToLayerChange, listenToSelectionChange, setHelpId, setToolbarId, setTooltip, updateEnabledState, updateEnabledStateOnCurrentSelection, updateEnabledStateOnCurrentSelection, updateEnabledStateOnModifiableSelection, waitFuture
-
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
-
-
-
Field Detail
-
URL_FILE_FILTER
public static final ExtensionFileFilter URL_FILE_FILTER
TheExtensionFileFilter
matching .url files
-
-
Constructor Detail
-
OpenFileAction
public OpenFileAction()
Create an open action. The name is "Open a file".
-
-
Method Detail
-
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent e)
-
updateEnabledState
protected void updateEnabledState()
Description copied from class:JosmAction
Override in subclasses to update the enabled state of the action when something in the JOSM state changes, i.e. when a layer is removed or added. SeeJosmAction.updateEnabledState(Collection)
to respond to changes in the collection of selected primitives. Default behavior is empty.- Overrides:
updateEnabledState
in classJosmAction
- See Also:
JosmAction.updateEnabledState(Collection)
,JosmAction.initEnabledState()
,JosmAction.listenToLayerChange()
-
openFiles
public static java.util.concurrent.Future<?> openFiles(java.util.List<java.io.File> fileList)
Open a list of files. The complete list will be passed to batch importers. Filenames will not be saved in history.- Parameters:
fileList
- A list of files- Returns:
- the future task
- Since:
- 11986 (return task)
-
openFiles
public static java.util.concurrent.Future<?> openFiles(java.util.List<java.io.File> fileList, Options... options)
Open a list of files. The complete list will be passed to batch importers.- Parameters:
fileList
- A list of filesoptions
- The options to use- Returns:
- the future task
- Since:
- 17534 (
Options
)
-
-