Take this sample code as a reference, changing AlloyEditorConfigContributor.java
@Override
public void populateConfigJSONObject(
JSONObject jsonObject, Map<String, Object> inputEditorTaglibAttributes,
ThemeDisplay themeDisplay,
RequestBackedPortletURLFactory requestBackedPortletURLFactory) {
super.populateConfigJSONObject(
jsonObject, inputEditorTaglibAttributes, themeDisplay,
requestBackedPortletURLFactory);
jsonObject.put("entities", Boolean.FALSE);
String extraPlugins = jsonObject.getString("extraPlugins");
String extraPluginsNeeded = "ae_uibridge,ae_richcombobridge,ae_panelmenubuttonbridge,ae_menubridge,ae_menubuttonbridge,ae_buttonbridge,colorbutton";
if (Validator.isNotNull(extraPlugins)) {
extraPlugins += ",itemselector,media,embedurl," + extraPluginsNeeded;
}
else {
extraPlugins = "itemselector,media,embedurl," + extraPluginsNeeded;
}
jsonObject.put(
"extraPlugins", extraPlugins
).put(
"toolbars", getToolbarsJSONObject(themeDisplay.getLocale())
);
}
...
protected JSONObject getToolbarsStylesSelectionsTextJSONObject(
Locale locale) {
return JSONUtil.put(
"buttons",
JSONUtil.putAll(
getStyleFormatsJSONObject(locale), "bold", "italic",
"underline", "ol", "ul", "linkBrowse", "TextColor", "BGColor")
).put(
"name", "text"
).put(
"test", "AlloyEditor.SelectionTest.text"
);
}