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:
ActionListener
,Serializable
,Cloneable
,EventListener
,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
-
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
-
Fields 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
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(ActionEvent e)
static Future<?>
openFiles(List<File> fileList)
Open a list of files.static Future<?>
openFiles(List<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(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 Future<?> openFiles(List<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)
-
-