diff --git a/core/modules/datetime/lib/Drupal/datetime/Plugin/field/formatter/DatetimeDefaultFormatter.php b/core/modules/datetime/lib/Drupal/datetime/Plugin/field/formatter/DatetimeDefaultFormatter.php index d5610f3..54db1c3 100644 --- a/core/modules/datetime/lib/Drupal/datetime/Plugin/field/formatter/DatetimeDefaultFormatter.php +++ b/core/modules/datetime/lib/Drupal/datetime/Plugin/field/formatter/DatetimeDefaultFormatter.php @@ -7,7 +7,7 @@ namespace Drupal\datetime\Plugin\field\formatter; -use Drupal\Component\Annotation\Plugin; +use Drupal\field\Annotation\FieldFormatter; use Drupal\Core\Annotation\Translation; use Drupal\field\Plugin\Type\Formatter\FormatterBase; use Drupal\Core\Entity\EntityInterface; @@ -17,7 +17,7 @@ /** * Plugin implementation of the 'datetime_default' formatter. * - * @Plugin( + * @FieldFormatter( * id = "datetime_default", * module = "datetime", * label = @Translation("Default"), diff --git a/core/modules/datetime/lib/Drupal/datetime/Plugin/field/formatter/DatetimePlainFormatter.php b/core/modules/datetime/lib/Drupal/datetime/Plugin/field/formatter/DatetimePlainFormatter.php index 45a85a2..ac2313a 100644 --- a/core/modules/datetime/lib/Drupal/datetime/Plugin/field/formatter/DatetimePlainFormatter.php +++ b/core/modules/datetime/lib/Drupal/datetime/Plugin/field/formatter/DatetimePlainFormatter.php @@ -7,7 +7,7 @@ namespace Drupal\datetime\Plugin\field\formatter; -use Drupal\Component\Annotation\Plugin; +use Drupal\field\Annotation\FieldFormatter; use Drupal\Core\Annotation\Translation; use Drupal\field\Plugin\Type\Formatter\FormatterBase; use Drupal\Core\Entity\EntityInterface; @@ -16,7 +16,7 @@ /** * Plugin implementation of the 'datetime_plain' formatter. * - * @Plugin( + * @FieldFormatter( * id = "datetime_plain", * module = "datetime", * label = @Translation("Plain"), diff --git a/core/modules/edit/edit.module b/core/modules/edit/edit.module index 5b11560..7b6d8c4 100644 --- a/core/modules/edit/edit.module +++ b/core/modules/edit/edit.module @@ -128,6 +128,23 @@ function edit_library_info() { } /** + * Implements hook_field_formatter_info_alter(). + * + * Edit extends the @FieldFormatter annotation with the following keys: + * - edit: currently only contains one subkey 'editor' which indicates which + * in-place editor should be used. Possible values are 'form', 'direct' or + * 'disabled'. + */ +function edit_field_formatter_info_alter(&$info) { + foreach ($info as $key => $settings) { + // Set in-place editor to form if none is supplied. + if (empty($settings['edit'])) { + $info[$key]['edit'] = array('editor' => 'form'); + } + } +} + +/** * Implements hook_preprocess_HOOK() for field.tpl.php. */ function edit_preprocess_field(&$variables) { diff --git a/core/modules/edit/lib/Drupal/edit/EditorSelector.php b/core/modules/edit/lib/Drupal/edit/EditorSelector.php index c42cb02..232a52f 100644 --- a/core/modules/edit/lib/Drupal/edit/EditorSelector.php +++ b/core/modules/edit/lib/Drupal/edit/EditorSelector.php @@ -63,7 +63,7 @@ public function getEditor($formatter_type, FieldInstance $instance, array $items // 'form' editor, since that can work for any field. Formatter definitions // can use 'disabled' to explicitly opt out of in-place editing. $formatter_info = field_info_formatter_types($formatter_type); - $editor_id = isset($formatter_info['edit']['editor']) ? $formatter_info['edit']['editor'] : 'form'; + $editor_id = $formatter_info['edit']['editor']; if ($editor_id === 'disabled') { return; } diff --git a/core/modules/email/lib/Drupal/email/Plugin/field/formatter/MailToFormatter.php b/core/modules/email/lib/Drupal/email/Plugin/field/formatter/MailToFormatter.php index d28eaab..33e5920 100644 --- a/core/modules/email/lib/Drupal/email/Plugin/field/formatter/MailToFormatter.php +++ b/core/modules/email/lib/Drupal/email/Plugin/field/formatter/MailToFormatter.php @@ -7,7 +7,7 @@ namespace Drupal\email\Plugin\field\formatter; -use Drupal\Component\Annotation\Plugin; +use Drupal\field\Annotation\FieldFormatter; use Drupal\Core\Annotation\Translation; use Drupal\field\Plugin\Type\Formatter\FormatterBase; use Drupal\Core\Entity\EntityInterface; @@ -15,7 +15,7 @@ /** * Plugin implementation of the 'email_mailto' formatter. * - * @Plugin( + * @FieldFormatter( * id = "email_mailto", * module = "email", * label = @Translation("Email"), diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/field/formatter/EntityReferenceEntityFormatter.php b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/field/formatter/EntityReferenceEntityFormatter.php index 647de08..01db464 100644 --- a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/field/formatter/EntityReferenceEntityFormatter.php +++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/field/formatter/EntityReferenceEntityFormatter.php @@ -7,7 +7,7 @@ namespace Drupal\entity_reference\Plugin\field\formatter; -use Drupal\Component\Annotation\Plugin; +use Drupal\field\Annotation\FieldFormatter; use Drupal\Core\Annotation\Translation; use Drupal\Core\Entity\EntityInterface; use Drupal\entity_reference\RecursiveRenderingException; @@ -16,7 +16,7 @@ /** * Plugin implementation of the 'entity reference rendered entity' formatter. * - * @Plugin( + * @FieldFormatter( * id = "entity_reference_entity_view", * module = "entity_reference", * label = @Translation("Rendered entity"), diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/field/formatter/EntityReferenceFormatterBase.php b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/field/formatter/EntityReferenceFormatterBase.php index b360a79..f3afdb1 100644 --- a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/field/formatter/EntityReferenceFormatterBase.php +++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/field/formatter/EntityReferenceFormatterBase.php @@ -7,7 +7,7 @@ namespace Drupal\entity_reference\Plugin\field\formatter; -use Drupal\Component\Annotation\Plugin; +use Drupal\field\Annotation\FieldFormatter; use Drupal\Core\Annotation\Translation; use Drupal\Core\Entity\EntityInterface; use Drupal\field\Plugin\Type\Formatter\FormatterBase; diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/field/formatter/EntityReferenceIdFormatter.php b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/field/formatter/EntityReferenceIdFormatter.php index fc6dcfc..6136c5c 100644 --- a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/field/formatter/EntityReferenceIdFormatter.php +++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/field/formatter/EntityReferenceIdFormatter.php @@ -7,7 +7,7 @@ namespace Drupal\entity_reference\Plugin\field\formatter; -use Drupal\Component\Annotation\Plugin; +use Drupal\field\Annotation\FieldFormatter; use Drupal\Core\Annotation\Translation; use Drupal\Core\Entity\EntityInterface; use Drupal\entity_reference\Plugin\field\formatter\EntityReferenceFormatterBase; @@ -15,7 +15,7 @@ /** * Plugin implementation of the 'entity reference ID' formatter. * - * @Plugin( + * @FieldFormatter( * id = "entity_reference_entity_id", * module = "entity_reference", * label = @Translation("Entity ID"), diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/field/formatter/EntityReferenceLabelFormatter.php b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/field/formatter/EntityReferenceLabelFormatter.php index 499edc7..6be8da3 100644 --- a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/field/formatter/EntityReferenceLabelFormatter.php +++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/field/formatter/EntityReferenceLabelFormatter.php @@ -7,7 +7,7 @@ namespace Drupal\entity_reference\Plugin\field\formatter; -use Drupal\Component\Annotation\Plugin; +use Drupal\field\Annotation\FieldFormatter; use Drupal\Core\Annotation\Translation; use Drupal\Core\Entity\EntityInterface; use Drupal\entity_reference\Plugin\field\formatter\EntityReferenceFormatterBase; @@ -15,7 +15,7 @@ /** * Plugin implementation of the 'entity reference label' formatter. * - * @Plugin( + * @FieldFormatter( * id = "entity_reference_label", * module = "entity_reference", * label = @Translation("Label"), diff --git a/core/modules/field/lib/Drupal/field/Annotation/FieldFormatter.php b/core/modules/field/lib/Drupal/field/Annotation/FieldFormatter.php new file mode 100644 index 0000000..f72b2e0 --- /dev/null +++ b/core/modules/field/lib/Drupal/field/Annotation/FieldFormatter.php @@ -0,0 +1,85 @@ +discovery->getDefinition($plugin_id); - $plugin_class = static::getPluginClass($plugin_id, $plugin_definition); - return new $plugin_class($plugin_id, $plugin_definition, $configuration['instance'], $configuration['settings'], $configuration['label'], $configuration['view_mode']); - } -} diff --git a/core/modules/field/lib/Drupal/field/Plugin/Type/Formatter/FormatterPluginManager.php b/core/modules/field/lib/Drupal/field/Plugin/Type/Formatter/FormatterPluginManager.php index 2260610..5d5d7e6 100644 --- a/core/modules/field/lib/Drupal/field/Plugin/Type/Formatter/FormatterPluginManager.php +++ b/core/modules/field/lib/Drupal/field/Plugin/Type/Formatter/FormatterPluginManager.php @@ -8,7 +8,7 @@ namespace Drupal\field\Plugin\Type\Formatter; use Drupal\Component\Plugin\PluginManagerBase; -use Drupal\Component\Plugin\Discovery\ProcessDecorator; +use Drupal\Component\Plugin\Factory\DefaultFactory; use Drupal\Core\Plugin\Discovery\CacheDecorator; use Drupal\Core\Plugin\Discovery\AnnotatedClassDiscovery; use Drupal\Core\Plugin\Discovery\AlterDecorator; @@ -20,14 +20,6 @@ class FormatterPluginManager extends PluginManagerBase { /** - * Overrides Drupal\Component\Plugin\PluginManagerBase:$defaults. - */ - protected $defaults = array( - 'field_types' => array(), - 'settings' => array(), - ); - - /** * Constructs a FormatterPluginManager object. * * @param \Traversable $namespaces @@ -35,12 +27,19 @@ class FormatterPluginManager extends PluginManagerBase { * keyed by the corresponding namespace to look for plugin implementations, */ public function __construct(\Traversable $namespaces) { - $this->discovery = new AnnotatedClassDiscovery('field/formatter', $namespaces); - $this->discovery = new ProcessDecorator($this->discovery, array($this, 'processDefinition')); + $annotation_namespaces = array('Drupal\field\Annotation' => $namespaces['Drupal\field']); + $this->discovery = new AnnotatedClassDiscovery('field/formatter', $namespaces, $annotation_namespaces, 'Drupal\field\Annotation\FieldFormatter'); $this->discovery = new AlterDecorator($this->discovery, 'field_formatter_info'); $this->discovery = new CacheDecorator($this->discovery, 'field_formatter_types', 'field'); + } - $this->factory = new FormatterFactory($this->discovery); + /** + * {@inheritdoc} + */ + public function createInstance($plugin_id, array $configuration) { + $plugin_definition = $this->discovery->getDefinition($plugin_id); + $plugin_class = DefaultFactory::getPluginClass($plugin_id, $plugin_definition); + return new $plugin_class($plugin_id, $plugin_definition, $configuration['instance'], $configuration['settings'], $configuration['label'], $configuration['view_mode']); } /** diff --git a/core/modules/field/tests/modules/field_test/lib/Drupal/field_test/Plugin/field/formatter/TestFieldDefaultFormatter.php b/core/modules/field/tests/modules/field_test/lib/Drupal/field_test/Plugin/field/formatter/TestFieldDefaultFormatter.php index a42ea78..4e1f59a 100644 --- a/core/modules/field/tests/modules/field_test/lib/Drupal/field_test/Plugin/field/formatter/TestFieldDefaultFormatter.php +++ b/core/modules/field/tests/modules/field_test/lib/Drupal/field_test/Plugin/field/formatter/TestFieldDefaultFormatter.php @@ -7,7 +7,7 @@ namespace Drupal\field_test\Plugin\field\formatter; -use Drupal\Component\Annotation\Plugin; +use Drupal\field\Annotation\FieldFormatter; use Drupal\Core\Annotation\Translation; use Drupal\field\Plugin\Type\Formatter\FormatterBase; use Drupal\Core\Entity\EntityInterface; @@ -15,7 +15,7 @@ /** * Plugin implementation of the 'field_test_default' formatter. * - * @Plugin( + * @FieldFormatter( * id = "field_test_default", * module = "field_test", * label = @Translation("Default"), diff --git a/core/modules/field/tests/modules/field_test/lib/Drupal/field_test/Plugin/field/formatter/TestFieldEmptyFormatter.php b/core/modules/field/tests/modules/field_test/lib/Drupal/field_test/Plugin/field/formatter/TestFieldEmptyFormatter.php index 9632420..df71b16 100644 --- a/core/modules/field/tests/modules/field_test/lib/Drupal/field_test/Plugin/field/formatter/TestFieldEmptyFormatter.php +++ b/core/modules/field/tests/modules/field_test/lib/Drupal/field_test/Plugin/field/formatter/TestFieldEmptyFormatter.php @@ -7,7 +7,7 @@ */ namespace Drupal\field_test\Plugin\field\formatter; -use Drupal\Component\Annotation\Plugin; +use Drupal\field\Annotation\FieldFormatter; use Drupal\Core\Annotation\Translation; use Drupal\Core\Entity\EntityInterface; use Drupal\field\Plugin\Type\Formatter\FormatterBase; @@ -15,7 +15,7 @@ /** * Plugin implementation of the 'field_empty_test' formatter. * - * @Plugin( + * @FieldFormatter( * id = "field_empty_test", * module = "field_test", * label = @Translation("Field empty test"), diff --git a/core/modules/field/tests/modules/field_test/lib/Drupal/field_test/Plugin/field/formatter/TestFieldMultipleFormatter.php b/core/modules/field/tests/modules/field_test/lib/Drupal/field_test/Plugin/field/formatter/TestFieldMultipleFormatter.php index f2aad3b..2810e09 100644 --- a/core/modules/field/tests/modules/field_test/lib/Drupal/field_test/Plugin/field/formatter/TestFieldMultipleFormatter.php +++ b/core/modules/field/tests/modules/field_test/lib/Drupal/field_test/Plugin/field/formatter/TestFieldMultipleFormatter.php @@ -7,7 +7,7 @@ namespace Drupal\field_test\Plugin\field\formatter; -use Drupal\Component\Annotation\Plugin; +use Drupal\field\Annotation\FieldFormatter; use Drupal\Core\Annotation\Translation; use Drupal\field\Plugin\Type\Formatter\FormatterBase; use Drupal\Core\Entity\EntityInterface; @@ -15,7 +15,7 @@ /** * Plugin implementation of the 'field_test_multiple' formatter. * - * @Plugin( + * @FieldFormatter( * id = "field_test_multiple", * module = "field_test", * label = @Translation("Multiple"), diff --git a/core/modules/field/tests/modules/field_test/lib/Drupal/field_test/Plugin/field/formatter/TestFieldPrepareViewFormatter.php b/core/modules/field/tests/modules/field_test/lib/Drupal/field_test/Plugin/field/formatter/TestFieldPrepareViewFormatter.php index 8e6ad38..ad0ea47 100644 --- a/core/modules/field/tests/modules/field_test/lib/Drupal/field_test/Plugin/field/formatter/TestFieldPrepareViewFormatter.php +++ b/core/modules/field/tests/modules/field_test/lib/Drupal/field_test/Plugin/field/formatter/TestFieldPrepareViewFormatter.php @@ -7,7 +7,7 @@ namespace Drupal\field_test\Plugin\field\formatter; -use Drupal\Component\Annotation\Plugin; +use Drupal\field\Annotation\FieldFormatter; use Drupal\Core\Annotation\Translation; use Drupal\field\Plugin\Type\Formatter\FormatterBase; use Drupal\Core\Entity\EntityInterface; @@ -15,7 +15,7 @@ /** * Plugin implementation of the 'field_test_with_prepare_view' formatter. * - * @Plugin( + * @FieldFormatter( * id = "field_test_with_prepare_view", * module = "field_test", * label = @Translation("With prepare step"), diff --git a/core/modules/file/lib/Drupal/file/Plugin/field/formatter/GenericFileFormatter.php b/core/modules/file/lib/Drupal/file/Plugin/field/formatter/GenericFileFormatter.php index c99bcfe..02d003e 100644 --- a/core/modules/file/lib/Drupal/file/Plugin/field/formatter/GenericFileFormatter.php +++ b/core/modules/file/lib/Drupal/file/Plugin/field/formatter/GenericFileFormatter.php @@ -7,7 +7,7 @@ namespace Drupal\file\Plugin\field\formatter; -use Drupal\Component\Annotation\Plugin; +use Drupal\field\Annotation\FieldFormatter; use Drupal\Core\Annotation\Translation; use Drupal\field\Plugin\Type\Formatter\FormatterBase; use Drupal\Core\Entity\EntityInterface; @@ -15,7 +15,7 @@ /** * Plugin implementation of the 'file_default' formatter. * - * @Plugin( + * @FieldFormatter( * id = "file_default", * module = "file", * label = @Translation("Generic file"), diff --git a/core/modules/file/lib/Drupal/file/Plugin/field/formatter/RSSEnclosureFormatter.php b/core/modules/file/lib/Drupal/file/Plugin/field/formatter/RSSEnclosureFormatter.php index 16b872e..424df01 100644 --- a/core/modules/file/lib/Drupal/file/Plugin/field/formatter/RSSEnclosureFormatter.php +++ b/core/modules/file/lib/Drupal/file/Plugin/field/formatter/RSSEnclosureFormatter.php @@ -7,7 +7,7 @@ namespace Drupal\file\Plugin\field\formatter; -use Drupal\Component\Annotation\Plugin; +use Drupal\field\Annotation\FieldFormatter; use Drupal\Core\Annotation\Translation; use Drupal\field\Plugin\Type\Formatter\FormatterBase; use Drupal\Core\Entity\EntityInterface; @@ -15,7 +15,7 @@ /** * Plugin implementation of the 'file_rss_enclosure' formatter. * - * @Plugin( + * @FieldFormatter( * id = "file_rss_enclosure", * module = "file", * label = @Translation("RSS enclosure"), diff --git a/core/modules/file/lib/Drupal/file/Plugin/field/formatter/TableFormatter.php b/core/modules/file/lib/Drupal/file/Plugin/field/formatter/TableFormatter.php index 77c5a37..cc7a57d 100644 --- a/core/modules/file/lib/Drupal/file/Plugin/field/formatter/TableFormatter.php +++ b/core/modules/file/lib/Drupal/file/Plugin/field/formatter/TableFormatter.php @@ -7,7 +7,7 @@ namespace Drupal\file\Plugin\field\formatter; -use Drupal\Component\Annotation\Plugin; +use Drupal\field\Annotation\FieldFormatter; use Drupal\Core\Annotation\Translation; use Drupal\field\Plugin\Type\Formatter\FormatterBase; use Drupal\Core\Entity\EntityInterface; @@ -15,7 +15,7 @@ /** * Plugin implementation of the 'file_table' formatter. * - * @Plugin( + * @FieldFormatter( * id = "file_table", * module = "file", * label = @Translation("Table of files"), diff --git a/core/modules/file/lib/Drupal/file/Plugin/field/formatter/UrlPlainFormatter.php b/core/modules/file/lib/Drupal/file/Plugin/field/formatter/UrlPlainFormatter.php index fdecddc..7edf940 100644 --- a/core/modules/file/lib/Drupal/file/Plugin/field/formatter/UrlPlainFormatter.php +++ b/core/modules/file/lib/Drupal/file/Plugin/field/formatter/UrlPlainFormatter.php @@ -7,7 +7,7 @@ namespace Drupal\file\Plugin\field\formatter; -use Drupal\Component\Annotation\Plugin; +use Drupal\field\Annotation\FieldFormatter; use Drupal\Core\Annotation\Translation; use Drupal\field\Plugin\Type\Formatter\FormatterBase; use Drupal\Core\Entity\EntityInterface; @@ -15,7 +15,7 @@ /** * Plugin implementation of the 'file_url_plain' formatter. * - * @Plugin( + * @FieldFormatter( * id = "file_url_plain", * module = "file", * label = @Translation("URL to file"), diff --git a/core/modules/image/lib/Drupal/image/Plugin/field/formatter/ImageFormatter.php b/core/modules/image/lib/Drupal/image/Plugin/field/formatter/ImageFormatter.php index 3edb751..1f8405e 100644 --- a/core/modules/image/lib/Drupal/image/Plugin/field/formatter/ImageFormatter.php +++ b/core/modules/image/lib/Drupal/image/Plugin/field/formatter/ImageFormatter.php @@ -7,7 +7,7 @@ namespace Drupal\image\Plugin\field\formatter; -use Drupal\Component\Annotation\Plugin; +use Drupal\field\Annotation\FieldFormatter; use Drupal\Core\Annotation\Translation; use Drupal\field\Plugin\Type\Formatter\FormatterBase; use Drupal\Core\Entity\EntityInterface; @@ -15,7 +15,7 @@ /** * Plugin implementation of the 'image' formatter. * - * @Plugin( + * @FieldFormatter( * id = "image", * module = "image", * label = @Translation("Image"), diff --git a/core/modules/link/lib/Drupal/link/Plugin/field/formatter/LinkFormatter.php b/core/modules/link/lib/Drupal/link/Plugin/field/formatter/LinkFormatter.php index 123eded..36ee3ba 100644 --- a/core/modules/link/lib/Drupal/link/Plugin/field/formatter/LinkFormatter.php +++ b/core/modules/link/lib/Drupal/link/Plugin/field/formatter/LinkFormatter.php @@ -7,7 +7,7 @@ namespace Drupal\link\Plugin\field\formatter; -use Drupal\Component\Annotation\Plugin; +use Drupal\field\Annotation\FieldFormatter; use Drupal\Core\Annotation\Translation; use Drupal\Core\Entity\EntityInterface; use Drupal\field\Plugin\Type\Formatter\FormatterBase; @@ -15,7 +15,7 @@ /** * Plugin implementation of the 'link' formatter. * - * @Plugin( + * @FieldFormatter( * id = "link", * module = "link", * label = @Translation("Link"), diff --git a/core/modules/link/lib/Drupal/link/Plugin/field/formatter/LinkSeparateFormatter.php b/core/modules/link/lib/Drupal/link/Plugin/field/formatter/LinkSeparateFormatter.php index b2d3882..c8c78a6 100644 --- a/core/modules/link/lib/Drupal/link/Plugin/field/formatter/LinkSeparateFormatter.php +++ b/core/modules/link/lib/Drupal/link/Plugin/field/formatter/LinkSeparateFormatter.php @@ -12,7 +12,7 @@ namespace Drupal\link\Plugin\field\formatter; -use Drupal\Component\Annotation\Plugin; +use Drupal\field\Annotation\FieldFormatter; use Drupal\Core\Annotation\Translation; use Drupal\Core\Entity\EntityInterface; use Drupal\field\Plugin\Type\Formatter\FormatterBase; @@ -20,7 +20,7 @@ /** * Plugin implementation of the 'link_separate' formatter. * - * @Plugin( + * @FieldFormatter( * id = "link_separate", * module = "link", * label = @Translation("Separate title and URL"), diff --git a/core/modules/number/lib/Drupal/number/Plugin/field/formatter/DefaultNumberFormatter.php b/core/modules/number/lib/Drupal/number/Plugin/field/formatter/DefaultNumberFormatter.php index 86b4aa1..8188dc1 100644 --- a/core/modules/number/lib/Drupal/number/Plugin/field/formatter/DefaultNumberFormatter.php +++ b/core/modules/number/lib/Drupal/number/Plugin/field/formatter/DefaultNumberFormatter.php @@ -7,7 +7,7 @@ namespace Drupal\number\Plugin\field\formatter; -use Drupal\Component\Annotation\Plugin; +use Drupal\field\Annotation\FieldFormatter; use Drupal\Core\Annotation\Translation; use Drupal\field\Plugin\Type\Formatter\FormatterBase; use Drupal\Core\Entity\EntityInterface; diff --git a/core/modules/number/lib/Drupal/number/Plugin/field/formatter/NumberDecimalFormatter.php b/core/modules/number/lib/Drupal/number/Plugin/field/formatter/NumberDecimalFormatter.php index 048e9c2..41f075d 100644 --- a/core/modules/number/lib/Drupal/number/Plugin/field/formatter/NumberDecimalFormatter.php +++ b/core/modules/number/lib/Drupal/number/Plugin/field/formatter/NumberDecimalFormatter.php @@ -7,7 +7,7 @@ namespace Drupal\number\Plugin\field\formatter; -use Drupal\Component\Annotation\Plugin; +use Drupal\field\Annotation\FieldFormatter; use Drupal\Core\Annotation\Translation; use Drupal\field\Plugin\Type\Formatter\FormatterBase; use Drupal\number\Plugin\field\formatter\DefaultNumberFormatter; @@ -20,7 +20,7 @@ * for decimal and float fields on the other hand, in order to be able to use * different settings. * - * @Plugin( + * @FieldFormatter( * id = "number_decimal", * module = "number", * label = @Translation("Default"), diff --git a/core/modules/number/lib/Drupal/number/Plugin/field/formatter/NumberIntegerFormatter.php b/core/modules/number/lib/Drupal/number/Plugin/field/formatter/NumberIntegerFormatter.php index 199c319..16f36ad 100644 --- a/core/modules/number/lib/Drupal/number/Plugin/field/formatter/NumberIntegerFormatter.php +++ b/core/modules/number/lib/Drupal/number/Plugin/field/formatter/NumberIntegerFormatter.php @@ -7,7 +7,7 @@ namespace Drupal\number\Plugin\field\formatter; -use Drupal\Component\Annotation\Plugin; +use Drupal\field\Annotation\FieldFormatter; use Drupal\Core\Annotation\Translation; use Drupal\field\Plugin\Type\Formatter\FormatterBase; use Drupal\number\Plugin\field\formatter\DefaultNumberFormatter; @@ -20,7 +20,7 @@ * for decimal and float fields on the other hand, in order to be able to use * different settings. * - * @Plugin( + * @FieldFormatter( * id = "number_integer", * module = "number", * label = @Translation("Default"), diff --git a/core/modules/number/lib/Drupal/number/Plugin/field/formatter/NumberUnformattedFormatter.php b/core/modules/number/lib/Drupal/number/Plugin/field/formatter/NumberUnformattedFormatter.php index 483abc1..b8a3653 100644 --- a/core/modules/number/lib/Drupal/number/Plugin/field/formatter/NumberUnformattedFormatter.php +++ b/core/modules/number/lib/Drupal/number/Plugin/field/formatter/NumberUnformattedFormatter.php @@ -7,7 +7,7 @@ namespace Drupal\number\Plugin\field\formatter; -use Drupal\Component\Annotation\Plugin; +use Drupal\field\Annotation\FieldFormatter; use Drupal\Core\Annotation\Translation; use Drupal\field\Plugin\Type\Formatter\FormatterBase; use Drupal\Core\Entity\EntityInterface; @@ -15,7 +15,7 @@ /** * Plugin implementation of the 'number_unformatted' formatter. * - * @Plugin( + * @FieldFormatter( * id = "number_unformatted", * module = "number", * label = @Translation("Unformatted"), diff --git a/core/modules/options/lib/Drupal/options/Plugin/field/formatter/OptionsDefaultFormatter.php b/core/modules/options/lib/Drupal/options/Plugin/field/formatter/OptionsDefaultFormatter.php index 01b4efb..b7f5402 100644 --- a/core/modules/options/lib/Drupal/options/Plugin/field/formatter/OptionsDefaultFormatter.php +++ b/core/modules/options/lib/Drupal/options/Plugin/field/formatter/OptionsDefaultFormatter.php @@ -7,7 +7,7 @@ namespace Drupal\options\Plugin\field\formatter; -use Drupal\Component\Annotation\Plugin; +use Drupal\field\Annotation\FieldFormatter; use Drupal\Core\Annotation\Translation; use Drupal\field\Plugin\Type\Formatter\FormatterBase; use Drupal\Core\Entity\EntityInterface; @@ -15,7 +15,7 @@ /** * Plugin implementation of the 'list_default' formatter. * - * @Plugin( + * @FieldFormatter( * id = "list_default", * module = "options", * label = @Translation("Default"), diff --git a/core/modules/options/lib/Drupal/options/Plugin/field/formatter/OptionsKeyFormatter.php b/core/modules/options/lib/Drupal/options/Plugin/field/formatter/OptionsKeyFormatter.php index 94b076f..de62b57 100644 --- a/core/modules/options/lib/Drupal/options/Plugin/field/formatter/OptionsKeyFormatter.php +++ b/core/modules/options/lib/Drupal/options/Plugin/field/formatter/OptionsKeyFormatter.php @@ -7,7 +7,7 @@ namespace Drupal\options\Plugin\field\formatter; -use Drupal\Component\Annotation\Plugin; +use Drupal\field\Annotation\FieldFormatter; use Drupal\Core\Annotation\Translation; use Drupal\field\Plugin\Type\Formatter\FormatterBase; use Drupal\Core\Entity\EntityInterface; @@ -15,7 +15,7 @@ /** * Plugin implementation of the 'list_key' formatter. * - * @Plugin( + * @FieldFormatter( * id = "list_key", * module = "options", * label = @Translation("Key"), diff --git a/core/modules/picture/lib/Drupal/picture/Plugin/field/formatter/PictureFormatter.php b/core/modules/picture/lib/Drupal/picture/Plugin/field/formatter/PictureFormatter.php index c235b08..93ab7fc 100644 --- a/core/modules/picture/lib/Drupal/picture/Plugin/field/formatter/PictureFormatter.php +++ b/core/modules/picture/lib/Drupal/picture/Plugin/field/formatter/PictureFormatter.php @@ -7,7 +7,7 @@ namespace Drupal\picture\Plugin\field\formatter; -use Drupal\Component\Annotation\Plugin; +use Drupal\field\Annotation\FieldFormatter; use Drupal\Core\Annotation\Translation; use Drupal\field\Plugin\Type\Formatter\FormatterBase; use Drupal\Core\Entity\EntityInterface; @@ -15,7 +15,7 @@ /** * Plugin for picture formatter. * - * @Plugin( + * @FieldFormatter( * id = "picture", * module = "picture", * label = @Translation("Picture"), diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/field/formatter/EntityReferenceTaxonomyTermRssFormatter.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/field/formatter/EntityReferenceTaxonomyTermRssFormatter.php index c4cb3cf..eeb7437 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/field/formatter/EntityReferenceTaxonomyTermRssFormatter.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/field/formatter/EntityReferenceTaxonomyTermRssFormatter.php @@ -7,7 +7,7 @@ namespace Drupal\taxonomy\Plugin\field\formatter; -use Drupal\Component\Annotation\Plugin; +use Drupal\field\Annotation\FieldFormatter; use Drupal\Core\Annotation\Translation; use Drupal\Core\Entity\EntityInterface; use Drupal\entity_reference\Plugin\field\formatter\EntityReferenceFormatterBase; @@ -17,7 +17,7 @@ * * @todo: Have a way to indicate this formatter applies only to taxonomy terms. * - * @Plugin( + * @FieldFormatter( * id = "entity_reference_rss_category", * module = "taxonomy", * label = @Translation("RSS category"), diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/field/formatter/LinkFormatter.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/field/formatter/LinkFormatter.php index 7f92a88..63dbc0f 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/field/formatter/LinkFormatter.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/field/formatter/LinkFormatter.php @@ -7,7 +7,7 @@ namespace Drupal\taxonomy\Plugin\field\formatter; -use Drupal\Component\Annotation\Plugin; +use Drupal\field\Annotation\FieldFormatter; use Drupal\Core\Annotation\Translation; use Drupal\Core\Entity\EntityInterface; use Drupal\field\Plugin\Type\Formatter\FormatterBase; @@ -16,7 +16,7 @@ /** * Plugin implementation of the 'taxonomy_term_reference_link' formatter. * - * @Plugin( + * @FieldFormatter( * id = "taxonomy_term_reference_link", * module = "taxonomy", * label = @Translation("Link"), diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/field/formatter/PlainFormatter.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/field/formatter/PlainFormatter.php index 7e61c9c..0294cb4 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/field/formatter/PlainFormatter.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/field/formatter/PlainFormatter.php @@ -7,7 +7,7 @@ namespace Drupal\taxonomy\Plugin\field\formatter; -use Drupal\Component\Annotation\Plugin; +use Drupal\field\Annotation\FieldFormatter; use Drupal\Core\Annotation\Translation; use Drupal\Core\Entity\EntityInterface; use Drupal\field\Plugin\Type\Formatter\FormatterBase; @@ -16,7 +16,7 @@ /** * Plugin implementation of the 'taxonomy_term_reference_plain' formatter. * - * @Plugin( + * @FieldFormatter( * id = "taxonomy_term_reference_plain", * module = "taxonomy", * label = @Translation("Plain text"), diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/field/formatter/RSSCategoryFormatter.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/field/formatter/RSSCategoryFormatter.php index 5a96d53..e1cd48d 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/field/formatter/RSSCategoryFormatter.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/field/formatter/RSSCategoryFormatter.php @@ -7,7 +7,7 @@ namespace Drupal\taxonomy\Plugin\field\formatter; -use Drupal\Component\Annotation\Plugin; +use Drupal\field\Annotation\FieldFormatter; use Drupal\Core\Annotation\Translation; use Drupal\Core\Entity\EntityInterface; use Drupal\field\Plugin\Type\Formatter\FormatterBase; @@ -16,7 +16,7 @@ /** * Plugin implementation of the 'taxonomy_term_reference_rss_category' formatter. * - * @Plugin( + * @FieldFormatter( * id = "taxonomy_term_reference_rss_category", * module = "taxonomy", * label = @Translation("RSS category"), diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/field/formatter/TaxonomyFormatterBase.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/field/formatter/TaxonomyFormatterBase.php index f507137..95a1b76 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/field/formatter/TaxonomyFormatterBase.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/field/formatter/TaxonomyFormatterBase.php @@ -7,7 +7,7 @@ namespace Drupal\taxonomy\Plugin\field\formatter; -use Drupal\Component\Annotation\Plugin; +use Drupal\field\Annotation\FieldFormatter; use Drupal\Core\Annotation\Translation; use Drupal\Core\Entity\EntityInterface; use Drupal\field\Plugin\Type\Formatter\FormatterBase; diff --git a/core/modules/telephone/lib/Drupal/telephone/Plugin/field/formatter/TelephoneLinkFormatter.php b/core/modules/telephone/lib/Drupal/telephone/Plugin/field/formatter/TelephoneLinkFormatter.php index a8de926..208d6bd 100644 --- a/core/modules/telephone/lib/Drupal/telephone/Plugin/field/formatter/TelephoneLinkFormatter.php +++ b/core/modules/telephone/lib/Drupal/telephone/Plugin/field/formatter/TelephoneLinkFormatter.php @@ -7,7 +7,7 @@ namespace Drupal\telephone\Plugin\field\formatter; -use Drupal\Component\Annotation\Plugin; +use Drupal\field\Annotation\FieldFormatter; use Drupal\Core\Annotation\Translation; use Drupal\field\Plugin\Type\Formatter\FormatterBase; use Drupal\Core\Entity\EntityInterface; @@ -15,7 +15,7 @@ /** * Plugin implementation of the 'telephone_link' formatter. * - * @Plugin( + * @FieldFormatter( * id = "telephone_link", * module = "telephone", * label = @Translation("Telephone link"), diff --git a/core/modules/text/lib/Drupal/text/Plugin/field/formatter/TextDefaultFormatter.php b/core/modules/text/lib/Drupal/text/Plugin/field/formatter/TextDefaultFormatter.php index 4a96cc3..99e7aeb 100644 --- a/core/modules/text/lib/Drupal/text/Plugin/field/formatter/TextDefaultFormatter.php +++ b/core/modules/text/lib/Drupal/text/Plugin/field/formatter/TextDefaultFormatter.php @@ -7,7 +7,7 @@ namespace Drupal\text\Plugin\field\formatter; -use Drupal\Component\Annotation\Plugin; +use Drupal\field\Annotation\FieldFormatter; use Drupal\Core\Annotation\Translation; use Drupal\field\Plugin\Type\Formatter\FormatterBase; use Drupal\Core\Entity\EntityInterface; @@ -15,7 +15,7 @@ /** * Plugin implementation of the 'text_default' formatter. * - * @Plugin( + * @FieldFormatter( * id = "text_default", * module = "text", * label = @Translation("Default"), diff --git a/core/modules/text/lib/Drupal/text/Plugin/field/formatter/TextPlainFormatter.php b/core/modules/text/lib/Drupal/text/Plugin/field/formatter/TextPlainFormatter.php index 470e8a1..813bb92 100644 --- a/core/modules/text/lib/Drupal/text/Plugin/field/formatter/TextPlainFormatter.php +++ b/core/modules/text/lib/Drupal/text/Plugin/field/formatter/TextPlainFormatter.php @@ -7,7 +7,7 @@ namespace Drupal\text\Plugin\field\formatter; -use Drupal\Component\Annotation\Plugin; +use Drupal\field\Annotation\FieldFormatter; use Drupal\Core\Annotation\Translation; use Drupal\field\Plugin\Type\Formatter\FormatterBase; use Drupal\Core\Entity\EntityInterface; @@ -15,7 +15,7 @@ /** * Plugin implementation of the 'text_plain' formatter. * - * @Plugin( + * @FieldFormatter( * id = "text_plain", * module = "text", * label = @Translation("Plain text"), diff --git a/core/modules/text/lib/Drupal/text/Plugin/field/formatter/TextSummaryOrTrimmedFormatter.php b/core/modules/text/lib/Drupal/text/Plugin/field/formatter/TextSummaryOrTrimmedFormatter.php index 5342372..e0a0de0 100644 --- a/core/modules/text/lib/Drupal/text/Plugin/field/formatter/TextSummaryOrTrimmedFormatter.php +++ b/core/modules/text/lib/Drupal/text/Plugin/field/formatter/TextSummaryOrTrimmedFormatter.php @@ -7,13 +7,13 @@ */ namespace Drupal\text\Plugin\field\formatter; -use Drupal\Component\Annotation\Plugin; +use Drupal\field\Annotation\FieldFormatter; use Drupal\Core\Annotation\Translation; /** * Plugin implementation of the 'text_summary_or_trimmed' formatter. * - * @Plugin( + * @FieldFormatter( * id = "text_summary_or_trimmed", * module = "text", * label = @Translation("Summary or trimmed"), diff --git a/core/modules/text/lib/Drupal/text/Plugin/field/formatter/TextTrimmedFormatter.php b/core/modules/text/lib/Drupal/text/Plugin/field/formatter/TextTrimmedFormatter.php index 4be366d..49ced2b 100644 --- a/core/modules/text/lib/Drupal/text/Plugin/field/formatter/TextTrimmedFormatter.php +++ b/core/modules/text/lib/Drupal/text/Plugin/field/formatter/TextTrimmedFormatter.php @@ -7,7 +7,7 @@ */ namespace Drupal\text\Plugin\field\formatter; -use Drupal\Component\Annotation\Plugin; +use Drupal\field\Annotation\FieldFormatter; use Drupal\Core\Annotation\Translation; use Drupal\field\Plugin\Type\Formatter\FormatterBase; use Drupal\Core\Entity\EntityInterface; @@ -20,7 +20,7 @@ * * @see Drupal\text\Field\Formatter\TextSummaryOrTrimmedFormatter * - * @Plugin( + * @FieldFormatter( * id = "text_trimmed", * module = "text", * label = @Translation("Trimmed"),