Class Index | File Index

Classes


Class orion.mirror.CodeMirrorStyler

A styler that uses CodeMirror modes to provide styles for a orion.editor.TextView.
Defined in: </jobs/genie.orion/orion-client-stable/workspace/bundles/org.eclipse.orion.client.editor/web/orion/editor/mirror.js>.

Class Summary
Constructor Attributes Constructor Name and Description
 
orion.mirror.CodeMirrorStyler(textView, codeMirror, annotationModel)
A CodeMirrorStyler applies one or more CodeMirror modes to provide styles for a orion.editor.TextView.
Method Summary
Method Attributes Method Name and Description
 
Deactivates this styler and removes its listeners.
 
setMode(modeSpec)
Sets the CodeMirror mode that this styler will use for styling the view.
Class Detail
orion.mirror.CodeMirrorStyler(textView, codeMirror, annotationModel)
A CodeMirrorStyler applies one or more CodeMirror modes to provide styles for a orion.editor.TextView. It uses modes that are registered with the orion.mirror.Mirror object passed to the CodeMirrorStyler constructor.

The process for using CodeMirrorStyler is as follows:

  1. Create a orion.mirror.Mirror.
  2. Load the modes you want to use and register them with the Mirror using orion.mirror.Mirror#defineMode.

    Note that the modes included with CodeMirror expect a global variable named "CodeMirror" to be available. If you intend to use these modes without modification, you must first expose your Mirror as a global variable. See the orion.mirror.Mirror documentation for details.

  3. Call #setMode to tell the styler what mode to use for highlighting the view.

    Note that the mode may refer to other modes to process nested language text. In such cases, you should ensure that all dependent modes have been registered with the Mirror before calling #setMode.

Parameters:
{orion.editor.TextView} textView
The TextView to provide style for.
{orion.mirror.Mirror} codeMirror
The Mirror object to load modes from.
{orion.editor.AnnotationModel} annotationModel Optional
Method Detail
destroy()
Deactivates this styler and removes its listeners.

setMode(modeSpec)
Sets the CodeMirror mode that this styler will use for styling the view.
Parameters:
{String} modeSpec
Name of the mode to use (eg. "css"), or a MIME type defined by the mode (eg. "text/css").

Documentation generated by JsDoc Toolkit 2.4.0 on Wed Jan 18 2017 12:15:12 GMT-0500 (EST)