Class eclipse.Ruler
This interface represents a ruler for the editor.
A Ruler is a graphical element that is placed either on the left or on the right side of the editor. It can be used to provide the editor with per line decoration such as line numbering, bookmarks, breakpoints, folding disclosures, etc.
There are two types of rulers: page and document. A page ruler only shows the content for the lines that are visible, while a document ruler always shows the whole content.
See:eclipse.Editor
eclipse.Editor#addRuler
Defined in: </shared/eclipse/e4/orion/I201106021400/plugins/org.eclipse.orion.client.editor/web/js/editor.js>.
Constructor Attributes | Constructor Name and Description |
---|---|
Method Attributes | Method Name and Description |
---|---|
Returns the indices of the lines that have decoration.
|
|
getHTML(lineIndex)
Returns the HTML content for the decoration of a given line.
|
|
Returns the ruler location.
|
|
Returns the ruler overview type.
|
|
getStyle(lineIndex)
Returns the CSS styling information for the decoration of a given line.
|
Event Attributes | Event Name and Description |
---|---|
onClick(lineIndex, e)
This event is sent when the user clicks a line decoration.
|
|
onDblClick(lineIndex, e)
This event is sent when the user double clicks a line decoration.
|
This function is only called for rulers with "document" overview type.
- Returns:
- {Number[]} an array of line indices.
If the line index is -1
, the HTML content for the decoration
that determines the width of the ruler should be returned.
- Parameters:
- {Number} lineIndex
- Returns:
- {String} the HTML content for a given line, or generic line.
- See:
- #getStyle
- Returns:
- {String} the ruler location, which is either "left" or "right".
- Returns:
- {String} the overview type, which is either "page" or "document".
- See:
- #getLocation
If the line index is -1
, the CSS styling information for the decoration
that determines the width of the ruler should be returned. If the line is
undefined
, the ruler styling information should be returned.
- Parameters:
- {Number} lineIndex
- Returns:
- {eclipse.Style} the CSS styling for ruler, given line, or generic line.
- See:
- #getHTML
- Parameters:
- {Number} lineIndex
- the line index of the clicked decoration
- {DOMEvent} e
- the click event
- Parameters:
- {Number} lineIndex
- the line index of the double clicked decoration
- {DOMEvent} e
- the double click event