Using pickers for XWiki Rendering Macro parameters
Last modified by Vincent Massol on 2023/07/02 08:27
The type property of a XWiki.WikiMacroParameterClass object allows to specify into which Java type the parameter value (defined as a String) must be converted to.
Depending of the type provided, a custom picker can be used instead of the default one when editing the macro parameters in the wysiwyg editor.
Here are the types implementing a custom picker:
| Type | Picker |
|---|---|
| org.xwiki.model.reference.AttachmentReference | Attachment picker |
| java.lang.Boolean | Checkbox |
| java.awt.Color | Color picker |
| java.util.Date | Date picker |
| org.xwiki.model.reference.DocumentReference | Page picker |
| org.xwiki.model.reference.EntityReferenceString | Custom picker for entity references |
| org.xwiki.model.EntityType | Custom picker for entity types |
| org.xwiki.user.UserReference | User Picker |
You can also provide the reference of an existing Java Enum to get a custom select picker with its values. If you want to create a custom enum for your parameter, you can try the following approach.
You can find the pickers implementation.