Package org.openstreetmap.josm.actions
Class SaveAction
- java.lang.Object
-
- javax.swing.AbstractAction
-
- org.openstreetmap.josm.actions.JosmAction
-
- org.openstreetmap.josm.actions.DiskAccessAction
-
- org.openstreetmap.josm.actions.SaveActionBase
-
- org.openstreetmap.josm.actions.SaveAction
-
- All Implemented Interfaces:
ActionListener
,Serializable
,Cloneable
,EventListener
,Action
,Destroyable
public final class SaveAction extends SaveActionBase
Export the data as an OSM xml file.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
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 private static SaveAction
instance
private PropertyChangeListener
updateOnRequireSaveChange
-
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 Modifier Constructor Description private
SaveAction()
Construct the action with "Save" as label.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected JosmAction.LayerChangeAdapter
buildLayerChangeAdapter()
Override this if callingJosmAction.updateEnabledState()
on layer change events is not enough.File
getFile(Layer layer)
static SaveAction
getInstance()
Returns the unique instance.protected boolean
listenToSelectionChange()
Overwrite this ifJosmAction.updateEnabledState()
should be called when the selection changed.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.SaveActionBase
actionPerformed, addToFileOpenHistory, checkFileAndConfirmOverWrite, confirmOverwrite, createAndOpenSaveFileChooser, createAndOpenSaveFileChooser, doSave, doSave, doSave, doSave, doSave, showAndLogException
-
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, checkAndConfirmOutlyingOperation, destroy, getLayerManager, getShortcut, initEnabledState, installAdapters, listenToLayerChange, 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
-
instance
private static final SaveAction instance
-
updateOnRequireSaveChange
private final PropertyChangeListener updateOnRequireSaveChange
-
-
Constructor Detail
-
SaveAction
private SaveAction()
Construct the action with "Save" as label.
-
-
Method Detail
-
getInstance
public static SaveAction getInstance()
Returns the unique instance.- Returns:
- the unique instance
-
buildLayerChangeAdapter
protected JosmAction.LayerChangeAdapter buildLayerChangeAdapter()
Description copied from class:JosmAction
Override this if callingJosmAction.updateEnabledState()
on layer change events is not enough.- Overrides:
buildLayerChangeAdapter
in classJosmAction
- Returns:
- the
JosmAction.LayerChangeAdapter
that will be called on layer change events
-
listenToSelectionChange
protected boolean listenToSelectionChange()
Description copied from class:JosmAction
Overwrite this ifJosmAction.updateEnabledState()
should be called when the selection changed. Default is true.- Overrides:
listenToSelectionChange
in classSaveActionBase
- Returns:
true
if aDataSelectionListener
should be registered.
-
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 classSaveActionBase
- See Also:
JosmAction.updateEnabledState(Collection)
,JosmAction.initEnabledState()
,JosmAction.listenToLayerChange()
-
getFile
public File getFile(Layer layer)
- Specified by:
getFile
in classSaveActionBase
-
-