org.openstreetmap.josm.actions
Class SaveActionBase
java.lang.Object
javax.swing.AbstractAction
org.openstreetmap.josm.actions.JosmAction
org.openstreetmap.josm.actions.DiskAccessAction
org.openstreetmap.josm.actions.SaveActionBase
- All Implemented Interfaces:
- java.awt.event.ActionListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.swing.Action, Destroyable
- Direct Known Subclasses:
- SaveAction, SaveAsAction
public abstract class SaveActionBase
- extends DiskAccessAction
- See Also:
- Serialized Form
Field Summary |
private java.io.File |
file
|
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 |
SaveActionBase(java.lang.String name,
java.lang.String iconName,
java.lang.String tooltip,
Shortcut shortcut)
|
Methods inherited from class javax.swing.AbstractAction |
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
file
private java.io.File file
SaveActionBase
public SaveActionBase(java.lang.String name,
java.lang.String iconName,
java.lang.String tooltip,
Shortcut shortcut)
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent e)
doSave
public boolean doSave()
doSave
public boolean doSave(Layer layer)
doSave
public static boolean doSave(Layer layer,
java.io.File file)
doInternalSave
private static boolean doInternalSave(Layer layer,
java.io.File file)
getFile
protected abstract java.io.File getFile(Layer layer)
updateEnabledState
protected void updateEnabledState()
- Refreshes the enabled state
- Overrides:
updateEnabledState
in class JosmAction
- See Also:
JosmAction.updateEnabledState(Collection)
,
JosmAction.initEnabledState()
createAndOpenSaveFileChooser
public static java.io.File createAndOpenSaveFileChooser(java.lang.String title,
ExtensionFileFilter filter)
- Creates a new "Save" dialog for a single
ExtensionFileFilter
and makes it visible.
When the user has chosen a file, checks the file extension, and confirms overwrite if needed.
- Parameters:
title
- The dialog titlefilter
- The dialog file filter
- Returns:
- The output
File
- Since:
- 5456
- See Also:
DiskAccessAction.createAndOpenFileChooser(boolean, boolean, String, FileFilter, int, String)
createAndOpenSaveFileChooser
public static java.io.File createAndOpenSaveFileChooser(java.lang.String title,
java.lang.String extension)
- Creates a new "Save" dialog for a given file extension and makes it visible.
When the user has chosen a file, checks the file extension, and confirms overwrite if needed.
- Parameters:
title
- The dialog titleextension
- The file extension
- Returns:
- The output
File
- See Also:
DiskAccessAction.createAndOpenFileChooser(boolean, boolean, String, String)
checkFileAndConfirmOverWrite
private static java.io.File checkFileAndConfirmOverWrite(javax.swing.JFileChooser fc,
java.lang.String extension)
confirmOverwrite
public static boolean confirmOverwrite(java.io.File file)
addToFileOpenHistory
protected void addToFileOpenHistory()
JOSM