/**
  * {@inheritdoc}
  */
 public function settingsForm(array $form, FormStateInterface $form_state)
 {
     $element = parent::settingsForm($form, $form_state);
     $labels = $this->labels();
     $states_prefix = 'fields[' . $this->fieldDefinition->getName() . '][settings_edit_form][settings]';
     $element['allow_new'] = ['#type' => 'checkbox', '#title' => $this->t('Allow users to add new @label.', array('@label' => $labels['plural'])), '#default_value' => $this->getSetting('allow_new')];
     $element['allow_existing'] = ['#type' => 'checkbox', '#title' => $this->t('Allow users to add existing @label.', ['@label' => $labels['plural']]), '#default_value' => $this->getSetting('allow_existing')];
     $element['match_operator'] = ['#type' => 'select', '#title' => $this->t('Autocomplete matching'), '#default_value' => $this->getSetting('match_operator'), '#options' => $this->getMatchOperatorOptions(), '#description' => $this->t('Select the method used to collect autocomplete suggestions. Note that <em>Contains</em> can cause performance issues on sites with thousands of nodes.'), '#states' => ['visible' => [':input[name="' . $states_prefix . '[allow_existing]"]' => array('checked' => TRUE)]]];
     return $element;
 }