Class Index | File Index

Classes


Class orion.textview.Ruler

This interface represents a ruler for the text view.

A Ruler is a graphical element that is placed either on the left or on the right side of the view. It can be used to provide the view 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:
orion.textview.LineNumberRuler
orion.textview.AnnotationRuler
orion.textview.OverviewRuler
orion.textview.TextView
orion.textview.TextView#addRuler


Defined in: </shared/eclipse/e4/orion/I201107200200/plugins/org.eclipse.orion.client.editor/web/orion/textview/rulers.js>.

Class Summary
Constructor Attributes Constructor Name and Description
 
orion.textview.Ruler(rulerLocation, rulerOverview, rulerStyle)
Contructs a new ruler.
Method Summary
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.
 
setView(view)
Sets the view for the ruler.
Event Summary
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.
Class Detail
orion.textview.Ruler(rulerLocation, rulerOverview, rulerStyle)
Contructs a new ruler.

The default implementation does not implement all the methods in the interface and is useful only for objects implementing rulers.

Parameters:
{String} rulerLocation Optional, Default: "left"
the location for the ruler.
{String} rulerOverview Optional, Default: "page"
the overview for the ruler.
{orion.textview.Style} rulerStyle Optional
the style for the ruler.
Method Detail
{Number[]} getAnnotations()
Returns the indices of the lines that have decoration.

This function is only called for rulers with "document" overview type.

Returns:
{Number[]} an array of line indices.

{String} getHTML(lineIndex)
Returns the HTML content for the decoration of a given line.

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
the line index
Returns:
{String} the HTML content for a given line, or generic line.
See:
#getStyle

{String} getLocation()
Returns the ruler location.
Returns:
{String} the ruler location, which is either "left" or "right".
See:
#getOverview

{String} getOverview()
Returns the ruler overview type.
Returns:
{String} the overview type, which is either "page" or "document".
See:
#getLocation

{orion.textview.Style} getStyle(lineIndex)
Returns the CSS styling information for the decoration of a given line.

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
the line index
Returns:
{orion.textview.Style} the CSS styling for ruler, given line, or generic line.
See:
#getHTML

setView(view)
Sets the view for the ruler.
Parameters:
{orion.textview.TextView} view
the text view.
Event Detail
onClick(lineIndex, e)
This event is sent when the user clicks a line decoration.
Parameters:
{Number} lineIndex
the line index of the clicked decoration.
{DOMEvent} e
the click event.

onDblClick(lineIndex, e)
This event is sent when the user double clicks a line decoration.
Parameters:
{Number} lineIndex
the line index of the double clicked decoration.
{DOMEvent} e
the double click event.

Documentation generated by JsDoc Toolkit 2.4.0 on Wed Jul 20 2011 02:04:44 GMT-0400 (EDT)