public class RichTextEditorConfiguration
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_LANGUAGE
Key for the default language configuration.
|
static java.lang.String |
LANGUAGE
Key for the language configuration.
|
static java.lang.String |
REMOVE_BUTTONS
Key for toolbar buttons that should not be rendered.
|
static java.lang.String |
TOOLBAR_CAN_COLLAPSE
Key to configure whether the toolbar can be collapsed by the user.
|
static java.lang.String |
TOOLBAR_GROUPS
Key for toolbar groups configuration.
|
static java.lang.String |
TOOLBAR_STARTUP_EXPANDED
Key to configure whether the toolbar must start expanded when the editor is loaded.
|
Constructor and Description |
---|
RichTextEditorConfiguration()
Creates a new instance for general configurations that are added to the created CKEditor
instance at initialization.
|
Modifier and Type | Method and Description |
---|---|
void |
addDefaultToolbarButton(java.lang.String... buttonNames)
Adds the CKEditor default button for the given name to the toolbar.
|
java.util.Map<java.lang.String,java.lang.Object> |
getAllOptions() |
java.lang.Object |
getOption(java.lang.String key)
Returns a configuration option set in this
RichTextEditorConfiguration . |
void |
removeDefaultToolbarButton(java.lang.String... buttonNames)
Removes the CKEditor default button for the given name from the toolbar.
|
void |
setDefaultLanguage(java.util.Locale locale) |
void |
setDefaultLanguage(java.lang.String lang) |
void |
setLanguage(java.util.Locale locale) |
void |
setLanguage(java.lang.String lang) |
void |
setOption(java.lang.String key,
java.lang.Object value)
Adds a new option to the configuration.
|
void |
setRemoveFormat(boolean removeFormat) |
void |
setRemovePasteFromWord(boolean removePasteFromWord) |
void |
setRemovePasteText(boolean removePasteText) |
void |
setRemoveStyles(boolean removeStyles) |
void |
setToolbarCollapsible(boolean toolbarCollapsible)
Configure if the toolbar should be collapsible.
|
void |
setToolbarInitialExpanded(boolean toolbarInitialExpanded)
Configure if the toolbar should be initially expanded.
|
public static final java.lang.String DEFAULT_LANGUAGE
public static final java.lang.String LANGUAGE
public static final java.lang.String TOOLBAR_GROUPS
public static final java.lang.String REMOVE_BUTTONS
public static final java.lang.String TOOLBAR_CAN_COLLAPSE
public static final java.lang.String TOOLBAR_STARTUP_EXPANDED
public RichTextEditorConfiguration()
public void setOption(java.lang.String key, java.lang.Object value)
key
- The configuration option key.value
- The configuration option value.public java.lang.Object getOption(java.lang.String key)
RichTextEditorConfiguration
.key
- The configuration option key for which the value is requested.null
in case there is
nothing configured for that key.public java.util.Map<java.lang.String,java.lang.Object> getAllOptions()
public void setLanguage(java.lang.String lang)
lang
- The user interface language localization to use. If left empty, the editor will
automatically be localized to the user language. If the user language is not
supported, the language specified in the defaultLanguage configuration setting
is used.public void setLanguage(java.util.Locale locale)
locale
- The user interface language localization to use. If left empty, the editor will
automatically be localized to the user language. If the user language is not
supported, the language specified in the defaultLanguage configuration setting
is used.public void setDefaultLanguage(java.lang.String lang)
lang
- The language to be used if the language setting is left empty and it is not
possible to localize the editor to the user language.public void setDefaultLanguage(java.util.Locale locale)
locale
- The language to be used if the language setting is left empty and it is not
possible to localize the editor to the user language.public void setRemovePasteText(boolean removePasteText)
removePasteText
- true
to remove the paste text button from the
toolbar.public void setRemovePasteFromWord(boolean removePasteFromWord)
removePasteFromWord
- true
to remove the paste from word button from
the toolbar.public void setRemoveStyles(boolean removeStyles)
removeStyles
- true
to remove the styles combo box from the toolbar.public void setRemoveFormat(boolean removeFormat)
removeFormat
- true
to remove format combo box from the toolbar.public void addDefaultToolbarButton(java.lang.String... buttonNames)
Note: This works only for buttons that have been removed using
removeDefaultToolbarButton(String[])
buttonNames
- The names of the CKEditor default button to add.public void removeDefaultToolbarButton(java.lang.String... buttonNames)
buttonNames
- The names of the CKEditor default button to remove.public void setToolbarCollapsible(boolean toolbarCollapsible)
false
.toolbarCollapsible
- true
if the toolbar should be collapsible,
false
if not.public void setToolbarInitialExpanded(boolean toolbarInitialExpanded)
true
.toolbarInitialExpanded
- true
if the toolbar should be initially expanded,
false
if not.
Copyright (c) EclipseSource and others 2002, 2017.
All rights reserved. This program and the accompanying materials
are made available under the terms of the
Eclipse Public License v1.0