loading table of contents...

7.4.5.2. Adding table cell merge and split commands

There are predefined commands for merging and splitting of table cells that can easily be made available in the richtext toolbar. To do so use the addItemsPlugin as described in the previous chapter.

The code would be like this:

<editor:richTextPropertyField>
  <plugins>
    <ui:addItemsPlugin recursive="true">
      <ui:items>
        <menuseparator/>
        <menuitem itemId="{CELL_MERGE_ITEM_ID}"><baseAction><ui:richTextAction commandName="{richTextAction.COMMAND_CELL_MERGE}"/></baseAction></menuitem>
        <menuitem itemId="{CELL_MERGE_RIGHT_ITEM_ID}"><baseAction><ui:richTextAction commandName="{richTextAction.COMMAND_CELL_MERGE_RIGHT}"/></baseAction></menuitem>
        <menuitem itemId="{CELL_MERGE_DOWN_ITEM_ID}"><baseAction><ui:richTextAction commandName="{richTextAction.COMMAND_CELL_MERGE_DOWN}"/></baseAction></menuitem>
        <menuitem itemId="{CELL_VERTICAL_SPLIT_ITEM_ID}"><baseAction><ui:richTextAction commandName="{richTextAction.COMMAND_CELL_VERTICAL_SPLIT}"/></baseAction></menuitem>
        <menuitem itemId="{CELL_HORIZONTAL_SPLIT_ITEM_ID}"><baseAction><ui:richTextAction commandName="{richTextAction.COMMAND_CELL_HORIZONTAL_SPLIT}"/></baseAction></menuitem>
      </ui:items>
      <ui:after>
        <component itemId="{richTextPropertyField.TABLE_REMOVE_ITEM_ID}"/>
      </ui:after>
    </ui:addItemsPlugin>
  </plugins>
</editor:richTextPropertyField>