net.fckeditor
Class FCKeditor

java.lang.Object
  extended by net.fckeditor.FCKeditor

public class FCKeditor
extends Object

Java representation of the FCKeditor. This representation reflects the editor in an object-oriented way. It can be configured as any other JavaBean type class. The final output of this class is HTML code.
Note: It's your responsibility to supply reasonable and valid values, only request and instanceName will be checked for sanity.

Version:
$Id: FCKeditor.java 3832 2009-07-08 17:44:17Z mosipov $

Constructor Summary
FCKeditor(HttpServletRequest request, String instanceName)
          Class constructor with a minimal set of parameters.
FCKeditor(HttpServletRequest request, String instanceName, String width, String height, String toolbarSet, String value, String basePath)
          Class constructor with all basic parameters.
 
Method Summary
 String createHtml()
          Creates the HTML representation of this editor instance.
 FCKeditorConfig getConfig()
          Deprecated. Method will be removed in FCKeditor.Java 2.6, use getConfig(String).
 String getConfig(String name)
          Returns a configuration option.
 void setBasePath(String basePath)
          Sets the base path of this editor.
 void setConfig(FCKeditorConfig config)
          Deprecated. Method will be removed in FCKeditor.Java 2.6, use setConfig(String, String).
 void setConfig(String name, String value)
          Sets a configuration option.
 void setHeight(String height)
          Sets the height of this editor.
 void setInstanceName(String instanceName)
          Sets the unique name of this editor.
 void setToolbarSet(String toolbarSet)
          Sets the name of the toolbar set of this editor.
 void setValue(String value)
          Sets the initial value to be edited as HTML markup.
 void setWidth(String width)
          Sets the width of this editor.
 String toString()
          Creates the HTML representation of this editor instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FCKeditor

public FCKeditor(HttpServletRequest request,
                 String instanceName,
                 String width,
                 String height,
                 String toolbarSet,
                 String value,
                 String basePath)
Class constructor with all basic parameters. A constructors which handles basic FCKeditor initialization with a few parameters. If you omit basic parameters, default ones will be taken from the properties file.

Parameters:
request - current user request instance
instanceName - the unique name of this editor
width - the desired editor width (CSS-style value)
height - the desired editor height (CSS-style value)
toolbarSet - the desired toolbar set name
value - the HTML markup of this editor. Markup will be properly escaped.
basePath - the base path of this editor, absolute to the context
Throws:
IllegalArgumentException - if instanceName is empty or not a valid XHTML id

FCKeditor

public FCKeditor(HttpServletRequest request,
                 String instanceName)
Class constructor with a minimal set of parameters. Omitted parameters will be set to default values.

Parameters:
request - current user request instance
instanceName - the unique name of this editor
Throws:
IllegalArgumentException - if instanceName is empty or not a valid HTML id
Method Detail

setInstanceName

public void setInstanceName(String instanceName)
Sets the unique name of this editor.

Parameters:
instanceName - the unique name of this editor
Throws:
IllegalArgumentException - if instanceName is empty or not a valid XHTML id

setValue

public void setValue(String value)
Sets the initial value to be edited as HTML markup.

Parameters:
value - the HTML markup of this editor. Markup will be properly escaped.

setBasePath

public void setBasePath(String basePath)
Sets the base path of this editor. The base path reflects the location of the editor files absolute to the context root not the server root.

Parameters:
basePath - the base path of this editor, absolute to the context

setToolbarSet

public void setToolbarSet(String toolbarSet)
Sets the name of the toolbar set of this editor.

Parameters:
toolbarSet - the desired toolbar set name

setWidth

public void setWidth(String width)
Sets the width of this editor. This value can be any valid CSS width value.

Parameters:
width - the desired editor width (CSS-style value)

setHeight

public void setHeight(String height)
Sets the height of this editor. This value can be any valid CSS height value.

Parameters:
height - the desired editor height (CSS-style value)

getConfig

@Deprecated
public FCKeditorConfig getConfig()
Deprecated. Method will be removed in FCKeditor.Java 2.6, use getConfig(String).

Gets the advanced configuration map. Each configuration element has to be set individually in this map.
The editor provides already a system-wide configuration through the config.js file. By adding elements to this map you can override the configuration for each editor instance.

Returns:
configuration configuration map for this editor instance
See Also:
getConfig(String)

getConfig

public String getConfig(String name)
Returns a configuration option. See FCKeditorConfig for more details.

Parameters:
name - the name of the parameter (case-sensitive)
Returns:
the value represented by this parameter, else null

setConfig

public void setConfig(String name,
                      String value)
Sets a configuration option. See FCKeditorConfig for more details.

Parameters:
name - the name of the config option (case-sensitive)
value - the value of the config option. Null values will be ignored.

setConfig

@Deprecated
public void setConfig(FCKeditorConfig config)
Deprecated. Method will be removed in FCKeditor.Java 2.6, use setConfig(String, String).

Sets the advanced configuration maps. Note: previously

Parameters:
config - configuration collection
See Also:
setConfig(String, String)

toString

public String toString()
Creates the HTML representation of this editor instance. First of all, this method determines whether the request browser is supported. According to the result an appropriate HTML representation is assembled and returned.

Overrides:
toString in class Object
Returns:
HTML representation of this editor instance

createHtml

public String createHtml()
Creates the HTML representation of this editor instance.

Returns:
HTML representation of this editor instance
See Also:
toString()


Copyright © 2004-2009 Frederico Caldeira Knabben. All Rights Reserved.