Options
All
  • Public
  • Public/Protected
  • All
Menu

Class VirtualRenderer

The class that is responsible for drawing everything you see on the screen!

related

editor.renderer

Hierarchy

  • VirtualRenderer

Implements

Index

Constructors

constructor

  • Constructs a new VirtualRenderer within the container specified, applying the given theme.

    Parameters

    • container: Element

      The root element of the editor

    • theme: String

      The starting theme

    Returns VirtualRenderer

Properties

Readonly $padding

$padding: number

Readonly characterWidth

characterWidth: number

Readonly container

container: HTMLElement

Readonly content

content: HTMLElement

Readonly lineHeight

lineHeight: number

Readonly scrollLeft

scrollLeft: number

Readonly scrollTop

scrollTop: number

Readonly scroller

scroller: HTMLElement

Methods

addGutterDecoration

  • addGutterDecoration(row: any, className: any): void

adjustWrapLimit

  • adjustWrapLimit(): boolean
  • Adjusts the wrap limit, which is the number of characters that can fit within the width of the edit area on screen.

    Returns boolean

destroy

  • destroy(): void

getAnimatedScroll

  • getAnimatedScroll(): boolean

getContainerElement

  • getContainerElement(): HTMLElement

getFirstFullyVisibleRow

  • getFirstFullyVisibleRow(): number
  • Returns the index of the first fully visible row. "Fully" here means that the characters in the row are not truncated; that the top and the bottom of the row are on the screen.

    Returns number

getFirstVisibleRow

  • getFirstVisibleRow(): number
  • [Returns the index of the first visible row.]{: #VirtualRenderer.getFirstVisibleRow}

    Returns number

getHScrollBarAlwaysVisible

  • getHScrollBarAlwaysVisible(): boolean

getLastFullyVisibleRow

  • getLastFullyVisibleRow(): number
  • Returns the index of the last fully visible row. "Fully" here means that the characters in the row are not truncated; that the top and the bottom of the row are on the screen.

    Returns number

getLastVisibleRow

  • getLastVisibleRow(): number
  • [Returns the index of the last visible row.]{: #VirtualRenderer.getLastVisibleRow}

    Returns number

getMouseEventTarget

  • getMouseEventTarget(): HTMLElement

getPrintMarginColumn

  • getPrintMarginColumn(): boolean

getScrollBottomRow

  • getScrollBottomRow(): number

getScrollLeft

  • getScrollLeft(): number

getScrollTop

  • getScrollTop(): number

getScrollTopRow

  • getScrollTopRow(): number

getShowGutter

  • getShowGutter(): boolean

getShowInvisibles

  • getShowInvisibles(): boolean

getShowPrintMargin

  • getShowPrintMargin(): boolean

getTextAreaContainer

  • getTextAreaContainer(): HTMLElement

getTheme

  • getTheme(): string

getVScrollBarAlwaysVisible

  • getVScrollBarAlwaysVisible(): boolean

hideComposition

  • hideComposition(): void

hideCursor

  • hideCursor(): void

isScrollableBy

  • isScrollableBy(deltaX: number, deltaY: number): boolean
  • Returns true if you can still scroll by either parameter; in other words, you haven't reached the end of the file or line.

    Parameters

    • deltaX: number

      The x value to scroll by

    • deltaY: number

      The y value to scroll by

    Returns boolean

onResize

  • onResize(force: Boolean, gutterWidth: Number, width: Number, height: Number): number
  • [Triggers a resize of the editor.]{: #VirtualRenderer.onResize}

    Parameters

    • force: Boolean

      If true, recomputes the size, even if the height and width haven't changed

    • gutterWidth: Number

      The width of the gutter in pixels

    • width: Number

      The width of the editor in pixels

    • height: Number

      The hiehgt of the editor, in pixels

    Returns number

removeGutterDecoration

  • removeGutterDecoration(row: any, className: any): void

scrollBy

  • scrollBy(deltaX: number, deltaY: number): void
  • Scrolls the editor across both x- and y-axes.

    Parameters

    • deltaX: number

      The x value to scroll by

    • deltaY: number

      The y value to scroll by

    Returns void

scrollCursorIntoView

  • scrollCursorIntoView(cursor: Position, offset?: number): void

scrollTo

  • scrollTo(x: number, y: number): void
  • Scrolls the editor across both x- and y-axes.

    Parameters

    • x: number

      The x value to scroll to

    • y: number

      The y value to scroll to

    Returns void

scrollToLine

  • scrollToLine(line: number, center: boolean, animate: boolean, callback: () => void): void
  • Gracefully scrolls the editor to the row indicated.

    Parameters

    • line: number

      A line number

    • center: boolean

      If true, centers the editor the to indicated line

    • animate: boolean

      If true animates scrolling

    • callback: () => void

      Function to be called after the animation has finished

        • (): void
        • Returns void

    Returns void

scrollToRow

  • scrollToRow(row: number): void
  • Gracefully scrolls from the top of the editor to the row indicated.

    related

    EditSession.setScrollTop

    Parameters

    • row: number

      A row id

    Returns void

scrollToX

  • scrollToX(scrollLeft: number): void
  • Scrolls the editor across the x-axis to the pixel indicated.

    Parameters

    • scrollLeft: number

      The position to scroll to

    Returns void

scrollToY

  • scrollToY(scrollTop: number): void
  • Scrolls the editor to the y pixel indicated.

    Parameters

    • scrollTop: number

      The position to scroll to

    Returns void

setAnimatedScroll

  • setAnimatedScroll(shouldAnimate: boolean): void
  • Identifies whether you want to have an animated scroll or not.

    Parameters

    • shouldAnimate: boolean

      Set to true to show animated scrolls

    Returns void

setAnnotations

setCompositionText

  • setCompositionText(text: string): void
  • Parameters

    • text: string

      A string of text to use

      Sets the inner text of the current composition to text.

    Returns void

setHScrollBarAlwaysVisible

  • setHScrollBarAlwaysVisible(alwaysVisible: boolean): void
  • Identifies whether you want to show the horizontal scrollbar or not.

    Parameters

    • alwaysVisible: boolean

      Set to true to make the horizontal scroll bar visible

    Returns void

setMouseCursor

  • setMouseCursor(cursorStyle: string): void

setPadding

  • setPadding(padding: number): void
  • Sets the padding for all the layers.

    Parameters

    • padding: number

      A new padding value (in pixels)

    Returns void

setPrintMarginColumn

  • setPrintMarginColumn(showPrintMargin: boolean): void
  • Identifies whether you want to show the print margin column or not.

    Parameters

    • showPrintMargin: boolean

      Set to true to show the print margin column

    Returns void

setSession

setShowGutter

  • setShowGutter(show: boolean): void
  • Identifies whether you want to show the gutter or not.

    Parameters

    • show: boolean

      Set to true to show the gutter

    Returns void

setShowInvisibles

  • setShowInvisibles(showInvisibles: boolean): void
  • Identifies whether you want to show invisible characters or not.

    Parameters

    • showInvisibles: boolean

      Set to true to show invisibles

    Returns void

setShowPrintMargin

  • setShowPrintMargin(showPrintMargin: boolean): void
  • Identifies whether you want to show the print margin or not.

    Parameters

    • showPrintMargin: boolean

      Set to true to show the print margin

    Returns void

setStyle

  • setStyle(style: string, include?: boolean): void
  • Methods allows to add / remove CSS classnames to the editor element.

    Parameters

    • style: string
    • Optional include: boolean

    Returns void

setTheme

  • setTheme(theme: string, callback?: () => void): void
  • [Sets a new theme for the editor. theme should exist, and be a directory path, like ace/theme/textmate.]{: #VirtualRenderer.setTheme}

    Parameters

    • theme: string

      The path to a theme

    • Optional callback: () => void
        • (): void
        • Returns void

    Returns void

setVScrollBarAlwaysVisible

  • setVScrollBarAlwaysVisible(alwaysVisible: boolean): void
  • Identifies whether you want to show the horizontal scrollbar or not.

    Parameters

    • alwaysVisible: boolean

      Set to true to make the horizontal scroll bar visible

    Returns void

Private showComposition

  • showComposition(position: number): void

showCursor

  • showCursor(): void

textToScreenCoordinates

  • textToScreenCoordinates(row: number, column: number): { pageX: number; pageY: number }
  • Returns an object containing the pageX and pageY coordinates of the document position.

    Parameters

    • row: number

      The document row position

    • column: number

      The document column position

    Returns { pageX: number; pageY: number }

    • pageX: number
    • pageY: number

unsetStyle

  • unsetStyle(style: string): void
  • [Removes the class style from the editor.]{: #VirtualRenderer.unsetStyle}

    Parameters

    • style: string

      A class name

    Returns void

updateBackMarkers

  • updateBackMarkers(): void

updateBreakpoints

  • updateBreakpoints(): void

updateCursor

  • updateCursor(): void

updateFontSize

  • updateFontSize(): void

updateFrontMarkers

  • updateFrontMarkers(): void

updateFull

  • updateFull(force?: boolean): void
  • Triggers a full update of all the layers, for all the rows.

    Parameters

    • Optional force: boolean

      If true, forces the changes through

    Returns void

updateLines

  • updateLines(firstRow: number, lastRow: number, force?: boolean): void
  • Triggers a partial update of the text, from the range given by the two parameters.

    Parameters

    • firstRow: number

      The first row to update

    • lastRow: number

      The last row to update

    • Optional force: boolean

    Returns void

updateText

  • updateText(): void

visualizeBlur

  • visualizeBlur(): void

visualizeFocus

  • visualizeFocus(): void

Generated using TypeDoc