constructor (editor, container) {
    const searchBox = this

    this.editor = editor
    this.timeout = undefined
    this.delay = 200 // ms
    this.lastText = undefined
    this.results = null

    this.dom = {}
    this.dom.container = container

    const wrapper = document.createElement('div')
    this.dom.wrapper = wrapper
    wrapper.className = 'jsoneditor-search'
    container.appendChild(wrapper)

    const results = document.createElement('div')
    this.dom.results = results
    results.className = 'jsoneditor-results'
    wrapper.appendChild(results)

    const divInput = document.createElement('div')
    this.dom.input = divInput
    divInput.className = 'jsoneditor-frame'
    divInput.title = translate('searchTitle')
    wrapper.appendChild(divInput)

    const refreshSearch = document.createElement('button')
    refreshSearch.type = 'button'
    refreshSearch.className = 'jsoneditor-refresh'
    divInput.appendChild(refreshSearch)

    const search = document.createElement('input')
    search.type = 'text'
    this.dom.search = search
    search.oninput = event => {
      searchBox._onDelayedSearch(event)
    }
    search.onchange = event => {
      // For IE 9
      searchBox._onSearch()
    }
    search.onkeydown = event => {
      searchBox._onKeyDown(event)
    }
    search.onkeyup = event => {
      searchBox._onKeyUp(event)
    }
    refreshSearch.onclick = event => {
      search.select()
    }

    // TODO: ESC in FF restores the last input, is a FF bug, https://bugzilla.mozilla.org/show_bug.cgi?id=598819
    divInput.appendChild(search)

    const searchNext = document.createElement('button')
    searchNext.type = 'button'
    searchNext.title = translate('searchNextResultTitle')
    searchNext.className = 'jsoneditor-next'
    searchNext.onclick = () => {
      searchBox.next()
    }

    divInput.appendChild(searchNext)

    const searchPrevious = document.createElement('button')
    searchPrevious.type = 'button'
    searchPrevious.title = translate('searchPreviousResultTitle')
    searchPrevious.className = 'jsoneditor-previous'
    searchPrevious.onclick = () => {
      searchBox.previous()
    }

    divInput.appendChild(searchPrevious)
  }
@constructor SearchBox
Create a search box in given HTML container
@param {JSONEditor} editor    The JSON Editor to attach to
@param {Element} container               HTML container element of where to
                                         create the search box