Package com.jalios.jcms.wysiwyg
Class WysiwygConfigurationUpdate
- java.lang.Object
-
- com.jalios.jcms.wysiwyg.WysiwygConfigurationUpdate
-
public class WysiwygConfigurationUpdate extends java.lang.Object
Define the update to do on the WYSIWYG Configuration.
This class is to be used inWysiwygPolicyFilter.updateWysiwygConfiguration(String)
.
Example:public class MyBasicWysiwygPolicyFilter extends BasicWysiwygPolicyFilter { @Override public List<WysiwygConfigurationUpdate> updateWysiwygConfiguration(String configId) { List<WysiwygConfigurationUpdate> list = new ArrayList<WysiwygConfigurationUpdate>(); // Add a new toolbar item before the item 'undo' list.add(WysiwygConfigurationUpdate.newInstance(UpdateAction.INSERT_TOOLBAR_ITEM_BEFORE) .setData("item", "itembefore1").setData("item-before", "undo")); // Add a new toolbar item after the item 'undo' list.add(WysiwygConfigurationUpdate.newInstance(UpdateAction.INSERT_TOOLBAR_ITEM_AFTER) .setData("item", "itemafter1").setData("item-after", "undo")); if("config1".equals(configId)) { // Remove the item 'aligncenter' from the toolbar list.add(WysiwygConfigurationUpdate.newInstance(UpdateAction.REMOVE_TOOLBAR_ITEM).setData("item", "aligncenter")); } // Add a new toolbar at first list.add(WysiwygConfigurationUpdate.newInstance(UpdateAction.INSERT_TOOLBAR).setData("index", 0).setData("toolbar", "item1 item2 item3")); // Add a new toolbar at last list.add(WysiwygConfigurationUpdate.newInstance(UpdateAction.INSERT_TOOLBAR).setData("index", -1).setData("toolbar", "item7 item8 item9")); // Remove the second toolbar list.add(WysiwygConfigurationUpdate.newInstance(UpdateAction.REMOVE_TOOLBAR).setData("index", 1)); // Add new item group in the first toolbar at the beginning list.add(WysiwygConfigurationUpdate.newInstance(UpdateAction.INSERT_TOOLBAR_GROUP) .setData("index", 0).setData("toolbar-index", 0).setData("group", "newitem1 newitem2")); // Add new item group in the second toolbar at the index 2 (3rd position) list.add(WysiwygConfigurationUpdate.newInstance(UpdateAction.INSERT_TOOLBAR_GROUP) .setData("index", 2).setData("toolbar-index", 1).setData("group", "newitem3 newitem4")); // Remove the first item group from the first toolbar list.add(WysiwygConfigurationUpdate.newInstance(UpdateAction.REMOVE_TOOLBAR_GROUP).setData("index", 0).setData("toolbar-index", 0)); return list; } }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
WysiwygConfigurationUpdate.UpdateAction
Enumeration of actions to update a WYSIWYG configuration.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> T
getData(java.lang.String key)
WysiwygConfigurationUpdate.UpdateAction
getUpdateAction()
static WysiwygConfigurationUpdate
newInstance(WysiwygConfigurationUpdate.UpdateAction updateAction)
static void
removePlugin(java.lang.String plugin, WysiwygConfiguration config)
WysiwygConfigurationUpdate
setData(java.lang.String key, java.lang.Object value)
-
-
-
Method Detail
-
newInstance
public static WysiwygConfigurationUpdate newInstance(WysiwygConfigurationUpdate.UpdateAction updateAction)
-
setData
public WysiwygConfigurationUpdate setData(java.lang.String key, java.lang.Object value)
-
getUpdateAction
public WysiwygConfigurationUpdate.UpdateAction getUpdateAction()
-
getData
public <T> T getData(java.lang.String key)
-
removePlugin
public static void removePlugin(java.lang.String plugin, WysiwygConfiguration config)
-
-