5 * Contains \Drupal\linkit\AttributeInterface.
8 namespace Drupal\linkit;
10 use Drupal\Component\Plugin\ConfigurablePluginInterface;
11 use Drupal\Component\Plugin\PluginInspectionInterface;
14 * Defines the interface for attributes plugins.
16 * @see \Drupal\linkit\Annotation\Attribute
17 * @see \Drupal\linkit\AttributeBase
18 * @see \Drupal\linkit\AttributeManager
21 interface AttributeInterface extends PluginInspectionInterface, ConfigurablePluginInterface {
24 * Returns the attribute label.
27 * The attribute label.
29 public function getLabel();
32 * Returns the attribute description.
35 * The attribute description.
37 public function getDescription();
40 * Returns the attribute html name. This is the name of the attribute
41 * that will be inserted in the <code><a></code> tag.
44 * The attribute html name.
46 public function getHtmlName();
49 * Returns the weight of the attribute.
52 * Either the integer weight of the attribute or an empty string.
54 public function getWeight();
57 * Sets the weight for this attribute.
60 * The weight for this attribute.
64 public function setWeight($weight);
67 * The form element structure for this attribute to be used in the dialog.
69 * @param mixed $default_value
70 * The default value for the element. Used when editing an attribute in the
76 public function buildFormElement($default_value);