Class orion.mirror.Mirror
A shim for CodeMirror's CodeMirror
API.
Defined in: </jobs/genie.orion/orion-client-stable/workspace/bundles/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)
|
|
startState(mode, basecolumn)
Alias for mode.startState().
|
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>
- See:
- <a href="http://codemirror.net/manual.html">http://codemirror.net/manual.html
Method Detail
{Object}
copyState(mode, state)
- Returns:
- {Object} A copy of
state
.
- See:
- <a href="http://codemirror.net/doc/manual.html#modeapi">http://codemirror.net/doc/manual.html#modeapi
defineMIME(mime, modeSpec)
- See:
- <a href="http://codemirror.net/manual.html#option_mode">http://codemirror.net/manual.html#option_mode
defineMode(name, modeFactory)
- See:
- <a href="http://codemirror.net/doc/manual.html#modeapi">http://codemirror.net/doc/manual.html#modeapi
{Object}
getMode(modeSpec, modeSpec)
- Returns:
- {Object}
- See:
- <a href="http://codemirror.net/manual.html#option_mode">http://codemirror.net/manual.html#option_mode
{Object}
getOption(option)
- Parameters:
- option
- Returns:
- {Object}
- See:
- <a href="http://codemirror.net/doc/manual.html#getOption">http://codemirror.net/doc/manual.html#getOption
{String[]}
listMIMEs()
- Returns:
- {String[]} The MIMEs.
- See:
- <a href="http://codemirror.net/doc/manual.html#option_mode">http://codemirror.net/doc/manual.html#option_mode
{String[]}
listModes()
- Returns:
- {String[]} The mode names.
- See:
- <a href="http://codemirror.net/doc/manual.html#option_mode">http://codemirror.net/doc/manual.html#option_mode
setOption(option, value)
- See:
- <a href="http://codemirror.net/doc/manual.html#getOption">http://codemirror.net/doc/manual.html#getOption
{Object}
startState(mode, basecolumn)
Alias for mode.startState().
- Parameters:
- {Object} mode
- {Number?} basecolumn
- Returns:
- {Object} The start state returned by
mode
.