public class SaveAction extends LengthyAction implements SaveDocumentService
Modifier and Type | Field and Description |
---|---|
protected URL |
outURL |
app, id, MODIFIERS_TOOLTIP_KEY, NO_MNEMONIC, SELECTED_ICON_KEY, UNSELECTED_ICON_KEY
changeSupport, enabled
PART_ID
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 and Description |
---|
SaveAction() |
Modifier and Type | Method and Description |
---|---|
protected CommandResult |
doExec(OpenedDocument openedDoc,
URL saveURL) |
protected void |
exec()
Second step of
LengthyAction.doIt() . |
protected boolean |
init()
First step of
LengthyAction.doIt() . |
boolean |
saveDocument(OpenedDocument openedDoc,
URL saveURL)
Saves specified opened document.
|
void |
saveStateChanged()
Invoked after active document has been saved or, on the contrary, when
its has been modified and thus needs to be saved.
|
void |
updateEnabled()
This action should enable or disable itself using standard method
setEnabled(boolean).
|
doIt, finish
actionPerformed, activeEditorChanged, applyPreferences, destroyApp, editingContextChanged, flushPreferences, getAccelerator, getApp, getDialogTitle, getIcon, getId, getLabel, getMnemonic, getMnemonicIndex, getModifiersToolTip, getSelectedIcon, getToolTip, getUnselectedIcon, hasListeners, initApp, isEditingContextSensitive, isSelected, namespacePrefixesChanged, setAccelerator, setDisabledIcons, setIcon, setLabel, setMnemonic, setMnemonicIndex, setModifiersToolTip, setSelected, setSelectedIcon, setToolTip, setUnselectedIcon, undoStateChanged, validityStateChanged, wasCtrlClick, wasRightClick, wasShiftClick
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
protected URL outURL
protected boolean init()
LengthyAction
LengthyAction.doIt()
. Possibly an interactive one. It is
possible to prompt the user during this step and therefore, the user
can cancel the execution of the action (before it actually starts).init
in class LengthyAction
true
if execution should proceed;
false
if execution has been canceledprotected void exec()
LengthyAction
LengthyAction.doIt()
. Actual execution of the action. A busy
cursor is displayed during this step.exec
in class LengthyAction
protected CommandResult doExec(OpenedDocument openedDoc, URL saveURL)
public void updateEnabled()
AppAction
This method is invoked:
updateEnabled
in class AppAction
AppAction.activeEditorChanged()
,
AppAction.editingContextChanged()
public void saveStateChanged()
AppAction
Default implementation does nothing at all.
saveStateChanged
in interface AppPart
saveStateChanged
in class AppAction
App.getActiveOpenedDocument()
,
OpenedDocument.isSaveNeeded()
public boolean saveDocument(OpenedDocument openedDoc, URL saveURL)
SaveDocumentService
saveDocument
in interface SaveDocumentService
openedDoc
- document to be savedsaveURL
- if null
, the document is saved to its
current location; otherwise it is saved to specified location,
in which case this method behaves like File|Save As.true
if document has been successfully saved;
false
otherwise