# Class: XMLEditorApp

## XMLEditorApp()

A sample XML editor application which leverages XMLEditor.

Also implements a number of interactive actions (static methods) like `newDocument`, `closeDocument`, etc, which may be used independently from `XMLEditorApp`.

## Constructor

#### new XMLEditorApp()

Constructs a sample XML editor application, the implementation of custom HTML element `<xxe-app>`.

Source:
  - app/XMLEditorApp.js, line 12

### Classes

XMLEditorApp

### Members

#### autoRecover :boolean

A cover for XMLEditor#autoRecover.

##### Type:

- boolean

Source:
  - app/XMLEditorApp.js, line 291

#### autoSave :string

Get/set the `autoSave` property of this XML editor application.

Default: none; files are not automatically saved.

The value of this property is a string which has the following syntax:

    value -> mode [ S interval ]? [ S enabled ]?
    mode -> local|remote|both
    interval -> strictly_positive_number s|m|h
    enabled -> on|off

Examples: `"remote"`, `"both 2m"`, `"remote 30s on"`, `"both off"`.

Autosave modes are:

- local: automatically save local files (when this is technically possible, i.e. on Chrome, not on Firefox).
- remote: automatically save remote files.
- both: automatically save both local and remote files.

Autosave interval units are:

- s: seconds.
- m: minutes.
- h: hours.

Default interval is `"30s"`. Minimal interval is `"10s"`.

The default value of enabled is `"on"`. This flag specifies whether the autosave feature is initially enabled. User may change this setting at anytime using the UI.

##### Type:

- string

Source:
  - app/XMLEditorApp.js, line 504

#### button2PastesText :boolean

A cover for XMLEditor#button2PastesText.

##### Type:

- boolean

Source:
  - app/XMLEditorApp.js, line 372

#### checkLeaveApp :boolean

Get/set the `checkLeaveApp` property of this XML editor application.

Default: `true`. If `true` and the document being edited has unsaved changes then ask users to confirm if they really want to leave the page and loose their changes.

##### Type:

- boolean

Source:
  - app/XMLEditorApp.js, line 319

#### clientProperties :string

A cover for XMLEditor#clientProperties.

##### Type:

- string

Source:
  - app/XMLEditorApp.js, line 267

#### documentStorage :string

Get/set the `documentStorage` property of this XML editor application.

The values of the `documentStorage` property are:

"local"
  Default value. Create and edit only local files, that is, files which are found on the computer running the web browser hosting this XML editor application.
"remote"
  Create and edit only remote files, that is, files which are accessed on the server side by `xxeserver`.
"both"
  Local files and remote files are both supported.

##### Type:

- string

Source:
  - app/XMLEditorApp.js, line 184

#### serverURL :string

A cover for XMLEditor#serverURL.

##### Type:

- string

Source:
  - app/XMLEditorApp.js, line 241

#### xmlEditor :XMLEditor

Get the XMLEditor used by this application.

##### Type:

- XMLEditor

Source:
  - app/XMLEditorApp.js, line 1141

### Methods

#### (static) closeDocument(xmlEditor)

Close the document being edited in specified XML editor.

If this document has unsaved changes, the user will have to confirm whether she/he really wants to discard these changes.

This static method in invoked by button Close but may be used independently from `XMLEditorApp`.

##### Parameters:

Name | Type | Description
--- | --- | ---
`xmlEditor` | XMLEditor | the XML editor.

Source:
  - app/XMLEditorApp.js, line 1481

#### (static) newDocument(xmlEditor)

Open a newly created local document in specified XML editor.

This static method in invoked by New|New Local Document but may be used independently from `XMLEditorApp`.

##### Parameters:

Name | Type | Description
--- | --- | ---
`xmlEditor` | XMLEditor | the XML editor.

Source:
  - app/XMLEditorApp.js, line 1161

#### (static) newRemoteFile(xmlEditor)

Open a newly created remote document in specified XML editor.

This static method in invoked by New|New Remote Document but may be used independently from `XMLEditorApp`.

##### Parameters:

Name | Type | Description
--- | --- | ---
`xmlEditor` | XMLEditor | the XML editor.

Source:
  - app/XMLEditorApp.js, line 1173

#### (static) openDocument(xmlEditor)

Open an existing local document in specified XML editor.

This static method in invoked by Open|Open Local Document but may be used independently from `XMLEditorApp`.

##### Parameters:

Name | Type | Description
--- | --- | ---
`xmlEditor` | XMLEditor | the XML editor.

Source:
  - app/XMLEditorApp.js, line 1240

#### (static) openRemoteFile(xmlEditor)

Open an existing remote document in specified XML editor.

This static method in invoked by Open|Open Remote Document but may be used independently from `XMLEditorApp`.

##### Parameters:

Name | Type | Description
--- | --- | ---
`xmlEditor` | XMLEditor | the XML editor.

Source:
  - app/XMLEditorApp.js, line 1252

#### (static) saveDocument(xmlEditor)

Save the document being edited in specified XML editor.

This static method in invoked by button Save but may be used independently from `XMLEditorApp`.

##### Parameters:

Name | Type | Description
--- | --- | ---
`xmlEditor` | XMLEditor | the XML editor.

Source:
  - app/XMLEditorApp.js, line 1341

#### (static) saveDocumentAs(xmlEditor)

Save the document being edited in specified XML editor to a different location, the user being prompted to specify this location.

This static method in invoked by button Save As but may be used independently from `XMLEditorApp`.

##### Parameters:

Name | Type | Description
--- | --- | ---
`xmlEditor` | XMLEditor | the XML editor.

Source:
  - app/XMLEditorApp.js, line 1421