Site Manager Developer Manual / Version 2010
Table Of ContentsYou can use custom actions to perform some actions in the RichTextPane. To this end, you have to perform the following steps:
Step | Description |
---|---|
1 | Create the command. |
| |
2 | Register the command (see Section 4.8.1, “Register Commands” for details): |
3 | Create the action you want to perform. The name of the action must match the name of the command above. The following code shows an example action which inserts an image into the RichTextPane. |
| |
4 | Subclass hox.corem.editor.toolkit.property.RichTextPane (for example as
MyRichTextPane ) and override the
createDefaultEditorKit() method to return your own RichTextEditorKit.
|
5 | Define your Action in the EditorKit class and override
getActions to add your custom action to the action array. |
| |
6 | Configure your MyRichTextPane in the editor.xml file
as described in Section 4.5, “Program Own PropertyEditors”. |
Table 4.11. How to integrate actions into the RichTextPane