getCommandState (params, context) {
    const sel = params.selection
    // We can skip all checking if a disabled condition is met
    // E.g. we don't allow toggling of property annotations when current
    // selection is a container selection
    if (this.isDisabled(sel, params, context)) {
      return {
        disabled: true
      }
    }
    const annos = this._getAnnotationsForSelection(params)
    const newState = {
      disabled: false,
      active: false,
      mode: null
    }
    if (this.canCreate(annos, sel, context)) {
      newState.mode = 'create'
    } else if (this.canFuse(annos, sel)) {
      newState.mode = 'fuse'
    } else if (this.canTruncate(annos, sel)) {
      newState.active = true
      newState.mode = 'truncate'
    } else if (this.canExpand(annos, sel)) {
      newState.mode = 'expand'
    } else if (this.canDelete(annos, sel)) {
      newState.active = true
      newState.mode = 'delete'
    } else {
      newState.disabled = true
    }
    newState.showInContext = this.showInContext(sel, params, context)

    return newState
  }
Gets command state object.

    @param {Object} state.selection the current selection
    @returns {Object} info object with command details.