Class orion.mirror.Mirror
A shim for CodeMirror's CodeMirror
API.
Defined in: </shared/eclipse/e4/orion/I201306251555/plugins/org.eclipse.orion.client.editor/web/orion/editor/mirror.js>.
Constructor Attributes | Constructor Name and Description |
---|---|
A Mirror is a partial implementation of the API provided by the
CodeMirror object. |
Method Attributes | Method Name and Description |
---|---|
copyState(mode, state)
|
|
defineMIME(mime, modeSpec)
|
|
defineMode(name, modeFactory)
|
|
getMode(modeSpec, modeSpec)
|
|
getOption(option)
|
|
setOption(option, value)
|
Class Detail
orion.mirror.Mirror()
A Mirror is a partial implementation of the API provided by the
CodeMirror
object. Mirror provides functionality related to mode and MIME management.
If clients intend to reuse modes provided by CodeMirror without modification, they must expose a Mirror as
a property named "CodeMirror"
of the global object so that modes may access it to register themselves,
and to load other modes. For example:
<script>
window.CodeMirror = new Mirror();
// Now you can load the CodeMirror mode scripts.
</script>
Method Detail
{Object}
copyState(mode, state)
- Returns:
- {Object} A copy of
state
.
defineMIME(mime, modeSpec)
defineMode(name, modeFactory)
- Parameters:
- {String} name
- {Function(options|config)} modeFactory
{Object}
getMode(modeSpec, modeSpec)
- Returns:
- {Object}
{Object}
getOption(option)
- Parameters:
- option
- Returns:
- {Object}
{String[]}
listMIMEs()
- Returns:
- {String[]} The MIMEs.
{String[]}
listModes()
- Returns:
- {String[]} The mode names.
setOption(option, value)