Options
All
  • Public
  • Public/Protected
  • All
Menu

Class CSVSearchProvider

Hierarchy

  • CSVSearchProvider

Implements

Index

Properties

Private _changed

_changed: Signal<this, void> = new Signal<this, void>(this)

Private _query

_query: RegExp

Private _target

currentMatchIndex

currentMatchIndex: number | null = null

The current index of the selected match.

isReadOnly

isReadOnly: true = true

Set to true if the widget under search is read-only, false if it is editable. Will be used to determine whether to show the replace option.

matches

matches: ISearchMatch[] = []

The same list of matches provided by the startQuery promise resoluton

Accessors

changed

  • get changed(): ISignal<this, void>
  • Signal indicating that something in the search has changed, so the UI should update

    Returns ISignal<this, void>

Methods

endQuery

  • endQuery(): Promise<void>
  • Clears state of a search provider to prepare for startQuery to be called in order to start a new query or refresh an existing one.

    Returns Promise<void>

    A promise that resolves when the search provider is ready to begin a new search.

endSearch

  • endSearch(): Promise<void>
  • Resets UI state as it was before the search process began. Cleans up and disposes of all internal state.

    Returns Promise<void>

    A promise that resolves when all state has been cleaned up.

getInitialQuery

  • Get an initial query value if applicable so that it can be entered into the search box as an initial query

    Parameters

    Returns any

    Initial value used to populate the search box.

highlightNext

  • highlightNext(): Promise<ISearchMatch | undefined>
  • Move the current match indicator to the next match.

    Returns Promise<ISearchMatch | undefined>

    A promise that resolves once the action has completed.

highlightPrevious

  • highlightPrevious(): Promise<ISearchMatch | undefined>
  • Move the current match indicator to the previous match.

    Returns Promise<ISearchMatch | undefined>

    A promise that resolves once the action has completed.

replaceAllMatches

  • replaceAllMatches(newText: string): Promise<boolean>
  • Replace all matches in the notebook with the provided text Not implemented in the CSV viewer as it is read-only.

    Parameters

    • newText: string

    Returns Promise<boolean>

    A promise that resolves once the action has completed.

replaceCurrentMatch

  • replaceCurrentMatch(newText: string): Promise<boolean>
  • Replace the currently selected match with the provided text Not implemented in the CSV viewer as it is read-only.

    Parameters

    • newText: string

    Returns Promise<boolean>

    A promise that resolves once the action has completed.

startQuery

  • startQuery(query: RegExp, searchTarget: CSVDocumentWidget): Promise<ISearchMatch[]>
  • Initialize the search using the provided options. Should update the UI to highlight all matches and "select" whatever the first match should be.

    Parameters

    • query: RegExp

      A RegExp to be use to perform the search

    • searchTarget: CSVDocumentWidget

      The widget to be searched

    Returns Promise<ISearchMatch[]>

    A promise that resolves with a list of all matches

Static canSearchOn

  • canSearchOn(domain: Widget): boolean
  • Report whether or not this provider has the ability to search on the given object

    Parameters

    • domain: Widget

    Returns boolean

Generated using TypeDoc