Class Index | File Index

Classes


Class orion.editor.AsyncStyler

Provides asynchronous styling for a TextView using registered "highlighter" services.
Defined in: </jobs/genie.orion/orion-client-stable/workspace/bundles/org.eclipse.orion.client.editor/web/orion/editor/AsyncStyler.js>.

Class Summary
Constructor Attributes Constructor Name and Description
 
orion.editor.AsyncStyler(textView, serviceRegistry, annotationModel)
Creates an AsyncStyler.
Method Summary
Method Attributes Method Name and Description
 
Deactivates this styler and removes any listeners it registered.
 
setContentType(contentTypeId)
Sets the content type ID for which style information will be provided.
Class Detail
orion.editor.AsyncStyler(textView, serviceRegistry, annotationModel)
Creates an AsyncStyler. An AsyncStyler allows style information to be sent to a TextView asynchronously through the service segistry. Style is generated by style providers, which are services having the 'orion.edit.highlighter' service name and a type === 'highlighter' service property.

A style provider monitors changes to the TextView (typically using an orion.edit.model service) and dispatches a service event of type 'orion.edit.highlighter.styleReady' when it has style information to send. The event carries a payload of style information for one or more lines in the TextView. The AsyncStyler then applies the style information fron the event to the TextView using the orion.editor.TextView#event:onLineStyle API.

Applying style information may cause the TextView to be redrawn, which is potentially expensive. To minimize the number of redraws, a provider should provide style for many lines in a single StyleReadyEvent.

Parameters:
{orion.editor.TextView} textView
The TextView to style.
{orion.serviceregistry.ServiceRegistry} serviceRegistry
The ServiceRegistry to monitor for highlighter services.
{orion.editor.AnnotationModel} annotationModel Optional
The Annotation Model to use for creating error and warning annotations.
See:
orion.editor.StyleReadyEvent
Method Detail
destroy()
Deactivates this styler and removes any listeners it registered.

setContentType(contentTypeId)
Sets the content type ID for which style information will be provided. The ID will be passed to all style provider services monitored by this AsyncStyler by calling the provider's own setContentType(contentTypeId) method.

In this way, a single provider service can be registered for several content types, and select different logic for each type.

Parameters:
{String} contentTypeId
The Content Type ID describing the kind of file currently being edited in the TextView.
See:
orion.core.ContentType

Documentation generated by JsDoc Toolkit 2.4.0 on Tue Apr 04 2017 10:51:56 GMT-0400 (EDT)