1 | <?php |
||
16 | abstract class WidgetSelectorBase extends PluginBase implements WidgetSelectorInterface { |
||
17 | |||
18 | use PluginConfigurationFormTrait; |
||
19 | |||
20 | /** |
||
21 | * Plugin label. |
||
22 | * |
||
23 | * @var string |
||
24 | */ |
||
25 | protected $label; |
||
26 | |||
27 | /** |
||
28 | * Available widgets. |
||
29 | * |
||
30 | * @var array() |
||
31 | */ |
||
32 | protected $widgets_options; |
||
33 | |||
34 | /** |
||
35 | * ID of the default widget. |
||
36 | * |
||
37 | * @var string |
||
38 | */ |
||
39 | protected $defaultWidget; |
||
40 | |||
41 | /** |
||
42 | * {@inheritdoc} |
||
43 | */ |
||
44 | public function __construct($configuration, $plugin_id, $plugin_definition) { |
||
48 | |||
49 | /** |
||
50 | * {@inheritdoc} |
||
51 | */ |
||
52 | public function defaultConfiguration() { |
||
55 | |||
56 | /** |
||
57 | * {@inheritdoc} |
||
58 | */ |
||
59 | public function getConfiguration() { |
||
62 | |||
63 | /** |
||
64 | * {@inheritdoc} |
||
65 | */ |
||
66 | public function setConfiguration(array $configuration) { |
||
69 | |||
70 | /** |
||
71 | * {@inheritdoc} |
||
72 | */ |
||
73 | public function calculateDependencies() { |
||
76 | |||
77 | /** |
||
78 | * {@inheritdoc} |
||
79 | */ |
||
80 | public function label() { |
||
83 | |||
84 | /** |
||
85 | * {@inheritdoc} |
||
86 | */ |
||
87 | protected function getDefaultWidget() { |
||
90 | |||
91 | /** |
||
92 | * {@inheritdoc} |
||
93 | */ |
||
94 | public function setDefaultWidget($widget) { |
||
97 | |||
98 | /** |
||
99 | * {@inheritdoc} |
||
100 | */ |
||
101 | public function validate(array &$form, FormStateInterface $form_state) {} |
||
102 | |||
103 | /** |
||
104 | * {@inheritdoc} |
||
105 | */ |
||
106 | public function submit(array &$form, FormStateInterface $form_state) {} |
||
107 | |||
108 | } |
||
109 |