Skip to main content
Jump to: navigation, search

Eclipse Monkey/Javascript Editor

< Eclipse Monkey
Revision as of 08:35, 17 September 2008 by (Talk | contribs) (fix project termination link)

The Eclipse Monkey component of the Dash Project has been archived [1].
Thus this page is no longer active.

This page covers the org.eclipse.eclipsemonkey.lang.javascript.doms.editors.Editor class, which is what you get from this line:

var sourceEditor = editors.activeEditor;

This documentation was written for version ???



  • id: ?
  • lineDelimiter: the correct End of Line characters for the current file?
  • source: the current contents of the editor, as a Java String.
  • sourceLength: the length of the current contents of the editor.
  • selectionRange: the range of text that is currently selected in the editor. It contains two integers, startingOffset and endingOffset. These may be used to find the selected text within the source property. If nothing is selected endingOffset == startingOffset.
  • title: ?
  • textEditor: ?


  • currentOffset: ?


  • applyEdit(int offset, int deleteLength, String insertText): Used to insert and/or delete text. offset is a position within the source property. deleteLength is the length of the existing text to remove; use 0 to not delete anything. insertText is text to insert at offset; use "" to not insert anything.
  • beginCompoundChange(): ?
  • close(boolean save): close the current editor, saving its contents if save == true?
  • endCompoundChange(): ?
  • getLineAtOffset(int offset): returns the number of the line that contains offset.
  • getOffsetAtLine(final int line): returns the offset of the first character in line line.
  • save(): saves the current contents of the editor?
  • selectAndReveal(final int offset, final int length): selects the text starting at offset and ending at (offset + length). Will scroll the text as needed to make the selection visible on screen. length may be 0 to force a line to be visible without selecting anything.
  • toString(): returns "[object Editor]"

Back to the top