Class Index | File Index

## Classes

- _global_
- Array
- Boolean
- Date
- Function
- javascript.ASTManager
- javascript.Indexer
- javascript.JavaScriptOccurrences
- javascript.JSOutliner
- javascript.Summary
- Object
- org.eclipse.orion.client.cf.CFService
- orion.breadcrumbs.BreadCrumbs
- orion.browse.FileBrowser
- orion.browse.FileBrowserOptions
- orion.BrowseView
- orion.cm.Configuration
- orion.cm.ConfigurationAdmin
- orion.cm.ConfigurationProperties
- orion.cm.ManagedService
- orion.commandregistry.CommandRegistry
- orion.commandregistry.ParameterCollector
- orion.commands.Command
- orion.commands.CommandInvocation
- orion.commands.CommandParameter
- orion.commands.ParametersDescription
- orion.commands.URLBinding
- orion.compare.CompareCommandFactory
- orion.compare.CompareSyntaxHighlighter
- orion.compare.CompareView
- orion.compare.CompareViewOptions
- orion.compare.DiffProvider
- orion.compare.FileOptions
- orion.compare.rulers.CompareRuler
- orion.compare.rulers.LineNumberCompareRuler
- orion.compare.toggleableCompareView
- orion.compare.TwoWayCompareView
- orion.compareUtils
- orion.core.ContentType
- orion.core.ContentTypeRegistry
- orion.core.TypeDef
- orion.core.TypeDefProperties
- orion.core.TypeDefRegistry
- orion.Deferred
- orion.dialogs.DialogService
- orion.DiffTreeNavigator.DiffTreeNavigator
- orion.DiffTreeNavigator.inlineDiffBlockFeeder
- orion.DiffTreeNavigator.TwoWayDiffBlockFeeder
- orion.edit.Dispatcher
- orion.edit.EditorContext
- orion.editor.ActionDescription
- orion.editor.Annotation
- orion.editor.AnnotationIterator
- orion.editor.AnnotationModel
- orion.editor.AnnotationRuler
- orion.editor.AnnotationStyler
- orion.editor.AnnotationType
- orion.editor.AnnotationTypeList
- orion.editor.AsyncStyler
- orion.editor.BaseEditor
- orion.editor.BlurEvent
- orion.editor.ContentAssist
- orion.editor.ContentAssistMode
- orion.editor.ContentAssistProvider
- orion.editor.ContentAssistProvider.Context
- orion.editor.ContentAssistProviderInfo
- orion.editor.ContentAssistWidget
- orion.editor.ContextMenuEvent
- orion.editor.CssContentAssistProvider
- orion.editor.DestroyEvent
- orion.editor.EditOptions
- orion.editor.Editor
- orion.editor.EventTarget
- orion.editor.FindIterator
- orion.editor.FindOptions
- orion.editor.FocusEvent
- orion.editor.FoldingAnnotation
- orion.editor.HTMLContentAssistProvider
- orion.editor.InputManager
- orion.editor.KeyEvent
- orion.editor.LineNumberRuler
- orion.editor.LineStyleEvent
- orion.editor.ModelChangedEvent
- orion.editor.ModelChangingEvent
- orion.editor.ModifyEvent
- orion.editor.OverviewRuler
- orion.editor.Projection
- orion.editor.ProjectionTextModel
- orion.editor.Ruler
- orion.editor.ScrollEvent
- orion.editor.Selection
- orion.editor.SelectionEvent
- orion.editor.Style
- orion.editor.StyleRange
- orion.editor.StyleReadyEvent
- orion.editor.StyleReadyEvent#LineStyle
- orion.editor.TextChange
- orion.editor.TextMateStyler
- orion.editor.TextModel
- orion.editor.TextTheme
- orion.editor.TextView
- orion.editor.TextViewOptions
- orion.editor.TextViewShowOptions
- orion.editor.ThemeChangedEvent
- orion.editor.ThemeStyleSheet
- orion.editor.UndoStack
- orion.editor.VerifyEvent
- orion.EditorView
- orion.EventTarget
- orion.explorer.Explorer
- orion.explorer.ExplorerFlatModel
- orion.explorer.ExplorerModel
- orion.explorer.FileExplorer
- orion.explorer.FileExplorer.ModelHandler
- orion.explorer.NavigatorRenderer
- orion.explorer.SelectionRenderer
- orion.explorerNavHandler.ExplorerNavDict
- orion.explorerNavHandler.ExplorerNavHandler
- orion.extensionCommands
- orion.fileClient.FileClient
- orion.fileCommands
- orion.fileUtils
- orion.FolderView
- orion.form
- orion.git.GitCommitExplorer
- orion.git.GitLogExplorer
- orion.git.GitRepositoryExplorer
- orion.git.GitReviewRequestExplorer
- orion.git.GitService
- orion.git.GitStatusExplorer
- orion.git.widgets.OpenCommitDialog
- orion.globalCommands
- orion.highlight.SyntaxHighlighter
- orion.KeyBinding
- orion.KeySequence
- orion.KeyStroke
- orion.links.TextLinkService
- orion.log.LogService
- orion.metatype.AttributeDefinition
- orion.metatype.MetaTypeRegistry
- orion.metatype.ObjectClassDefinition
- orion.mirror.CodeMirrorStyler
- orion.mirror.Mirror
- orion.mirror.MirrorLineStyle
- orion.mirror.ModeApplier
- orion.navoutliner.NavigationOutliner
- orion.objects
- orion.operation
- orion.outliner.Outliner
- orion.outliner.OutlineService
- orion.PageLinks
- orion.PageLinks.PageLinksInfo
- 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.projectClient.ProjectClient
- orion.Promise
- orion.ReadonlyEditorView
- orion.regex
- orion.search.AdvSearchOptRenderer
- orion.searchClient.Searcher
- orion.searches.SavedSearches
- orion.Searches.SearchBuilder
- orion.Searches.SearchList
- orion.searchResults.SearchResultsGenerator
- orion.searchUtils
- orion.searchUtils.SearchParams
- orion.selection.Selection
- orion.serviceregistry.ServiceEvent
- orion.serviceregistry.ServiceReference
- orion.serviceregistry.ServiceRegistration
- orion.serviceregistry.ServiceRegistry
- orion.ServiceTracker
- orion.settings.Setting
- orion.settings.SettingsRegistry
- orion.settings.ui.PropertyWidget
- orion.shell.Command
- orion.shell.Parameter
- orion.shell.ParameterType
- orion.shell.Shell
- orion.sidebar.MiniNavViewMode
- orion.sidebar.ProjectNavViewMode
- orion.sidebar.Sidebar
- orion.sidebar.ViewMode
- orion.sites.SiteClient
- orion.sites.SiteConfiguration
- orion.sites.SiteEditor
- orion.sites.SiteService
- orion.sites.ViewOnSiteTree
- orion.status.StatusReportingService
- orion.SyntaxChecker
- orion.tasks.TaskList
- orion.TreeModelIterator.TreeModelIterator
- orion.treetable.TableTree
- orion.uiUtils
- orion.URITemplate
- orion.webui.contextmenu.ContextMenu
- orion.webui.dialogs.ConfirmDialog
- orion.webui.dialogs.OpenResourceDialog
- orion.webui.dialogs.OperationsDialog
- orion.webui.dialogs.PromptDialog
- orion.webui.littlelib
- orion.webui.Splitter
- orion.widgets.browse.ResourceSelector
- orion.widgets.Filesystem.FilesystemSwitcher
- orion.widgets.Section
- orion.widgets.settings.SplitSelectionLayout
- orion.xhr
- orion.xhr.Result
- String

# Class orion.editor.TextModel

The TextModel is an interface that provides text for the view. Applications may implement the TextModel interface to provide a custom store for the view content. The view interacts with its text model in order to access and update the text that is being displayed and edited in the view. This is the default implementation.

See:
orion.editor.TextView
orion.editor.TextView#setModel

Defined in: </jobs/genie.eclipse.orion/orion-client/workspace/bundles/org.eclipse.orion.client.editor/web/orion/editor/textModel.js>.

Class Summary
Constructor Attributes | Constructor Name and Description
--- | ---
| orion.editor.TextModel(text, lineDelimiter) Constructs a new TextModel with the given text and default line delimiter.

Method Summary
Method Attributes | Method Name and Description
--- | ---
| addEventListener(type, listener, useCapture) Adds an event listener to this event target.
| destroy() Destroys this text model.
| dispatchEvent(evt) Dispatches the given event to the listeners added to this event target.
| find(options) Finds occurrences of a string in the text model.
| getCharCount() Returns the number of characters in the model.
| getLine(lineIndex, includeDelimiter) Returns the text of the line at the given index.
| getLineAtOffset(offset) Returns the line index at the given character offset.
| getLineCount() Returns the number of lines in the model.
| getLineDelimiter() Returns the line delimiter that is used by the view when inserting new lines.
| getLineEnd(lineIndex, includeDelimiter) Returns the end character offset for the given line.
| getLineStart(lineIndex) Returns the start character offset for the given line.
| getText(start, end) Returns the text for the given range.
| onChanged(modelChangedEvent) Notifies all listeners that the text has changed.
| onChanging(modelChangingEvent) Notifies all listeners that the text is about to change.
| removeEventListener(type, listener, useCapture) Removes an event listener from the event target.
| setLineDelimiter(lineDelimiter, all) Sets the line delimiter that is used by the view when new lines are inserted in the model due to key strokes and paste operations.
| setText(text, start, end) Replaces the text in the given range with the given text.

Class Detail
orion.editor.TextModel(text, lineDelimiter)
Constructs a new TextModel with the given text and default line delimiter.

Parameters:
{String} text Optional, Default: ""
  the text that the model will store
{String} lineDelimiter Optional, Default: platform delimiter
  the line delimiter used when inserting new lines to the model.

Method Detail
addEventListener(type, listener, useCapture)
Adds an event listener to this event target.
Defined in: </jobs/genie.eclipse.orion/orion-client/workspace/bundles/org.eclipse.orion.client.editor/web/orion/editor/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:
  orion.editor.EventTarget#removeEventListener

destroy()
Destroys this text model.

dispatchEvent(evt)
Dispatches the given event to the listeners added to this event target.
Defined in: </jobs/genie.eclipse.orion/orion-client/workspace/bundles/org.eclipse.orion.client.editor/web/orion/editor/eventTarget.js>.

Parameters:
{Event} evt
  The event to dispatch.

{orion.editor.FindIterator} find(options)
Finds occurrences of a string in the text model.

Parameters:
{orion.editor.FindOptions} options
  the search options

Returns:
  {orion.editor.FindIterator} the find occurrences iterator.

{Number} getCharCount()
Returns the number of characters in the model.

Returns:
  {Number} the number of characters in the model.

{String} getLine(lineIndex, includeDelimiter)
Returns the text of the line at the given index.

The valid indices are 0 to line count exclusive. Returns `null` if the index is out of range.

Parameters:
{Number} lineIndex
  the zero based index of the line.
{Boolean} includeDelimiter Optional, Default: false
  whether or not to include the line delimiter.

Returns:
  {String} the line text or `null` if out of range.

See:
  orion.editor.TextModel#getLineAtOffset

{Number} getLineAtOffset(offset)
Returns the line index at the given character offset.

The valid offsets are 0 to char count inclusive. The line index for char count is `line count - 1`. Returns `-1` if the offset is out of range.

Parameters:
{Number} offset
  a character offset.

Returns:
  {Number} the zero based line index or `-1` if out of range.

{Number} getLineCount()
Returns the number of lines in the model.

The model always has at least one line.

Returns:
  {Number} the number of lines.

{String} getLineDelimiter()
Returns the line delimiter that is used by the view when inserting new lines. New lines entered using key strokes and paste operations use this line delimiter.

Returns:
  {String} the line delimiter that is used by the view when inserting new lines.

{Number} getLineEnd(lineIndex, includeDelimiter)
Returns the end character offset for the given line.

The end offset is not inclusive. This means that when the line delimiter is included, the offset is either the start offset of the next line or char count. When the line delimiter is not included, the offset is the offset of the line delimiter.

The valid indices are 0 to line count exclusive. Returns `-1` if the index is out of range.

Parameters:
{Number} lineIndex
  the zero based index of the line.
{Boolean} includeDelimiter Optional, Default: false
  whether or not to include the line delimiter.

Returns:
  {Number} the line end offset or `-1` if out of range.

See:
  orion.editor.TextModel#getLineStart

{Number} getLineStart(lineIndex)
Returns the start character offset for the given line.

The valid indices are 0 to line count exclusive. Returns `-1` if the index is out of range.

Parameters:
{Number} lineIndex
  the zero based index of the line.

Returns:
  {Number} the line start offset or `-1` if out of range.

See:
  orion.editor.TextModel#getLineEnd

getText(start, end)
Returns the text for the given range.

The end offset is not inclusive. This means that character at the end offset is not included in the returned text.

Parameters:
{Number} start Optional, Default: 0
  the zero based start offset of text range.
{Number} end Optional, Default: char count
  the zero based end offset of text range.

See:
  orion.editor.TextModel#setText

onChanged(modelChangedEvent)
Notifies all listeners that the text has changed.

This notification is intended to be used only by the view. Application clients should use orion.editor.TextView#event:onModelChanged.

NOTE: This method is not meant to called directly by application code. It is called internally by the TextModel as part of the implementation of #setText. This method is included in the public API for documentation purposes and to allow integration with other toolkit frameworks.

Parameters:
{orion.editor.ModelChangedEvent} modelChangedEvent
  the changed event

onChanging(modelChangingEvent)
Notifies all listeners that the text is about to change.

This notification is intended to be used only by the view. Application clients should use orion.editor.TextView#event:onModelChanging.

NOTE: This method is not meant to called directly by application code. It is called internally by the TextModel as part of the implementation of #setText. This method is included in the public API for documentation purposes and to allow integration with other toolkit frameworks.

Parameters:
{orion.editor.ModelChangingEvent} modelChangingEvent
  the changing event

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: </jobs/genie.eclipse.orion/orion-client/workspace/bundles/org.eclipse.orion.client.editor/web/orion/editor/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:
  orion.editor.EventTarget#addEventListener

setLineDelimiter(lineDelimiter, all)
Sets the line delimiter that is used by the view when new lines are inserted in the model due to key strokes and paste operations. The line delimiter of existing lines are unchanged unless the to `all` argument is `true`.

If lineDelimiter is "auto", the delimiter is computed to be the first delimiter found in the current text. If lineDelimiter is undefined or if there are no delimiters in the current text, the platform delimiter is used.

Parameters:
{String} lineDelimiter
  the line delimiter that is used by the view when inserting new lines.
{Boolean} all Optional, Default: false
  whether or not the delimiter of existing lines are changed.

setText(text, start, end)
Replaces the text in the given range with the given text.

The end offset is not inclusive. This means that the character at the end offset is not replaced.

The text model must notify the listeners before and after the the text is changed by calling #onChanging and #onChanged respectively.

Parameters:
{String} text Optional, Default: ""
  the new text.
{Number} start Optional, Default: 0
  the zero based start offset of text range.
{Number} end Optional, Default: char count
  the zero based end offset of text range.

See:
  orion.editor.TextModel#getText

Documentation generated by JsDoc Toolkit 2.4.0 on Mon May 05 2014 22:06:15 GMT-0400 (EDT)