public class ToolbarConfiguration
extends java.lang.Object
To customize the CKEditor buttons shown in the toolbar, you need to override
getToolbarGroupConfiguration()
and getRemoveButtonConfiguration()
Modifier and Type | Field and Description |
---|---|
boolean |
removeFormat
Configure whether to remove format combo box from the toolbar.
|
boolean |
removeStyles
Configure whether to remove the styles combo box from the toolbar.
|
boolean |
toolbarCollapsible
Configure if the toolbar should be collapsible.
|
boolean |
toolbarInitialExpanded
Configure if the toolbar should be initially expanded.
|
Constructor and Description |
---|
ToolbarConfiguration() |
Modifier and Type | Method and Description |
---|---|
void |
addDefaultToolbarButton(java.lang.String buttonName)
Adds the CKEditor default button for the given name to the toolbar.
|
protected java.lang.String |
getRemoveButtonConfiguration()
Configure CKEditor toolbar default buttons.
|
protected java.lang.String |
getToolbarGroupConfiguration()
Configure CKEditor toolbar button groups.
|
void |
removeDefaultToolbarButton(java.lang.String buttonName)
Removes the CKEditor default button for the given name from the toolbar.
|
java.lang.String |
toString() |
public boolean removeStyles
true
.public boolean removeFormat
true
.public boolean toolbarCollapsible
false
.public boolean toolbarInitialExpanded
toolbarCollapsible
is set to true
. Default is true
.protected java.lang.String getToolbarGroupConfiguration()
CKEDITOR.config.toolbarGroups
configuration property. It must start with
"CKEDITOR.config.toolbarGroups" and end with a semicolon. The value is a JavaScript array as
defined in CKEditor Documentation.
Usage:
public class MyConfig extends ToolbarConfiguration { @Override protected String getToolbarGroupConfiguration() { return "CKEDITOR.config.toolbarGroups = [{\"name\":\"styles\"}];"; } }
protected java.lang.String getRemoveButtonConfiguration()
CKEDITOR.config.removeButtons
configuration property. It must start with
"CKEDITOR.config.removeButtons" and end with a semicolon. The value is a comma-separated list
of default button names as defined in CKEditor Documentation.
Usage:
public class MyConfig extends ToolbarConfiguration { @Override protected String getRemoveButtonConfiguration() { return "CKEDITOR.config.removeButtons = \"Subscript,Superscript\";"; } }
public void addDefaultToolbarButton(java.lang.String buttonName)
Note: This works only for buttons that have been removed using
removeDefaultToolbarButton(String)
buttonName
- The name of the CKEditor default button to add.public void removeDefaultToolbarButton(java.lang.String buttonName)
buttonName
- The name of the CKEditor default button to remove.public java.lang.String toString()
toString
in class java.lang.Object
Copyright (c) EclipseSource and others 2002, 2016.
All rights reserved. This program and the accompanying materials
are made available under the terms of the
Eclipse Public License v1.0