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, instanceName and inputName will be checked for sanity.

Version:
$Id: FCKeditor.java 4785 2009-12-21 20:10:28Z mosipov $

Constructor Summary
FCKeditor(HttpServletRequest request, String instanceName)
          Class constructor with a minimal set of parameters.
FCKeditor(HttpServletRequest request, String instanceName, String inputName)
          Class constructor with a basic set of parameters.
FCKeditor(HttpServletRequest request, String instanceName, String width, String height, String toolbarSet, String value, String basePath)
          Class constructor with a extended set of parameters.
FCKeditor(HttpServletRequest request, String instanceName, String inputName, String width, String height, String toolbarSet, String value, String basePath)
          Class constructor with all parameters.
 
Method Summary
 String createHtml()
          Creates the HTML representation of this editor instance.
 String getConfig(String name)
          Returns a configuration option.
 void setBasePath(String basePath)
          Sets the base path of this editor.
 void setConfig(String name, String value)
          Sets a configuration option.
 void setHeight(String height)
          Sets the height of this editor.
 void setInputName(String inputName)
          Sets the name for the underlying input element.
 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 inputName,
                 String width,
                 String height,
                 String toolbarSet,
                 String value,
                 String basePath)
Class constructor with all parameters.

Parameters:
request - current user request instance
instanceName - the unique name of this editor
inputName - the name for the underlying input element. See setInputName(String) for details.
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,
                 String width,
                 String height,
                 String toolbarSet,
                 String value,
                 String basePath)
Class constructor with a extended set of parameters.

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

FCKeditor

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

Parameters:
request - current user request instance
instanceName - the unique name of this editor
inputName - the name for the underlying input element. See setInputName(String) for details.
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

setInputName

public void setInputName(String inputName)
Sets the name for the underlying input element. Empty strings will be ignored and field will be reset to instanceName.

Parameters:
inputName - the name for the underlying input element

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

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.

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-2010 Frederico Caldeira Knabben. All Rights Reserved.