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() { |
||
65 | |||
66 | /** |
||
67 | * {@inheritdoc} |
||
68 | */ |
||
69 | public function setConfiguration(array $configuration) { |
||
72 | |||
73 | /** |
||
74 | * {@inheritdoc} |
||
75 | */ |
||
76 | public function calculateDependencies() { |
||
79 | |||
80 | /** |
||
81 | * {@inheritdoc} |
||
82 | */ |
||
83 | public function label() { |
||
86 | |||
87 | /** |
||
88 | * {@inheritdoc} |
||
89 | */ |
||
90 | protected function getDefaultWidget() { |
||
93 | |||
94 | /** |
||
95 | * {@inheritdoc} |
||
96 | */ |
||
97 | public function setDefaultWidget($widget) { |
||
100 | |||
101 | /** |
||
102 | * {@inheritdoc} |
||
103 | */ |
||
104 | public function validate(array &$form, FormStateInterface $form_state) {} |
||
105 | |||
106 | /** |
||
107 | * {@inheritdoc} |
||
108 | */ |
||
109 | public function submit(array &$form, FormStateInterface $form_state) {} |
||
110 | |||
111 | } |
||
112 |