com.fredck.FCKeditor.tags
Class FCKeditorTag

java.lang.Object
  extended byjavax.servlet.jsp.tagext.TagSupport
      extended byjavax.servlet.jsp.tagext.BodyTagSupport
          extended bycom.fredck.FCKeditor.tags.FCKeditorTag
All Implemented Interfaces:
javax.servlet.jsp.tagext.BodyTag, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, java.io.Serializable, javax.servlet.jsp.tagext.Tag

public class FCKeditorTag
extends javax.servlet.jsp.tagext.BodyTagSupport

Custom Tag class to access the container.

Simple usage:

	<FCK:editor
		id="EditorAccessibility"
		width="80%"
		height="120"
		toolbarSet="Accessibility"
	">This is another test. <BR><BR>The "Second" row.</BR></FCK:editor">
 

In this example we set all the attribute for the fckedit tag.

Advanced usage of the tag:

	<FCK:editor id="EditorDefault" basePath="/FCKeditor/"
		styleNames=";Style 1;Style 2; Style 3" 
		fontNames=";Arial;Courier New;Times New Roman;Verdana" >
		This is some <B>sample text</B>.
	</FCK:editor>
  

In this example we set the id and the basePath of the editor (since it is /FCKeditor/ we could have omitted it because it's already the default value).
Then we used the the optional attributes to set some advanced configuration settings.

Author:
Simone Chiaretta (simo@users.sourceforge.net)
See Also:
Serialized Form

Field Summary
protected  FCKeditor fcked
          The underlying FCKeditor object
 
Fields inherited from class javax.servlet.jsp.tagext.BodyTagSupport
bodyContent
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
pageContext
 
Fields inherited from interface javax.servlet.jsp.tagext.BodyTag
EVAL_BODY_BUFFERED, EVAL_BODY_TAG
 
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
 
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
FCKeditorTag()
           
 
Method Summary
 int doAfterBody()
          Retrive initial value to be edited and writes the HTML code in the page
 int doStartTag()
          Initialize the FCKeditor container and set attributes
 void setAutoDetectLanguage(java.lang.String value)
          Tells the editor to automatically detect the user language preferences to adapt its interface language.
 void setBaseHref(java.lang.String value)
          Base URL used to resolve links (on images, links, styles, etc.).
 void setBasePath(java.lang.String value)
          Set the dir where the FCKeditor files reside on the server
 void setContentLangDirection(java.lang.String value)
          Sets the direction of the editor area contents.
 void setCustomConfigurationsPath(java.lang.String value)
          Set the path of a custom file that can override some configurations.
 void setDebug(java.lang.String value)
          Enables the debug window to be shown when calling the FCKDebug.Output() function.
 void setDefaultLanguage(java.lang.String value)
          Sets the default language used for the editor's interface localization.
 void setEditorAreaCSS(java.lang.String value)
          Set the CSS styles file to be used in the editing area.
 void setEnableSourceXHTML(java.lang.String value)
          Tells the editor to process the HTML source to XHTML when switching from WYSIWYG to Source view
 void setEnableXHTML(java.lang.String value)
          Tells the editor to process the HTML source to XHTML on form post.
 void setFillEmptyBlocks(java.lang.String value)
          Block elements (like P, DIV, H1, PRE, etc...) are forced to have content (a &nbsp;).
 void setFlashBrowserURL(java.lang.String value)
          Sets the URL of the page called when the user clicks the "Browse Server" button in the "Flash" dialog window.
 void setFlashUploadURL(java.lang.String value)
          Sets the URL of the upload handler called when the user clicks the "Send it to server" button in the "Flash" dialog window.
 void setFontColors(java.lang.String value)
          Sets the colors that must be shown in the colors panels (in the toolbar).
 void setFontFormats(java.lang.String value)
          Sets the list of formats to be shown in the "Format" toolbar command.
 void setFontNames(java.lang.String value)
          Sets the list of fonts to be shown in the "Font" toolbar command.
 void setFontSizes(java.lang.String value)
          Sets the list of font sizes to be shown in the "Size" toolbar command.
 void setForcePasteAsPlainText(java.lang.String value)
          Converts the clipboard contents to pure text on pasting operations
 void setForceSimpleAmpersand(java.lang.String value)
          Forces the ampersands (&) on tags attributes to not be converted to "&amp;"
This conversion is a W3C requirement for XHTML, so it is recommended to leave this option to "false".
 void setFormatIndentator(java.lang.String value)
          Sets the characters to be used when indenting the HTML source when formatting it.
 void setFormatOutput(java.lang.String value)
          The output HTML generated by the editor will be processed and formatted.
 void setFormatSource(java.lang.String value)
          The HTML shown by the editor, while switching from WYSIWYG to Source views, will be processed and formatted
 void setFullPage(java.lang.String value)
          Enables full page editing (from <HTML> to </HTML>).
 void setGeckoUseSPAN(java.lang.String value)
          Tells Gecko browsers to use SPAN instead of <B>, <I> and <U> for bold, italic an underline
 void setHeight(java.lang.String value)
          Set the height of the textarea
 void setId(java.lang.String value)
          Set the unique id of the editor
 void setImageBrowserURL(java.lang.String value)
          Sets the URL of the page called when the user clicks the "Browse Server" button in the "Image" dialog window.
 void setImageUploadURL(java.lang.String value)
          Sets the URL of the upload handler called when the user clicks the "Send it to server" button in the "Image" dialog window.
 void setLinkBrowserURL(java.lang.String value)
          Sets the URL of the page called when the user clicks the "Browse Server" button in the "Link" dialog window.
 void setLinkUploadURL(java.lang.String value)
          Sets the URL of the upload handler called when the user clicks the "Send it to server" button in the "Link" dialog window.
 void setPluginsPath(java.lang.String value)
          Sets the base path used when looking for registered plugins.
 void setSkinPath(java.lang.String value)
          Sets the path to the skin (graphical interface settings) to be used by the editor.
 void setStartupFocus(java.lang.String value)
          Forces the editor to get the keyboard input focus on startup (page load)
 void setStylesXmlPath(java.lang.String value)
          Sets the path to the XML file that has the definitions and rules of the styles used by the "Style" toolbar command
 void setTabSpaces(java.lang.String value)
          Set the number of spaces (&nbsp;) to be inserted when the user hits the "tab" key.
 void setToolbarCanCollapse(java.lang.String value)
          Tells the editor that the toolbar can be Collapsed/Expanded by the user when clicking the vertical bar placed on the left of it (on the right for "rtl" languages).
 void setToolbarSet(java.lang.String value)
          Set the name of the toolbar to display
 void setToolbarStartExpanded(java.lang.String value)
          The toolbar is Expanded on startup, otherwise it is Collapsed and the user must click on it to show it.
 void setUseBROnCarriageReturn(java.lang.String value)
          Inserts a <BR> tag when the user hits the "enter" key, instead of starting a new paragraph (<P> or <DIV>).
 void setWidth(java.lang.String value)
          Set the width of the textarea
 
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport
doEndTag, doInitBody, getBodyContent, getPreviousOut, release, setBodyContent
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setPageContext, setParent, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.servlet.jsp.tagext.Tag
getParent, setPageContext, setParent
 

Field Detail

fcked

protected FCKeditor fcked
The underlying FCKeditor object

Constructor Detail

FCKeditorTag

public FCKeditorTag()
Method Detail

setId

public void setId(java.lang.String value)
Set the unique id of the editor

Parameters:
value - name

setBasePath

public void setBasePath(java.lang.String value)
Set the dir where the FCKeditor files reside on the server

Parameters:
value - path

setToolbarSet

public void setToolbarSet(java.lang.String value)
Set the name of the toolbar to display

Parameters:
value - toolbar name

setWidth

public void setWidth(java.lang.String value)
Set the width of the textarea

Parameters:
value - width

setHeight

public void setHeight(java.lang.String value)
Set the height of the textarea

Parameters:
value - height

setCustomConfigurationsPath

public void setCustomConfigurationsPath(java.lang.String value)
Set the path of a custom file that can override some configurations.
It is recommended to use absolute paths (starting with /), like "/myfckconfig.js".

Parameters:
value - path

setEditorAreaCSS

public void setEditorAreaCSS(java.lang.String value)
Set the CSS styles file to be used in the editing area.
In this way you can point to a file that reflects your web site styles.

Parameters:
value - path

setBaseHref

public void setBaseHref(java.lang.String value)
Base URL used to resolve links (on images, links, styles, etc.).
For example, if BaseHref is set to 'http://www.fredck.com', an image that points to "/images/Logo.gif" will be interpreted by the editor as "http://www.fredck.com/images/Logo.gif", without touching the "src" attribute of the image.

Parameters:
value - URL

setSkinPath

public void setSkinPath(java.lang.String value)
Sets the path to the skin (graphical interface settings) to be used by the editor.

Parameters:
value - path

setPluginsPath

public void setPluginsPath(java.lang.String value)
Sets the base path used when looking for registered plugins.

Parameters:
value - path

setFullPage

public void setFullPage(java.lang.String value)
                 throws javax.servlet.jsp.JspException
Enables full page editing (from <HTML> to </HTML>).
It also enables the "Page Properties" toolbar button.

Parameters:
value - true/false
Throws:
javax.servlet.jsp.JspException - if value is not true or false

setDebug

public void setDebug(java.lang.String value)
              throws javax.servlet.jsp.JspException
Enables the debug window to be shown when calling the FCKDebug.Output() function.

Parameters:
value - true/false
Throws:
javax.servlet.jsp.JspException - if value is not true or false

setAutoDetectLanguage

public void setAutoDetectLanguage(java.lang.String value)
                           throws javax.servlet.jsp.JspException
Tells the editor to automatically detect the user language preferences to adapt its interface language.
With Internet Explorer, the language configured in the Windows Control Panel is used.
With Firefox, the browser language is used.

Parameters:
value - true/false
Throws:
javax.servlet.jsp.JspException - if value is not true or false

setDefaultLanguage

public void setDefaultLanguage(java.lang.String value)
Sets the default language used for the editor's interface localization.
The default language is used when the AutoDetectLanguage options is disabled or when the user language is not available.

Parameters:
value - language code

setContentLangDirection

public void setContentLangDirection(java.lang.String value)
                             throws javax.servlet.jsp.JspException
Sets the direction of the editor area contents.
The possible values are:

Parameters:
value - ltr/rtl
Throws:
javax.servlet.jsp.JspException - if value is not ltr or rtl

setEnableXHTML

public void setEnableXHTML(java.lang.String value)
                    throws javax.servlet.jsp.JspException
Tells the editor to process the HTML source to XHTML on form post.

Parameters:
value - true/false
Throws:
javax.servlet.jsp.JspException - if value is not true or false

setEnableSourceXHTML

public void setEnableSourceXHTML(java.lang.String value)
                          throws javax.servlet.jsp.JspException
Tells the editor to process the HTML source to XHTML when switching from WYSIWYG to Source view

Parameters:
value - true/false
Throws:
javax.servlet.jsp.JspException - if value is not true or false

setFillEmptyBlocks

public void setFillEmptyBlocks(java.lang.String value)
                        throws javax.servlet.jsp.JspException
Block elements (like P, DIV, H1, PRE, etc...) are forced to have content (a &nbsp;).
Empty blocks are "collapsed" by while browsing, so a empty <p></p> is not visible.
While editing, the editor "expand" empty blocks so you can insert content inside then.
Setting this option to "true" results useful to reflect the same output when browsing and editing.

Parameters:
value - true/false
Throws:
javax.servlet.jsp.JspException - if value is not true or false

setFormatSource

public void setFormatSource(java.lang.String value)
                     throws javax.servlet.jsp.JspException
The HTML shown by the editor, while switching from WYSIWYG to Source views, will be processed and formatted

Parameters:
value - true/false
Throws:
javax.servlet.jsp.JspException - if value is not true or false

setFormatOutput

public void setFormatOutput(java.lang.String value)
                     throws javax.servlet.jsp.JspException
The output HTML generated by the editor will be processed and formatted.

Parameters:
value - true/false
Throws:
javax.servlet.jsp.JspException - if value is not true or false

setFormatIndentator

public void setFormatIndentator(java.lang.String value)
Sets the characters to be used when indenting the HTML source when formatting it.
Useful values are a sequence of spaces (' ') or a tab char ('\t').

Parameters:
value - indentator

setGeckoUseSPAN

public void setGeckoUseSPAN(java.lang.String value)
                     throws javax.servlet.jsp.JspException
Tells Gecko browsers to use SPAN instead of <B>, <I> and <U> for bold, italic an underline

Parameters:
value - true/false
Throws:
javax.servlet.jsp.JspException - if value is not true or false

setStartupFocus

public void setStartupFocus(java.lang.String value)
                     throws javax.servlet.jsp.JspException
Forces the editor to get the keyboard input focus on startup (page load)

Parameters:
value - true/false
Throws:
javax.servlet.jsp.JspException - if value is not true or false

setForcePasteAsPlainText

public void setForcePasteAsPlainText(java.lang.String value)
                              throws javax.servlet.jsp.JspException
Converts the clipboard contents to pure text on pasting operations

Parameters:
value - true/false
Throws:
javax.servlet.jsp.JspException - if value is not true or false

setForceSimpleAmpersand

public void setForceSimpleAmpersand(java.lang.String value)
                             throws javax.servlet.jsp.JspException
Forces the ampersands (&) on tags attributes to not be converted to "&amp;"
This conversion is a W3C requirement for XHTML, so it is recommended to leave this option to "false".

Parameters:
value - true/false
Throws:
javax.servlet.jsp.JspException - if value is not true or false

setTabSpaces

public void setTabSpaces(java.lang.String value)
Set the number of spaces (&nbsp;) to be inserted when the user hits the "tab" key.
This is an Internet Explorer only feature. Other browsers insert spaces automatically by default.

Parameters:
value - number of spaces

setUseBROnCarriageReturn

public void setUseBROnCarriageReturn(java.lang.String value)
                              throws javax.servlet.jsp.JspException
Inserts a <BR> tag when the user hits the "enter" key, instead of starting a new paragraph (<P> or <DIV>).
This is an Internet Explorer only feature. Other browsers insert the <BR> tag by default.

Parameters:
value - true/false
Throws:
javax.servlet.jsp.JspException - if value is not true or false

setToolbarStartExpanded

public void setToolbarStartExpanded(java.lang.String value)
                             throws javax.servlet.jsp.JspException
The toolbar is Expanded on startup, otherwise it is Collapsed and the user must click on it to show it.

Parameters:
value - true/false
Throws:
javax.servlet.jsp.JspException - if value is not true or false

setToolbarCanCollapse

public void setToolbarCanCollapse(java.lang.String value)
                           throws javax.servlet.jsp.JspException
Tells the editor that the toolbar can be Collapsed/Expanded by the user when clicking the vertical bar placed on the left of it (on the right for "rtl" languages).

Parameters:
value - true/false
Throws:
javax.servlet.jsp.JspException - if value is not true or false

setFontColors

public void setFontColors(java.lang.String value)
Sets the colors that must be shown in the colors panels (in the toolbar).

Parameters:
value - colors

setFontNames

public void setFontNames(java.lang.String value)
Sets the list of fonts to be shown in the "Font" toolbar command.

Parameters:
value - fonts

setFontSizes

public void setFontSizes(java.lang.String value)
Sets the list of font sizes to be shown in the "Size" toolbar command.

Parameters:
value - sizes

setFontFormats

public void setFontFormats(java.lang.String value)
Sets the list of formats to be shown in the "Format" toolbar command.

Parameters:
value - format list

setStylesXmlPath

public void setStylesXmlPath(java.lang.String value)
Sets the path to the XML file that has the definitions and rules of the styles used by the "Style" toolbar command

Parameters:
value - path

setLinkBrowserURL

public void setLinkBrowserURL(java.lang.String value)
Sets the URL of the page called when the user clicks the "Browse Server" button in the "Link" dialog window.
In this way, you can create your custom File Browser that is well integrated with your system.

Parameters:
value - path

setImageBrowserURL

public void setImageBrowserURL(java.lang.String value)
Sets the URL of the page called when the user clicks the "Browse Server" button in the "Image" dialog window.
In this way, you can create your custom Image Browser that is well integrated with your system.

Parameters:
value - path

setFlashBrowserURL

public void setFlashBrowserURL(java.lang.String value)
Sets the URL of the page called when the user clicks the "Browse Server" button in the "Flash" dialog window.
In this way, you can create your custom Flash Browser that is well integrated with your system.

Parameters:
value - path

setLinkUploadURL

public void setLinkUploadURL(java.lang.String value)
Sets the URL of the upload handler called when the user clicks the "Send it to server" button in the "Link" dialog window.
In this way, you can create your custom Link Uploader that is well integrated with your system.

Parameters:
value - path

setImageUploadURL

public void setImageUploadURL(java.lang.String value)
Sets the URL of the upload handler called when the user clicks the "Send it to server" button in the "Image" dialog window.
In this way, you can create your custom Image Uploader that is well integrated with your system.

Parameters:
value - path

setFlashUploadURL

public void setFlashUploadURL(java.lang.String value)
Sets the URL of the upload handler called when the user clicks the "Send it to server" button in the "Flash" dialog window.
In this way, you can create your custom Flash Uploader that is well integrated with your system.

Parameters:
value - path

doStartTag

public int doStartTag()
               throws javax.servlet.jsp.JspException
Initialize the FCKeditor container and set attributes

Returns:
EVAL_BODY_BUFFERED
Throws:
javax.servlet.jsp.JspException

doAfterBody

public int doAfterBody()
                throws javax.servlet.jsp.JspException
Retrive initial value to be edited and writes the HTML code in the page

Returns:
SKIP_BODY
Throws:
javax.servlet.jsp.JspException - if an error occurs while writing to the out buffer