3 namespace Drupal\Core\Field\Annotation;
5 use Drupal\Component\Annotation\Plugin;
8 * Defines a FieldWidget annotation object.
10 * Widgets handle how fields are displayed in edit forms.
12 * Additional annotation keys for widgets can be defined in
13 * hook_field_widget_info_alter().
17 * @see \Drupal\Core\Field\WidgetPluginManager
18 * @see \Drupal\Core\Field\WidgetInterface
20 * @ingroup field_widget
22 class FieldWidget extends Plugin {
32 * The human-readable name of the widget type.
34 * @ingroup plugin_translatable
36 * @var \Drupal\Core\Annotation\Translation
41 * A short description of the widget type.
43 * @ingroup plugin_translatable
45 * @var \Drupal\Core\Annotation\Translation
50 * The name of the widget class.
52 * This is not provided manually, it will be added by the discovery mechanism.
59 * An array of field types the widget supports.
63 public $field_types = [];
66 * Does the field widget handles multiple values at once.
70 public $multiple_values = FALSE;
73 * An integer to determine the weight of this widget relative to other widgets
74 * in the Field UI when selecting a widget for a given field.
78 public $weight = NULL;