Class orion.editor.Editor
				
				
Extends
					orion.editor.BaseEditor.
				
			
				An Editor is a user interface for editing text that provides additional features over the basic orion.editor.TextView.
Some of Editor's features include:
- Additional actions and key bindings for editing text
- Content assist
- Find and Incremental Find
- Rulers for displaying line numbers and annotations
- Status reporting
Defined in: </jobs/genie.orion/orion-client-stable/workspace/bundles/org.eclipse.orion.client.editor/web/orion/editor/editor.js>.
| Constructor Attributes | Constructor Name and Description | 
|---|---|
| 
								orion.editor.Editor(options)
							 Creates a new Editor with the given options. | 
| Method Attributes | Method Name and Description | 
|---|---|
| addFoldingAnnotation(start, end)
								 Creates and add a FoldingAnnotation to the editor. | |
| destroy()
								 Destroys the editor. | |
| focus()
								 Gives focus to the text view. | |
| Returns the annotation model of the editor. | |
| Returns the annotation ruler of the editor. | |
| Returns the whether annotation ruler of the editor is showning. | |
| Returns the annotation styler of the editor. | |
| Returns the content assist of the editor. | |
| Returns the folding ruler of the editor. | |
| Returns the whether folding ruler of the editor is showning. | |
| Returns the editor's key modes. | |
| getLineAtOffset(offset)
								 | |
| <static> | orion.editor.Editor.getLineAtOffset(offset)
								 Returns the line number corresponding to the given offset in the source | 
| Returns the line number ruler of the editor. | |
| Returns the whether lines ruler of the editor is showning. | |
| getLineStart(line)
								 | |
| Returns the editor linked mode. | |
| getModel()
								 Returns the base text model of this editor. | |
| Returns the overview ruler of the editor. | |
| getSelectionText(delimiter)
								 Returns the text view selection text. | |
| Returns the editor source code actions. | |
| Returns the editor text actions. | |
| Returns the underlying  TextViewused by this editor. | |
| Returns the Tooltip instance for this editor | |
| Returns the zoom ruler of the editor. | |
| Returns the whether zoom ruler of the editor is showning. | |
| install()
								 | |
| Creates the underlying TextView and installs the editor's features. | |
| mapOffset(offset, _parent)
								 | |
| onGotoLine(line, column, end, callback)
								 Reveals a line in the editor, and optionally selects a portion of the line. | |
| resize()
								 Resizes the text view. | |
| setAnnotationRulerVisible(visible, force)
								 Sets whether the annotation ruler is visible. | |
| setAnnotationTypesVisible(types)
								 Sets which annotations types are shown in the annotation ruler. | |
| setCaretOffset(caretOffset, show, callback)
								 | |
| setFoldingRulerVisible(visible, force)
								 Sets whether the folding ruler is visible. | |
| setInput(title, message, contents, contentsSaved, noFocus)
								 Sets the editor's contents. | |
| setLineNumberRulerVisible(visible, force)
								 Sets whether the line numbering ruler is visible. | |
| setNoFocus(if, noFocus)
								 Sets the editor's noFocus flag. | |
| Sets which annotations types are shown in the overview ruler. | |
| setOverviewRulerVisible(visible, force)
								 Sets whether the overview ruler is visible. | |
| setSelection(start, end, show, callback)
								 | |
| setSelections(ranges, show, callback)
								 | |
| setText(text, start, end, show, callback)
								 | |
| Sets which annotations types are shown in the text. | |
| setZoomRulerVisible(visible, force)
								 Sets whether the zoom ruler is visible. | |
| showAnnotations(annotations, types, createAnnotation, getType)
								 | |
| showBlame(blameMarkers)
								 | |
| showDiffAnnotations(diffs)
								 Display git diff annotation on the editor's annotation ruler and overview ruler. | |
| showOccurrences(occurrences)
								 | |
| showProblems(problems)
								 | |
| showSelection(start, end, line, offset, length)
								 Reveals and selects a portion of text. | |
| Destroys the underlying TextView. | 
- Methods borrowed from class orion.editor.BaseEditor:
- addEventListener, dispatchEvent, getText, getTitle, getUndoStack, isDirty, markClean, onChanged, onDirtyChanged, onInputChanged, removeEventListener, reportStatus, setDirty
					Class Detail
				
				
				
						orion.editor.Editor(options)
				
				
				
					Creates a new Editor with the given options.
					
				
				
				
				
				
					
						- Parameters:
- {Object} options
- Options controlling the features of this Editor.
- {Object} options.annotationFactory
- {Object} options.contentAssistFactory
- {Object} options.domNode
- {Object} options.keyBindingFactory
- {Object} options.lineNumberRulerFactory
- {Object} options.zoomRulerFactory
- {Object} options.foldingRulerFactory
- {Object} options.statusReporter
- {Object} options.textViewFactory
- {Object} options.undoStackFactory
- {Object} options.textDNDFactory
- {Object} options.hoverFactory
					Method Detail
				
				
					 
					
					
					{orion.editor.FoldingAnnotation}
					addFoldingAnnotation(start, end)
					
					
					
						Creates and add a FoldingAnnotation to the editor.
						
						
					
					
					
					
						
							- Parameters:
- {Number} start
- The start offset of the annotation in the text model.
- {Number} end
- The end offset of the annotation in the text model.
- Returns:
- {orion.editor.FoldingAnnotation} The FoldingAnnotation added to the editor.
					
					
					destroy()
					
					
					
						Destroys the editor.
						
						
					
					
					
					
						
						
						
						
						
						
						
					
					
					
					focus()
					
					
					
						Gives focus to the text view.
						
						
					
					
					
					
						
						
						
						
						
						
						
					
					
					{orion.editor.AnnotationModel}
					getAnnotationModel()
					
					
					
						Returns the annotation model of the editor.
						
						
					
					
					
					
						
						
						
						
						
							- Returns:
- {orion.editor.AnnotationModel}
					
					{orion.editor.AnnotationRuler}
					getAnnotationRuler()
					
					
					
						Returns the annotation ruler of the editor.
						
						
					
					
					
					
						
						
						
						
						
							- Returns:
- {orion.editor.AnnotationRuler}
					
					{Boolean}
					getAnnotationRulerVisible()
					
					
					
						Returns the whether annotation ruler of the editor is showning.
						
						
					
					
					
					
						
						
						
							- Since:
- 12
- Returns:
- {Boolean}
					
					{orion.editor.AnnotationStyler}
					getAnnotationStyler()
					
					
					
						Returns the annotation styler of the editor.
						
						
					
					
					
					
						
						
						
						
						
							- Returns:
- {orion.editor.AnnotationStyler}
					
					
					getCaretOffset()
					
					
					
					
					{orion.editor.LineNumberRuler}
					getContentAssist()
					
					
					
						Returns the content assist of the editor.
						
						
					
					
					
					
						
						
						
						
						
							- Returns:
- {orion.editor.LineNumberRuler}
					
					{orion.editor.FoldingRuler}
					getFoldingRuler()
					
					
					
						Returns the folding ruler of the editor.
						
						
					
					
					
					
						
						
						
						
						
							- Returns:
- {orion.editor.FoldingRuler}
					
					{Boolean}
					getFoldingRulerVisible()
					
					
					
						Returns the whether folding ruler of the editor is showning.
						
						
					
					
					
					
						
						
						
							- Since:
- 12
- Returns:
- {Boolean}
					
					{Array}
					getKeyModes()
					
					
					
						Returns the editor's key modes.
						
						
					
					
					
					
						
						
						
						
						
							- Returns:
- {Array} the editor key modes.
					
					
					getLineAtOffset(offset)
					
					
					- Parameters:
- offset
<static> 
					
					{Number}
					orion.editor.Editor.getLineAtOffset(offset)
					
					
					
						Returns the line number corresponding to the given offset in the source
						
						
					
					
					
					
						
							- Parameters:
- {Number} offset
- The offset into the source
- Since:
- 5.0
- Returns:
- {Number} The line number corresponding to the given offset or -1if out of range
					
					{orion.editor.LineNumberRuler}
					getLineNumberRuler()
					
					
					
						Returns the line number ruler of the editor.
						
						
					
					
					
					
						
						
						
						
						
							- Returns:
- {orion.editor.LineNumberRuler}
					
					{Boolean}
					getLineNumberRulerVisible()
					
					
					
						Returns the whether lines ruler of the editor is showning.
						
						
					
					
					
					
						
						
						
							- Since:
- 12
- Returns:
- {Boolean}
					
					
					getLineStart(line)
					
					
					- Parameters:
- line
					
					{orion.editor.LinkedMode}
					getLinkedMode()
					
					
					
						Returns the editor linked mode.
						
						
					
					
					
					
						
						
						
						
						
							- Returns:
- {orion.editor.LinkedMode}
					
					{orion.editor.TextModel}
					getModel()
					
					
					
						Returns the base text model of this editor.
						
						
					
					
					
					
						
						
						
						
						
							- Returns:
- {orion.editor.TextModel}
					
					{orion.editor.OverviewRuler}
					getOverviewRuler()
					
					
					
						Returns the overview ruler of the editor.
						
						
					
					
					
					
						
						
						
						
						
							- Returns:
- {orion.editor.OverviewRuler}
					
					
					getSelection()
					
					
					
					
					
					getSelections()
					
					
					
					
					{String}
					getSelectionText(delimiter)
					
					
					
						Returns the text view selection text.
					
					
					
						
							If there are multiple selection ranges, the result is concatenated with the specified delimiter.
- Parameters:
- {String} delimiter
- The offset into the editor
- Since:
- 10.0
- Returns:
- {String} the view selection text
					
					{orion.editor.sourceCodeActions}
					getSourceCodeActions()
					
					
					
						Returns the editor source code actions.
						
						
					
					
					
					
						
						
						
						
						
							- Returns:
- {orion.editor.sourceCodeActions}
					
					
					getStyleAccessor()
					
					
					
					
					{orion.editor.textActions}
					getTextActions()
					
					
					
						Returns the editor text actions.
						
						
					
					
					
					
						
						
						
						
						
							- Returns:
- {orion.editor.textActions}
					
					{orion.editor.TextView}
					getTextView()
					
					
					
						Returns the underlying 
					
					
					
						
						
						
						
						
							TextView used by this editor.
						
						
					- Returns:
- {orion.editor.TextView} the editor text view.
					
					{orion.editor.Tooltip}
					getTooltip()
					
					
					
						Returns the Tooltip instance for this editor
						
						
					
					
					
					
						
						
						
						
						
							- Returns:
- {orion.editor.Tooltip}
					
					{orion.editor.LineNumberRuler}
					getZoomRuler()
					
					
					
						Returns the zoom ruler of the editor.
						
						
					
					
					
					
						
						
						
						
						
							- Returns:
- {orion.editor.LineNumberRuler}
					
					{Boolean}
					getZoomRulerVisible()
					
					
					
						Returns the whether zoom ruler of the editor is showning.
						
						
					
					
					
					
						
						
						
							- Since:
- 12
- Returns:
- {Boolean}
					
					
					install()
					
					
					
					
					
					installTextView()
					
					
					
						Creates the underlying TextView and installs the editor's features.
						
						
					
					
					
					
						
						
						
						
						
						
						
					
					
					
					mapOffset(offset, _parent)
					
					
					- Parameters:
- offset
- _parent
					
					
					onGotoLine(line, column, end, callback)
					
					
					
						Reveals a line in the editor, and optionally selects a portion of the line.
						
						
					
					
					
					
						
							- Parameters:
- {Number} line
- - document base line index
- {Number|String} column
- {Number} end Optional
- callback
					
					
					resize()
					
					
					
						Resizes the text view.
						
						
					
					
					
					
						
						
						
						
						
						
						
					
					
					
					setAnnotationRulerVisible(visible, force)
					
					
					
						Sets whether the annotation ruler is visible.
						
						
					
					
					
					
						
							- Parameters:
- {Boolean} visible
- trueto show ruler,- falseotherwise
- force
					
					
					setAnnotationTypesVisible(types)
					
					
					
						Sets which annotations types are shown in the annotation ruler.  Annotations are visible by default.
						
						
					
					
					
					
						
							- Parameters:
- {Object} types
- a hash table mapping annotation type to visibility (i.e. AnnotationType.ANNOTATION_INFO -> true).
- Since:
- 14.0
					
					
					setCaretOffset(caretOffset, show, callback)
					
					
					- Parameters:
- caretOffset
- show
- callback
					
					
					setFoldingRulerVisible(visible, force)
					
					
					
						Sets whether the folding ruler is visible.
						
						
					
					
					
					
						
							- Parameters:
- {Boolean} visible
- trueto show ruler,- falseotherwise
- force
					
					
					setInput(title, message, contents, contentsSaved, noFocus)
					
					
					
						Sets the editor's contents.
						
						
					
					
					
					
						
							- Parameters:
- {String} title
- {String} message
- {String} contents
- {Boolean} contentsSaved
- {Boolean} noFocus
					
					
					setLineNumberRulerVisible(visible, force)
					
					
					
						Sets whether the line numbering ruler is visible.
						
						
					
					
					
					
						
							- Parameters:
- {Boolean} visible
- trueto show ruler,- falseotherwise
- force
					
					
					setNoFocus(if, noFocus)
					
					
					
						Sets the editor's noFocus flag.
						
						
					
					
					
					
						
							
						
						
						
						
						
						
						
					
					
					
					setOverviewAnnotationTypesVisible(types)
					
					
					
						Sets which annotations types are shown in the overview ruler.  Annotations are visible by default.
						
						
					
					
					
					
						
							- Parameters:
- {Object} types
- a hash table mapping annotation type to visibility (i.e. AnnotationType.ANNOTATION_INFO -> true).
- Since:
- 14.0
					
					
					setOverviewRulerVisible(visible, force)
					
					
					
						Sets whether the overview ruler is visible.
						
						
					
					
					
					
						
							- Parameters:
- {Boolean} visible
- trueto show ruler,- falseotherwise
- force
					
					
					setSelection(start, end, show, callback)
					
					
					- Parameters:
- start
- end
- show
- callback
					
					
					setSelections(ranges, show, callback)
					
					
					- Parameters:
- ranges
- show
- callback
					
					
					setText(text, start, end, show, callback)
					
					
					- Parameters:
- text
- start
- end
- show
- callback
					
					
					setTextAnnotationTypesVisible(types)
					
					
					
						Sets which annotations types are shown in the text.  Annotations are visible by default.
						
						
					
					
					
					
						
							- Parameters:
- {Object} types
- a hash table mapping annotation type to visibility (i.e. AnnotationType.ANNOTATION_INFO -> true).
- Since:
- 14.0
					
					
					setZoomRulerVisible(visible, force)
					
					
					
						Sets whether the zoom ruler is visible.
						
						
					
					
					
					
						
							- Parameters:
- {Boolean} visible
- trueto show ruler,- falseotherwise
- force
					
					
					showAnnotations(annotations, types, createAnnotation, getType)
					
					
					- Parameters:
- annotations
- types
- createAnnotation
- getType
					
					
					showBlame(blameMarkers)
					
					
					- Parameters:
- blameMarkers
					
					
					showDiffAnnotations(diffs)
					
					
					
						Display git diff annotation on the editor's annotation ruler and overview ruler.
						
						
					
					
					
					
						
							- Parameters:
- diffs
- [] with types "added", "modified", "deleted" Each property in diffs contains an array of objects { lineStart, lineEnd } that provides the starting and ending line index for the specified property.
					
					
					showOccurrences(occurrences)
					
					
					- Parameters:
- occurrences
					
					
					showProblems(problems)
					
					
					- Parameters:
- problems
					
					
					showSelection(start, end, line, offset, length)
					
					
					
						Reveals and selects a portion of text.
						
						
					
					
					
					
						
							- Parameters:
- {Number} start
- {Number} end
- {Number} line
- {Number} offset
- {Number} length
					
					
					uninstall()
					
					
					
					
					
					uninstallTextView()
					
					
					
						Destroys the underlying TextView.