com.ckeditor
Class CKEditorConfig

java.lang.Object
  extended by com.ckeditor.CKEditorConfig
All Implemented Interfaces:
Cloneable

public class CKEditorConfig
extends Object
implements Cloneable

CKEditor configuration class.


Constructor Summary
CKEditorConfig()
          Default constructor.
 
Method Summary
 void addConfigValue(String key, Boolean value)
          Adds a Boolean parameter to the configuration.
 void addConfigValue(String key, List<? extends Object> value)
          Adds a List parameter to the configuration.
 void addConfigValue(String key, Map<String,? extends Object> value)
          Adds a Map parameter to the configuration.
 void addConfigValue(String key, Number value)
          Adds a Number parameter to the configuration.
 void addConfigValue(String key, String value)
          Adds a String parameter to the configuration.
protected  Object clone()
          Override.
(package private)  CKEditorConfig configSettings(EventHandler eventHandler)
          Configure settings.
(package private)  Object getConfigValue(String key)
          Gets a configuration value by key.
(package private)  Map<String,Object> getConfigValues()
           
 boolean isEmpty()
          Checks if configuration is empty.
 void removeConfigValue(String key)
          Removes a configuration value by key.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CKEditorConfig

public CKEditorConfig()
Default constructor.

Method Detail

addConfigValue

public void addConfigValue(String key,
                           Number value)
Adds a Number parameter to the configuration. Usage:
config.addConfigValue("width", 100);
config.addConfigValue("dialog_backgroundCoverOpacity", 0.7);

Parameters:
key - configuration parameter key
value - configuration parameter value.

addConfigValue

public void addConfigValue(String key,
                           String value)
Adds a String parameter to the configuration. Usage:
config.addConfigValue("baseHref", "http://www.example.com/path/");
config.addConfigValue("toolbar", "[[ 'Source', '-', 'Bold', 'Italic' ]]");

Parameters:
key - configuration parameter key
value - configuration parameter value.

addConfigValue

public void addConfigValue(String key,
                           Map<String,? extends Object> value)
Adds a Map parameter to the configuration. Usage:
Map<String, Object> map = new HashMap<String, Object>();
map.put("element", "span");
map.put("styles", "{'background-color' : '#(color)'}");
config.addConfigValue("colorButton_backStyle", map);

Parameters:
key - configuration parameter key
value - configuration parameter value.

addConfigValue

public void addConfigValue(String key,
                           List<? extends Object> value)
Adds a List parameter to the configuration. Usage:
 
                List<List<String>> list = new ArrayList<List<String>>();
                List<String> subList = new ArrayList<String>();
                subList.add("Source");
                subList.add("-");
                subList.add("Bold");
                subList.add("Italic");
                list.add(subList);
                config.addConfigValue("toolbar", list);
                

Parameters:
key - configuration parameter key
value - configuration parameter value.

addConfigValue

public void addConfigValue(String key,
                           Boolean value)
Adds a Boolean parameter to the configuration. Usage:
config.addConfigValue("autoUpdateElement", true);

Parameters:
key - configuration parameter key
value - configuration parameter value.

getConfigValue

Object getConfigValue(String key)
Gets a configuration value by key.

Parameters:
key - configuration parameter key
Returns:
configuration parameter value.

getConfigValues

Map<String,Object> getConfigValues()
Returns:
all configuration values.

removeConfigValue

public void removeConfigValue(String key)
Removes a configuration value by key. Usage:
config.removeConfigValue("toolbar");

Parameters:
key - configuration parameter key.

configSettings

CKEditorConfig configSettings(EventHandler eventHandler)
Configure settings. Merge configuration and event handlers.

Parameters:
eventHandler - events
Returns:
setting configuration.

isEmpty

public boolean isEmpty()
Checks if configuration is empty.

Returns:
true if the configuration is empty.

clone

protected Object clone()
                throws CloneNotSupportedException
Override.

Overrides:
clone in class Object
Throws:
CloneNotSupportedException


Copyright © 2003-2011 CKSource - Frederico Knabben. All Rights Reserved.