Set titles and descriptions
We can set the titles and descriptions of a resource.
- Obtain a modifiable instance of the resource for which to set titles or descriptions.
- Check whether the resource implements the ModifiableLocalized interface. To check, use the operator instanceof. If the resource does not implement the ModifiableLocalized interface, we cannot modify it.
- Use the appropriate methods to set titles and descriptions. For example, to set a title, use the setTitle method.
We cannot set a description in a particular locale without having a title set in that same locale.
Modify titles and descriptionsfinal Modifiable modifiable = controller.getModifiableNode(node); { ((ModifiableLocalized) modifiable).setTitle(Locale.GERMAN, "Titel"); ((ModifiableLocalized) modifiable).setDescription(Locale.GERMAN, "Beschreibung"); }
Parent Modify properties