load() {
    if (this.deferredLoaded) return this.deferredLoaded
    this.deferredLoaded = $.Deferred()

    // Wait for jstree and TreeBuilder results
    // Initialize the tree builder
    let treeNodes = buildTree(this.widget.options.breedingAPIEndpoint)
    $.when(
      this.treeReady(), treeNodes
    ).then((treeReady, nodes) => {
      let language = LangUtils.getInitialLanguageCode()

      let allNodeIds = []
      for (let node of nodes) {
        allNodeIds.push(node.id)
        // Generate text
        node['text'] = getNodeText(node, language)
        // Add node to tree
        this.jstree.create_node(node.parent, node)
      }
      this.deferredLoaded.resolve(allNodeIds)
      this.allNodeIds = allNodeIds

      // Regroup all languages
      let langs = Arrays.distinct(
        $.map(nodes, n => Object.getOwnPropertyNames(n.data))
      )
      // Show language selector if there is more than one language
      if (langs.length > 1){
        this.displayLanguageSelector(langs)
      }
    })
    return this.deferredLoaded
  }
/**
   * Load tree data
   *
   * @returns Deferred list of all node identifiers
   */
Load tree data
@returns Deferred list of all node identifiers
Load tree data @returns Deferred list of all node identifiers
load() {
    if (this.deferredLoaded) return this.deferredLoaded
    this.deferredLoaded = $.Deferred()
    let treeNodes = buildTree(this.widget.options.breedingAPIEndpoint)
    $.when(
      this.treeReady(), treeNodes
    ).then((treeReady, nodes) => {
      let language = LangUtils.getInitialLanguageCode()
      let allNodeIds = []
      for (let node of nodes) {
        allNodeIds.push(node.id)
        node['text'] = getNodeText(node, language)
        this.jstree.create_node(node.parent, node)
      }
      this.deferredLoaded.resolve(allNodeIds)
      this.allNodeIds = allNodeIds
      let langs = Arrays.distinct(
        $.map(nodes, n => Object.getOwnPropertyNames(n.data))
      )
      if (langs.length > 1){
        this.displayLanguageSelector(langs)
      }
    })
    return this.deferredLoaded
  }
load ( ) { if ( this . deferredLoaded ) return this . deferredLoaded this . deferredLoaded = $ . Deferred ( ) let treeNodes = buildTree ( this . widget . options . breedingAPIEndpoint ) $ . when ( this . treeReady ( ) , treeNodes ) . then ( ( treeReady , nodes ) => { let language = LangUtils . getInitialLanguageCode ( ) let allNodeIds = [ ] for ( let node of nodes ) { allNodeIds . push ( node . id ) node [ 'text' ] = getNodeText ( node , language ) this . jstree . create_node ( node . parent , node ) } this . deferredLoaded . resolve ( allNodeIds ) this . allNodeIds = allNodeIds let langs = Arrays . distinct ( $ . map ( nodes , n => Object . getOwnPropertyNames ( n . data ) ) ) if ( langs . length > 1 ) { this . displayLanguageSelector ( langs ) } } ) return this . deferredLoaded }
Load tree data
 @returns Deferred list of all node identifiers
Load tree data @returns Deferred list of all node identifiers
// Wait for jstree and TreeBuilder results // Initialize the tree builder // Generate text // Add node to tree // Regroup all languages // Show language selector if there is more than one language