Options
All
  • Public
  • Public/Protected
  • All
Menu

Controls the validator and the tasks that pertain to error processing and refreshing. Takes care of reporting errors to the user.

Hierarchy

  • ValidationController

Index

Constructors

constructor

  • Parameters

    • editor: Editor

      The editor for which this controller is created.

    • validator: Validator

      The validator which is under control.

    • resolver: DefaultNameResolver

      A name resolver to resolve names in errors.

    • scroller: Scroller

      The scroller for the edited contents.

    • guiRoot: Element

      The DOM element representing the root of the edited document.

    • progressBar: HTMLElement
    • validationMessage: HTMLElement
    • errorLayer: ErrorLayer
    • errorList: HTMLElement
    • errorItemHandler: ErrorItemHandler

    Returns ValidationController

Properties

Private $errorList

$errorList: JQuery

Private _errors

_errors: GUIValidationError[] = []

document

document: Document

Private editor

editor: Editor

The editor for which this controller is created.

Private errorItemHandler

errorItemHandler: ErrorItemHandler

Private errorLayer

errorLayer: ErrorLayer

Private errorList

errorList: HTMLElement

Private guiRoot

guiRoot: Element

The DOM element representing the root of the edited document.

Private lastDoneShown

lastDoneShown: number = 0

Private processErrorsDelay

processErrorsDelay: number = 500

This holds the timeout set to process validation errors in batch. The delay in ms before we consider a batch ready to process.

Private processErrorsRunner

processErrorsRunner: TaskRunner

Private processErrorsTimeout

processErrorsTimeout: number | undefined

Private progressBar

progressBar: HTMLElement

Private refreshErrorsRunner

refreshErrorsRunner: TaskRunner

Private resolver

resolver: DefaultNameResolver

A name resolver to resolve names in errors.

Private scroller

scroller: Scroller

The scroller for the edited contents.

Private validationMessage

validationMessage: HTMLElement

Private validator

validator: Validator

The validator which is under control.

Methods

appendItems

  • appendItems(items: HTMLElement[]): void
  • Add items to the list of errors.

    Parameters

    • items: HTMLElement[]

      The items to add to the list of errors.

    Returns void

appendMarkers

  • appendMarkers(markers: HTMLElement[]): void
  • Add markers to the layer that is used to contain error markers.

    Parameters

    • markers: HTMLElement[]

      The markers to add.

    Returns void

Private clearErrors

  • clearErrors(): void
  • Clear all validation errors. This makes the editor forget and updates the GUI to remove all displayed errors.

    Returns void

copyErrorList

Private findInsertionPoint

  • findInsertionPoint(ev: ErrorData): DLoc | undefined
  • Find where the error represented by the event passed should be marked.

    Parameters

    • ev: ErrorData

      The error reported by the validator.

    Returns DLoc | undefined

    A location, if possible.

Private onResetErrors

  • onResetErrors(ev: ResetData): void

Private onValidatorError

  • onValidatorError(ev: ErrorData): void
  • Handles a validation error reported by the validator. It records the error and schedule future processing of the errors.

    Parameters

    • ev: ErrorData

    Returns void

Private onValidatorStateChange

  • onValidatorStateChange(workingState: WorkingStateData): void
  • Handles changes in the validator state. Updates the progress bar and the validation status.

    Parameters

    • workingState: WorkingStateData

    Returns void

processError

  • Process a single error. This will compute the location of the error marker and will create a marker to add to the error layer, and a list item to add to the list of errors.

    Parameters

    Returns boolean

    false if there was no insertion point for the error, and thus no marker or item were created. true otherwise.

processErrors

  • processErrors(): void

recreateErrors

  • recreateErrors(): void
  • This method recreates the error messages and the error markers associated with the errors that the editor already knows.

    Returns void

refreshErrors

  • refreshErrors(): void

resume

  • resume(): void

stop

  • stop(): void

terminate

  • terminate(): void

Generated using TypeDoc