Options
All
  • Public
  • Public/Protected
  • All
Menu

Class NotebookSearchProvider

Hierarchy

  • NotebookSearchProvider

Implements

Index

Constructors

constructor

Properties

Private _cellsWithMatches

_cellsWithMatches: any

Private _changed

_changed: any

Private _currentMatch

_currentMatch: any

Private _currentMatchIsSelected

_currentMatchIsSelected: any

Private _currentProvider

_currentProvider: any

Private _filters

_filters: any

Private _getMatchesFromCells

_getMatchesFromCells: any

Private _onSearchProviderChanged

_onSearchProviderChanged: any

Private _refreshCellsEditorsInBackground

_refreshCellsEditorsInBackground: any

Gradually refresh cells in the background so that the user will not experience frozen interface, n cells at a time.

Private _refreshCurrentCellEditor

_refreshCurrentCellEditor: any

Refresh the editor in the cell for the current match.

Private _searchProviders

_searchProviders: any

Private _searchTarget

_searchTarget: any

Private _stepNext

_stepNext: any

Private _unRenderedMarkdownCells

_unRenderedMarkdownCells: any

Private _updatedCurrentProvider

_updatedCurrentProvider: any

Readonly hasOutputs

hasOutputs: true = true

Set to true if the widget under search has outputs to search. Defaults to false.

Readonly isReadOnly

isReadOnly: false = false

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.

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>

currentMatchIndex

  • get currentMatchIndex(): number
  • The current index of the selected match.

    Returns number

matches

  • The same list of matches provided by the startQuery promise resolution

    Returns ISearchMatch[]

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, removes all matches.

    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 unknown

    Initial value used to populate the search box.

highlightNext

  • Move the current match indicator to the next match.

    Returns Promise<ISearchMatch>

    A promise that resolves once the action has completed.

highlightPrevious

  • Move the current match indicator to the previous match.

    Returns Promise<ISearchMatch>

    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

    Parameters

    • newText: string

    Returns Promise<boolean>

    A promise that resolves with a boolean indicating whether a replace occurred.

replaceCurrentMatch

  • replaceCurrentMatch(newText: string): Promise<boolean>
  • Replace the currently selected match with the provided text

    Parameters

    • newText: string

    Returns Promise<boolean>

    A promise that resolves with a boolean indicating whether a replace occurred.

startQuery

  • 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: NotebookPanel

      The widget to be searched

    • filters: INotebookFilters

      Filter parameters to pass to provider

    Returns Promise<ISearchMatch[]>

    A promise that resolves with a list of all matches

Static canSearchOn

  • Report whether or not this provider has the ability to search on the given object

    Parameters

    • domain: Widget

    Returns domain is NotebookPanel

Generated using TypeDoc