Class Index | File Index

## Classes

- _global_
- Boolean
- Date
- exports.GitCommitExplorer-GitCommitExplorer
- exports.GitRepositoryExplorer-GitRepositoryExplorer
- exports.GitStatusExplorer-GitStatusExplorer
- Function
- Object
- orion.breadcrumbs.BreadCrumbs
- orion.cm.Configuration
- orion.cm.ConfigurationAdmin
- orion.cm.ConfigurationProperties
- orion.cm.ManagedService
- orion.commands.Command
- orion.commands.CommandKeyBinding
- orion.commands.CommandParameter
- orion.commands.CommandService
- orion.commands.ParametersDescription
- orion.commands.URLBinding
- orion.commonHTMLFragments
- orion.compare.DiffProvider
- orion.compare.rulers.CompareRuler
- orion.compare.rulers.LineNumberCompareRuler
- orion.compareUtils
- orion.console.Console
- orion.contentAssist.CssContentAssistProvider
- orion.contentAssist.HTMLContentAssistProvider
- orion.core.ContentType
- orion.core.ContentTypeService
- orion.dialogs.DialogService
- orion.DiffTreeNavigator.DiffTreeNavigator
- orion.DiffTreeNavigator.inlineDiffBlockFeeder
- orion.DiffTreeNavigator.TwoWayDiffBlockFeeder
- orion.edit.Dispatcher
- orion.editor.ContentAssist
- orion.editor.ContentAssistMode
- orion.editor.ContentAssistProvider
- orion.editor.ContentAssistProvider.Context
- orion.editor.ContentAssistWidget
- orion.editor.Editor
- orion.editor.JavaScriptContentAssistProvider
- orion.editor.regex
- orion.editor.StyleReadyEvent
- orion.editor.StyleReadyEvent#LineStyle
- orion.editor.TextMateStyler
- orion.explorer-table.FileExplorer
- orion.explorer.Explorer
- orion.explorer.ExplorerFlatModel
- orion.explorer.ExplorerModel
- orion.explorer.SelectionRenderer
- orion.ExplorerNavHandler.ExplorerNavDict
- orion.ExplorerNavHandler.ExplorerNavHandler
- orion.extensionCommands
- orion.favorites.FavoritesService
- orion.fileClient.FileClient
- orion.fileCommands
- orion.git.GitCommitNavigator
- orion.git.GitService
- orion.git.widgets.OpenCommitDialog
- orion.globalCommands
- orion.highlight.SyntaxHighlighter
- orion.links.TextLinkService
- orion.log.LogService
- orion.metatype.MetaTypeRegistry
- orion.metatype.ObjectClass
- orion.metatype.PropertyType
- orion.mirror.CodeMirrorStyler
- orion.mirror.Mirror
- orion.mirror.MirrorLineStyle
- orion.mirror.ModeApplier
- orion.navoutliner.NavigationOutliner
- orion.outliner.Outliner
- orion.outliner.OutlineService
- orion.parameterCollectors.CommandParameterCollector
- orion.pluginregistry.Plugin
- orion.pluginregistry.PluginRegistry
- orion.preferences.Preferences
- orion.preferences.PreferencesService
- orion.problems.ProblemService
- orion.profile.usersClient.UsersClient
- orion.progress.ProgressService
- orion.searchClient.Searcher
- orion.searches.SavedSearches
- orion.Searches.SearchList
- orion.searchResults.SearchResultsGenerator
- orion.searchUtils
- orion.selection.Selection
- orion.serviceregistry.EventTarget
- orion.serviceregistry.Service
- orion.serviceregistry.ServiceReference
- orion.serviceregistry.ServiceRegistration
- orion.serviceregistry.ServiceRegistry
- orion.ServiceTracker
- orion.sites.SiteClient
- orion.sites.SiteConfiguration
- orion.sites.SiteService
- orion.sites.SiteServicesExplorer
- orion.sites.ViewOnSiteTree
- orion.status.StatusReportingService
- orion.tasks.TaskList
- orion.textview.ActionDescription
- orion.textview.Annotation
- orion.textview.AnnotationIterator
- orion.textview.AnnotationModel
- orion.textview.AnnotationRuler
- orion.textview.AnnotationStyler
- orion.textview.AnnotationType
- orion.textview.AnnotationTypeList
- orion.textview.BlurEvent
- orion.textview.ContextMenuEvent
- orion.textview.DestroyEvent
- orion.textview.EventTarget
- orion.textview.FindIterator
- orion.textview.FindOptions
- orion.textview.FocusEvent
- orion.textview.FoldingAnnotation
- orion.textview.KeyBinding
- orion.textview.LineNumberRuler
- orion.textview.LineStyleEvent
- orion.textview.ModelChangedEvent
- orion.textview.ModelChangingEvent
- orion.textview.ModifyEvent
- orion.textview.OverviewRuler
- orion.textview.Projection
- orion.textview.ProjectionTextModel
- orion.textview.Ruler
- orion.textview.ScrollEvent
- orion.textview.Selection
- orion.textview.SelectionEvent
- orion.textview.Style
- orion.textview.StyleRange
- orion.textview.TextModel
- orion.textview.TextView
- orion.textview.TextViewOptions
- orion.textview.UndoStack
- orion.textview.VerifyEvent
- orion.TreeModelIterator.TreeModelIterator
- orion.treetable.TableTree
- orion.util
- orion.widgets.DirectoryTreeModel
- orion.widgets.OpenResourceDialog
- orion.widgets.SiteEditor
- orion.xhr
- orion.xhr.Result
- String

# Class orion.mirror.ModeApplier

Driver for CodeMirror modes.
Defined in: </shared/eclipse/e4/orion/I201206221139/plugins/org.eclipse.orion.client.editor/web/orion/editor/mirror.js>.

Class Summary
Constructor Attributes | Constructor Name and Description
--- | ---
| orion.mirror.ModeApplier(model, mirror, options) A `ModeApplier` listens to text changes on a orion.textview.TextModel and drives a CodeMirror mode to calculate highlighting in response to the change.

Method Summary
Method Attributes | Method Name and Description
--- | ---
| addEventListener(type, listener, useCapture) Adds an event listener to this event target.
| destroy() Deactivates this ModeApplier and removes its listeners.
| dispatchEvent(evt) Dispatches the given event to the listeners added to this event target.
| getLineStyle(lineIndex)
| getLineStyles()
| getState(lineIndex) Returns the state we can use for parsing from the start of the `lineIndex`th line.
| highlight(startLine, endLine, partial) Highlights the given range of lines.
| highlightLater(startLine) Schedules a job that will begin highlighting from `startLine`.
| highlightLine(lineIndex, line, state) Highlights a single line.
| onHighlightDone() Called when some highlighting has been performed.
| removeEventListener(type, listener, useCapture) Removes an event listener from the event target.
| setMode(modeSpec, highlightImmediately) Sets the CodeMirror mode to be used for highlighting.
| toStyleRangesAndErrors(style, lineIndex) Converts a `MirrorLineStyle` to a orion.textview.StyleRange[].

Event Summary
Event Attributes | Event Name and Description
--- | ---
| HighlightEvent(start, end) Dispatched when the ModeApplier has updated the highlight info for a region of the file.

Class Detail
orion.mirror.ModeApplier(model, mirror, options)
A `ModeApplier` listens to text changes on a orion.textview.TextModel and drives a CodeMirror mode to calculate highlighting in response to the change. Clients can use the highlighting information to style a orion.textview.TextView.

After a change is made to the orion.textview.TextModel, ModeApplier immediately updates the highlighting information for a small portion of the file around where the change occurred. Successive portions of the file are updated by short jobs that run periodically to avoid slowing down the rest of the application.

A #event:HighlightEvent event is dispatched every time the ModeApplier updates highlighting information for a portion of the file. The event contains information about which lines were highlighted. The style for any highlighted line can be obtained by calling #getLineStyle.

Parameters:
{orion.textview.TextModel} model
  The text model to listen to.
{orion.mirror.Mirror} mirror
  The orion.mirror.Mirror to use for loading modes.
{Object} options Optional

Method Detail
addEventListener(type, listener, useCapture)
Adds an event listener to this event target.
Defined in: </shared/eclipse/e4/orion/I201206221139/plugins/org.eclipse.orion.client.editor/web/orion/textview/eventTarget.js>.

Parameters:
{String} type
  The event type.
{Function|EventListener} listener
  The function or the EventListener that will be executed when the event happens.
{Boolean} useCapture Optional, Default: false
  `true` if the listener should be trigged in the capture phase.

See:
  #removeEventListener

destroy()
Deactivates this ModeApplier and removes its listeners.

dispatchEvent(evt)
Dispatches the given event to the listeners added to this event target.
Defined in: </shared/eclipse/e4/orion/I201206221139/plugins/org.eclipse.orion.client.editor/web/orion/textview/eventTarget.js>.

Parameters:
{Event} evt
  The event to dispatch.

{orion.mirror.MirrorLineStyle} getLineStyle(lineIndex)

Parameters:
{Number} lineIndex

Returns:
  {orion.mirror.MirrorLineStyle}

{orion.mirror.MirrorLineStyle[]} getLineStyles()

Returns:
  {orion.mirror.MirrorLineStyle[]}

{Object} getState(lineIndex)
Returns the state we can use for parsing from the start of the `lineIndex`th line.

Parameters:
{Number} lineIndex

Returns:
  {Object} The state. This object is safe to mutate.

highlight(startLine, endLine, partial)
Highlights the given range of lines.

Parameters:
{Number} startLine Optional
{Number} endLine Optional
{Boolean} partial Optional, Default: false
  If `true`, this function is assumed to be running as part of a larger operation, and will not dispatch a #event:HighlightEvent.

highlightLater(startLine)
Schedules a job that will begin highlighting from `startLine`. The job runs for a short amount of time, after which it dispatches a #event:HighlightEvent indicating its progress, and yields. Follow-up jobs are scheduled automatically if there's more highlighting to be done.

Parameters:
{Number} startLine

highlightLine(lineIndex, line, state)
Highlights a single line.

Parameters:
{Number} lineIndex
{Object} line
{Object} state
  The state to use for parsing from the start of the line.

onHighlightDone()
Called when some highlighting has been performed. Dispatches a #event:HighlightEvent.

removeEventListener(type, listener, useCapture)
Removes an event listener from the event target.

All the parameters must be the same ones used to add the listener.

Defined in: </shared/eclipse/e4/orion/I201206221139/plugins/org.eclipse.orion.client.editor/web/orion/textview/eventTarget.js>.

Parameters:
{String} type
  The event type
{Function|EventListener} listener
  The function or the EventListener that will be executed when the event happens.
{Boolean} useCapture Optional, Default: false
  `true` if the listener should be trigged in the capture phase.

See:
  #addEventListener

setMode(modeSpec, highlightImmediately)
Sets the CodeMirror mode to be used for highlighting. The mode must be registered with the orion.mirror.Mirror that this `ModeApplier` was created with. (The methods orion.mirror.Mirror#defineMode and orion.mirror.Mirror#defineMIME can be used to register a mode with a Mirror.)

Parameters:
{String} modeSpec
  Mode name or MIME type.
{Boolean} highlightImmediately Optional, Default: false

{orion.textview.StyleRange[][]} toStyleRangesAndErrors(style, lineIndex)
Converts a `MirrorLineStyle` to a orion.textview.StyleRange[].

Parameters:
{orion.mirror.MirrorLineStyle} style
  The line style to convert.
{Number} lineIndex Optional
  The line index of the line having the given style. If omitted, the returned orion.textview.StyleRange[] objects will have offsets relative to the line, not the document.

Returns:
  {orion.textview.StyleRange[][]} An array of 2 elements. The first element is an orion.textview.StyleRange[] giving the styles for the line.

  The second element is an orion.textview.StyleRange[] containing only those elements of the first array that represent syntax errors. (By CodeMirror convention, anything assigned the `"cm-error"` tag is assumed to be an error).

Event Detail
HighlightEvent(start, end)
Dispatched when the ModeApplier has updated the highlight info for a region of the file.

Parameters:
{Number} start
  The starting line index of the highlighted region.
{Number} end
  The ending line index of the highlighted region.

Documentation generated by JsDoc Toolkit 2.4.0 on Fri Jun 22 2012 11:43:39 GMT-0400 (EDT)