You are here

interface WidgetSelectorInterface in Entity Browser 8.2

Same name and namespace in other branches
  1. 8 src/WidgetSelectorInterface.php \Drupal\entity_browser\WidgetSelectorInterface

Defines the interface for entity browser widget selectors.

This plugin type is responsible for providing ways for users to select the current widget used for selecting entities in an entity browser. For example, if the user wants to tab between widgets, the tab set will be created and managed by the widget selector.

Hierarchy

Expanded class hierarchy of WidgetSelectorInterface

All classes that implement WidgetSelectorInterface

1 file declares its use of WidgetSelectorInterface
EntityBrowserTest.php in tests/src/Kernel/Extension/EntityBrowserTest.php

File

src/WidgetSelectorInterface.php, line 19

Namespace

Drupal\entity_browser
View source
interface WidgetSelectorInterface extends PluginInspectionInterface, ConfigurableInterface, PluginFormInterface, DependentPluginInterface {

  /**
   * Returns the widget selector label.
   *
   * @return string
   *   The widget label.
   */
  public function label();

  /**
   * Returns widget selector form.
   *
   * @return array
   *   Form structure.
   */
  public function getForm(array &$form, FormStateInterface &$form_state);

  /**
   * Sets the default widget.
   *
   * @param string $widget
   *   Id of widget to set as the current widget.
   */
  public function setDefaultWidget($widget);

  /**
   * Validates form.
   *
   * @param array $form
   *   Form.
   * @param \Drupal\Core\Form\FormStateInterface $form_state
   *   Form state object.
   */
  public function validate(array &$form, FormStateInterface $form_state);

  /**
   * Submits form.
   *
   * @param array $form
   *   Form.
   * @param \Drupal\Core\Form\FormStateInterface $form_state
   *   Form state object.
   *
   * @return string
   *   The selected widget ID.
   */
  public function submit(array &$form, FormStateInterface $form_state);

}

Members

Namesort descending Modifiers Type Description Overrides
ConfigurableInterface::defaultConfiguration public function Gets default configuration for this plugin. 11
ConfigurableInterface::getConfiguration public function Gets this plugin's configuration. 12
ConfigurableInterface::setConfiguration public function Sets the configuration for this plugin instance. 12
DependentPluginInterface::calculateDependencies public function Calculates dependencies for the configured plugin. 19
PluginFormInterface::buildConfigurationForm public function Form constructor. 36
PluginFormInterface::submitConfigurationForm public function Form submission handler. 32
PluginFormInterface::validateConfigurationForm public function Form validation handler. 18
PluginInspectionInterface::getPluginDefinition public function Gets the definition of the plugin implementation. 4
PluginInspectionInterface::getPluginId public function Gets the plugin_id of the plugin instance. 2
WidgetSelectorInterface::getForm public function Returns widget selector form. 3
WidgetSelectorInterface::label public function Returns the widget selector label. 1
WidgetSelectorInterface::setDefaultWidget public function Sets the default widget. 1
WidgetSelectorInterface::submit public function Submits form. 1
WidgetSelectorInterface::validate public function Validates form. 1