3 namespace Drupal\entity_browser;
5 use Drupal\Component\Plugin\ConfigurablePluginInterface;
6 use Drupal\Component\Plugin\PluginInspectionInterface;
7 use Drupal\Core\Form\FormStateInterface;
8 use Drupal\Core\Plugin\PluginFormInterface;
11 * Defines the interface for entity browser selection displays.
13 * This plugin type is responsible for displaying the currently selected
14 * entities in an entity browser and delivering them upstream. The selections
15 * are displayed in a form which delivers the selected entities on submit.
17 interface SelectionDisplayInterface extends PluginInspectionInterface, ConfigurablePluginInterface, PluginFormInterface {
20 * Returns the selection display label.
23 * The selection display label.
25 public function label();
28 * Returns selection display form.
30 * @param array $original_form
31 * Entire form built up to this point. Form elements for selection display
32 * should generally not be added directly to it but returned from function
33 * as a separated unit.
34 * @param \Drupal\Core\Form\FormStateInterface $form_state
40 public function getForm(array &$original_form, FormStateInterface $form_state);
47 * @param \Drupal\Core\Form\FormStateInterface $form_state
50 public function validate(array &$form, FormStateInterface $form_state);
57 * @param \Drupal\Core\Form\FormStateInterface $form_state
60 public function submit(array &$form, FormStateInterface $form_state);
63 * Check does selection display support preselection.
65 * If preselection is not allowed by entity browser selection display, then
66 * exception will be thrown.
68 * @throws \Drupal\Core\Config\ConfigException
70 public function checkPreselectionSupport();
73 * Returns true if selection display supports selection over javascript.
76 * True if javascript add/remove events are supported.
78 public function supportsJsCommands();