VirtualRenderer

优质
小牛编辑
139浏览
2023-12-01

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

Constructors

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

containerDOMElementRequired. The root element of the editor
themeStringRequired. The starting theme

Methods

  • VirtualRenderer._loadTheme()
  • Undocumented
  • VirtualRenderer.addGutterDecoration(Object row, Object className)

Deprecated; (moved to EditSession)

rowObjectRequired.
classNameObjectRequired.
  • VirtualRenderer.adjustWrapLimit()

Adjusts the wrap limit, which is the number of characters that can fit within the width of the edit area on screen.

  • VirtualRenderer.alignCursor()
  • Undocumented
  • VirtualRenderer.animateScrolling()
  • Undocumented
  • VirtualRenderer.destroy()

Destroys the text and cursor layers for this renderer.

  • VirtualRenderer.getAnimatedScroll()
  • 返回值: Boolean

Returns whether an animated scroll happens or not.

  • VirtualRenderer.getContainerElement()
  • 返回值: DOMElement

Returns the root element containing this renderer.

  • VirtualRenderer.getDisplayIndentGuides()
  • Undocumented
  • VirtualRenderer.getFadeFoldWidgets()
  • Undocumented
  • VirtualRenderer.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.

  • VirtualRenderer.getFirstVisibleRow()
  • 返回值: Number

Returns the index of the first visible row.

  • VirtualRenderer.getHighlightGutterLine()
  • Undocumented
  • VirtualRenderer.getHScrollBarAlwaysVisible()
  • 返回值: Boolean

Returns whether the horizontal scrollbar is set to be always visible.

  • VirtualRenderer.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.

  • VirtualRenderer.getLastVisibleRow()
  • 返回值: Number

Returns the index of the last visible row.

  • VirtualRenderer.getMouseEventTarget()
  • 返回值: DOMElement

Returns the element that the mouse events are attached to

  • VirtualRenderer.getPrintMarginColumn()
  • 返回值: Boolean

Returns whether the print margin column is being shown or not.

  • VirtualRenderer.getScrollBottomRow()
  • 返回值: Number

Returns the last visible row, regardless of whether it's fully visible or not.

  • VirtualRenderer.getScrollLeft()
  • 返回值: Number

Returns the value of the distance between the left of the editor and the leftmost part of the visible content.

  • VirtualRenderer.getScrollTop()
  • 返回值: Number

Returns the value of the distance between the top of the editor and the topmost part of the visible content.

  • VirtualRenderer.getScrollTopRow()
  • 返回值: Number

Returns the first visible row, regardless of whether it's fully visible or not.

  • VirtualRenderer.getShowGutter()
  • 返回值: Boolean

Returns true if the gutter is being shown.

  • VirtualRenderer.getShowInvisibles()
  • 返回值: Boolean

Returns whether invisible characters are being shown or not.

  • VirtualRenderer.getShowPrintMargin()
  • 返回值: Boolean

Returns whether the print margin is being shown or not.

  • VirtualRenderer.getTextAreaContainer()
  • 返回值: DOMElement

Returns the element to which the hidden text area is added.

  • VirtualRenderer.getTheme()
  • 返回值: String

Returns the path of the current theme.

  • VirtualRenderer.hideComposition()

Hides the current composition.

  • VirtualRenderer.hideCursor()

Hides the cursor icon.

Returns true if you can still scroll by either parameter; in other words, you haven't reached the end of the file or line.

deltaXNumberRequired. The x value to scroll by
deltaYNumberRequired. The y value to scroll by
  • VirtualRenderer.onChangeTabSize()
  • Undocumented
  • VirtualRenderer.onGutterResize()
  • Undocumented

Triggers a resize of the editor.

forceBooleanRequired. If true, recomputes the size, even if the height and width haven't changed
gutterWidthNumberRequired. The width of the gutter in pixels
widthNumberRequired. The width of the editor in pixels
heightNumberRequired. The height of the editor, in pixels
  • VirtualRenderer.pixelToScreenCoordinates()
  • Undocumented
  • VirtualRenderer.removeGutterDecoration(Object row, Object className)

Deprecated; (moved to EditSession)

rowObjectRequired.
classNameObjectRequired.
  • VirtualRenderer.screenToTextCoordinates()
  • Undocumented

Scrolls the editor across both x- and y-axes.

deltaXNumberRequired. The x value to scroll by
deltaYNumberRequired. The y value to scroll by
  • VirtualRenderer.scrollCursorIntoView(Object cursor, Object offset)

Scrolls the cursor into the first visible area of the editor

cursorObjectRequired.
offsetObjectRequired.
  • VirtualRenderer.scrollSelectionIntoView()
  • Undocumented

Gracefully scrolls the editor to the row indicated.

lineNumberRequired. A line number
centerBooleanRequired. If true, centers the editor the to indicated line
animateBooleanRequired. If true animates scrolling
callbackFunctionRequired. Function to be called after the animation has finished
  • VirtualRenderer.scrollToRow(Number row)

Gracefully scrolls from the top of the editor to the row indicated.

rowNumberRequired. A row id
  • VirtualRenderer.scrollToX(Number scrollLeft)
  • 返回值: Number

Scrolls the editor across the x-axis to the pixel indicated.

scrollLeftNumberRequired. The position to scroll to
  • VirtualRenderer.scrollToY(Number scrollTop)
  • 返回值: Number

Scrolls the editor to the y pixel indicated.

scrollTopNumberRequired. The position to scroll to
  • VirtualRenderer.setAnimatedScroll(Boolean shouldAnimate)

Identifies whether you want to have an animated scroll or not.

shouldAnimateBooleanRequired. Set to true to show animated scrolls
  • VirtualRenderer.setAnnotations(Array annotations)

Sets annotations for the gutter.

annotationsArrayRequired. An array containing annotations
  • VirtualRenderer.setCompositionText(String text)
  • Undocumented
textStringRequired. A string of text to use

Sets the inner text of the current composition to text.

  • VirtualRenderer.setDisplayIndentGuides()
  • Undocumented
  • VirtualRenderer.setFadeFoldWidgets()
  • Undocumented
  • VirtualRenderer.setHighlightGutterLine()
  • Undocumented
  • VirtualRenderer.setHScrollBarAlwaysVisible(Boolean alwaysVisible)

Identifies whether you want to show the horizontal scrollbar or not.

alwaysVisibleBooleanRequired. Set to true to make the horizontal scroll bar visible
  • VirtualRenderer.setPadding(Number padding)

Sets the padding for all the layers.

paddingNumberRequired. A new padding value (in pixels)
  • VirtualRenderer.setPrintMarginColumn(Boolean showPrintMargin)

Identifies whether you want to show the print margin column or not.

showPrintMarginBooleanRequired. Set to true to show the print margin column
  • VirtualRenderer.setSession(Object session)

Associates the renderer with an EditSession.

sessionObjectRequired.
  • VirtualRenderer.setShowGutter(Boolean show)

Identifies whether you want to show the gutter or not.

showBooleanRequired. Set to true to show the gutter
  • VirtualRenderer.setShowInvisibles(Boolean showInvisibles)

Identifies whether you want to show invisible characters or not.

showInvisiblesBooleanRequired. Set to true to show invisibles
  • VirtualRenderer.setShowPrintMargin(Boolean showPrintMargin)

Identifies whether you want to show the print margin or not.

showPrintMarginBooleanRequired. Set to true to show the print margin
  • VirtualRenderer.setStyle()
  • Undocumented
  • VirtualRenderer.setTheme(String theme)

Sets a new theme for the editor. theme should exist, and be a directory path, like ace/theme/textmate.

themeStringRequired. The path to a theme
  • VirtualRenderer.showCursor()

Shows the cursor icon.

Returns an object containing the pageX and pageY coordinates of the document position.

rowNumberRequired. The document row position
columnNumberRequired. The document column position
  • VirtualRenderer.unsetStyle(String style)

Removes the class style from the editor.

styleStringRequired. A class name
  • VirtualRenderer.updateBackMarkers()

Schedules an update to all the back markers in the document.

  • VirtualRenderer.updateBreakpoints(Object rows)

Redraw breakpoints.

rowsObjectRequired.
  • VirtualRenderer.updateCharacterSize()
  • Undocumented
  • VirtualRenderer.updateCursor()

Updates the cursor icon.

  • VirtualRenderer.updateFontSize()

Updates the font size.

  • VirtualRenderer.updateFrontMarkers()

Schedules an update to all the front markers in the document.

  • VirtualRenderer.updateFull(Boolean force)

Triggers a full update of all the layers, for all the rows.

forceBooleanRequired. If true, forces the changes through
  • VirtualRenderer.updateLines(Number firstRow, Number lastRow)

Triggers a partial update of the text, from the range given by the two parameters.

firstRowNumberRequired. The first row to update
lastRowNumberRequired. The last row to update
  • VirtualRenderer.updateText()

Triggers a full update of the text, for all the rows.

  • VirtualRenderer.visualizeBlur()

Blurs the current container.

  • VirtualRenderer.visualizeFocus()

Focuses the current container.