class PlainTextEditor in Drupal 10
Same name and namespace in other branches
- 8 core/modules/quickedit/src/Plugin/InPlaceEditor/PlainTextEditor.php \Drupal\quickedit\Plugin\InPlaceEditor\PlainTextEditor
- 9 core/modules/quickedit/src/Plugin/InPlaceEditor/PlainTextEditor.php \Drupal\quickedit\Plugin\InPlaceEditor\PlainTextEditor
Defines the plain text in-place editor.
Plugin annotation
@InPlaceEditor(
id = "plain_text"
)
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \Drupal\Core\Plugin\PluginBase uses DependencySerializationTrait, MessengerTrait, StringTranslationTrait
- class \Drupal\quickedit\Plugin\InPlaceEditorBase implements InPlaceEditorInterface
- class \Drupal\quickedit\Plugin\InPlaceEditor\PlainTextEditor
- class \Drupal\quickedit\Plugin\InPlaceEditorBase implements InPlaceEditorInterface
- class \Drupal\Core\Plugin\PluginBase uses DependencySerializationTrait, MessengerTrait, StringTranslationTrait
Expanded class hierarchy of PlainTextEditor
File
- core/
modules/ quickedit/ src/ Plugin/ InPlaceEditor/ PlainTextEditor.php, line 15
Namespace
Drupal\quickedit\Plugin\InPlaceEditorView source
class PlainTextEditor extends InPlaceEditorBase {
/**
* {@inheritdoc}
*/
public function isCompatible(FieldItemListInterface $items) {
$field_definition = $items
->getFieldDefinition();
// This editor is incompatible with multivalued fields.
return $field_definition
->getFieldStorageDefinition()
->getCardinality() == 1;
}
/**
* {@inheritdoc}
*/
public function getAttachments() {
return [
'library' => [
'quickedit/quickedit.inPlaceEditor.plainText',
],
];
}
}