Class Index | File Index

Classes


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:


Defined in: </shared/eclipse/e4/orion/I201404012230/bundles/org.eclipse.orion.client.editor/web/orion/editor/editor.js>.

Class Summary
Constructor Attributes Constructor Name and Description
 
Creates a new Editor with the given options.
Method Summary
Method Attributes Method Name and Description
 
Destroys the editor.
 
Gives focus to the text view.
 
Returns the annotation model of the editor.
 
Returns the annotation ruler of the editor.
 
Returns the annotation styler of the editor.
 
 
Returns the content assist of the editor.
 
Returns the folding ruler of the editor.
 
Returns the editor's key modes.
 
<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 editor linked mode.
 
Returns the base text model of this editor.
 
Returns the overview ruler of the editor.
 
 
Returns the editor source code actions.
 
Returns the editor text actions.
 
Returns the underlying TextView used by this editor.
 
 
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.
 
Resizes the text view.
 
setAnnotationRulerVisible(visible, force)
Sets whether the annotation ruler is visible.
 
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.
 
setOverviewRulerVisible(visible, force)
Sets whether the overview ruler is visible.
 
setSelection(start, end, show, callback)
 
setText(text, start, end)
 
showAnnotations(annotations, types, createAnnotation, getType)
 
showBlame(blameMarkers)
 
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.foldingRulerFactory
{Object} options.statusReporter
{Object} options.textViewFactory
{Object} options.undoStackFactory
{Object} options.textDNDFactory
Method Detail
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}

{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}

{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 -1 if out of range

{orion.editor.LineNumberRuler} getLineNumberRuler()
Returns the line number ruler of the editor.
Returns:
{orion.editor.LineNumberRuler}

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()

{orion.editor.sourceCodeActions} getSourceCodeActions()
Returns the editor source code actions.
Returns:
{orion.editor.sourceCodeActions}

{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.

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
true to show ruler, false otherwise
force

setCaretOffset(caretOffset, show, callback)
Parameters:
caretOffset
show
callback

setFoldingRulerVisible(visible, force)
Sets whether the folding ruler is visible.
Parameters:
{Boolean} visible
true to show ruler, false otherwise
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
true to show ruler, false otherwise
force

setOverviewRulerVisible(visible, force)
Sets whether the overview ruler is visible.
Parameters:
{Boolean} visible
true to show ruler, false otherwise
force

setSelection(start, end, show, callback)
Parameters:
start
end
show
callback

setText(text, start, end)
Parameters:
text
start
end

showAnnotations(annotations, types, createAnnotation, getType)
Parameters:
annotations
types
createAnnotation
getType

showBlame(blameMarkers)
Parameters:
blameMarkers

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.

Documentation generated by JsDoc Toolkit 2.4.0 on Tue Apr 01 2014 22:58:23 GMT-0400 (EDT)