Builds a KEditor component declaration, which is a drag and drop block content editors can place on a page. Obtained from the two argument addComponent method on the controller mappings. The component's script, templates and preview image paths are derived from the app identifier and component identifier by convention, so only the types, description, categories and any default attributes need setting. Call build to register the component.
Group: Builders
Methods
addType(String type)
Returns: ComponentBuilder
Adds one resource type the component can be used on, such as a page or an email. Note that at least one call to types must have been made first, because this method only appends to an existing list.
| Parameter | Description |
|---|---|
type | the resource type the component applies to |
types(List<String> types)
Returns: ComponentBuilder
Sets the resource types the component can be used on, replacing any already set.
| Parameter | Description |
|---|---|
types | the resource types the component applies to |
desc(String d)
Returns: ComponentBuilder
Sets the user friendly description shown for the component in the content editor's component picker.
| Parameter | Description |
|---|---|
d | the description text |
categories(String s)
Returns: ComponentBuilder
Sets the comma separated categories used to group the component in the component picker.
| Parameter | Description |
|---|---|
s | the categories or tags for this component |
addDefaultAtt(String name, String val)
Returns: ComponentBuilder
Adds a default attribute value applied to the component's element when it is first dropped onto a page.
| Parameter | Description |
|---|---|
name | name of the attribute |
val | default value for the attribute |
build()
Returns: ControllerMappingList
Creates the component from the configured values and registers it against this app. Note that, unlike most builders here, this one is not guarded by the engine initialisation flag.