96. XXE.open
Prev | Chapter 6. Commands written in the Java™ programming language | Next

## 96. XXE.open

Parameter syntax:

    [ '[readOnly]' ]?
    [
      '[reopen]' |
      '[reopenIfNewer]' |
      ('[checkIsOpened]' S file_name_or_URL) |
      file_name_or_URL
    ]?

Opens a document in XXE.

Without a parameter, this command displays the file chooser dialog box to let the user specify which document to open.

Parameters:

[readOnly]

  This parameter is a modifier which allows to open in read-only mode the document specified by the other parameters.

[reopen]

  Reopens document currently opened in XXE. Useful to implement a ``revert to saved'' command.

[reopenIfNewer]

  Reopens document currently opened in XXE, but only if it has been modified by an external application.

  If the document currently opened in XXE has not been modified by an external application, this command does nothing at all, succeeds and returns current `com.xmlmind.xmledit.doc.Document`.

  Note that this option works exactly like `[reopen]` if the document is stored on a HTTP or FTP server. That is, XXE will only check the dates of local files.

[checkIsOpened]

  The command cannot be executed unless specified document has been opened in XXE. If specified document is already opened in XXE, this command just returns it (a `com.xmlmind.xmledit.doc.Document` object) which may be useful to write higher-level commands.

`file_name_or_URL`

  Opens specified document.

Returns newly opened `com.xmlmind.xmledit.doc.Document` (for use by higher-level commands) or `Command.EXECUTION_FAILED` if specified document cannot be opened or if user has canceled the command.

See XXE.save for an example of use for this command.

Prev | Up | Next
95. XXE.new | Home | 97. XXE.save