public class OpenAction extends LengthyAction implements OpenDocumentService
App
.Modifier and Type | Field and Description |
---|---|
protected URL |
inURL
The URL of the document to be opened.
|
protected boolean |
readOnly
true if the document is to be opened in read-only mode;
true if the document is to be opened in (normal)
read-write mode. |
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 |
---|
OpenAction() |
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(ActionEvent e)
Simply invokes
AppAction.doIt() . |
static void |
autoShowValidityPane(App app,
Diagnostic[] diagnostics)
Ensure that
CheckValidityPane is visible depending on the
severity of specified diagnostics and on the value of user preference
autoShowValidityPane . |
protected boolean |
canRevertToSaved(OpenedDocument openedDoc) |
protected CommandResult |
doExec(URL openURL,
boolean notEditable,
Object settings) |
protected void |
exec()
Second step of
LengthyAction.doIt() . |
protected boolean |
init()
First step of
LengthyAction.doIt() . |
boolean |
openDocument(URL url,
boolean readOnly,
Object settings)
Opens specified document in the XML editor.
|
void |
updateEnabled()
This action should enable or disable itself using standard method
setEnabled(boolean).
|
doIt, finish
activeEditorChanged, applyPreferences, destroyApp, editingContextChanged, flushPreferences, getAccelerator, getApp, getDialogTitle, getIcon, getId, getLabel, getMnemonic, getMnemonicIndex, getModifiersToolTip, getSelectedIcon, getToolTip, getUnselectedIcon, hasListeners, initApp, isEditingContextSensitive, isSelected, namespacePrefixesChanged, saveStateChanged, 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 boolean readOnly
true
if the document is to be opened in read-only mode;
true
if the document is to be opened in (normal)
read-write mode.
This field is set in init()
.public void actionPerformed(ActionEvent e)
AppAction
Simply invokes AppAction.doIt()
.
actionPerformed
in interface ActionListener
actionPerformed
in class AppAction
protected boolean init()
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).
This implementation displays a file chooser dialog box and
then sets inURL
and readOnly
to reflect
the user choice.
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(URL openURL, boolean notEditable, Object settings)
public static void autoShowValidityPane(App app, Diagnostic[] diagnostics)
CheckValidityPane
is visible depending on the
severity of specified diagnostics and on the value of user preference
autoShowValidityPane
.protected boolean canRevertToSaved(OpenedDocument openedDoc)
public void updateEnabled()
AppAction
This method is invoked:
updateEnabled
in class AppAction
AppAction.activeEditorChanged()
,
AppAction.editingContextChanged()
public boolean openDocument(URL url, boolean readOnly, Object settings)
OpenDocumentService
openDocument
in interface OpenDocumentService
url
- URL of document to be openedreadOnly
- if true
, the document is to be opened in
read-only modesettings
- implementation-specific information about the
way specified document is to be opened. May be null
which means: use defaults.true
if document has been successfully opened;
false
otherwise (e.g. specified location cannot be opened)