📄 fckeditortag.java
字号:
* The HTML shown by the editor, while switching from WYSIWYG to Source views, will be processed and formatted * * @param value true/false * @throws JspException if value is not true or false */ public void setFormatSource(String value) throws JspException { if (!value.equals("true") && !value.equals("false")) throw new JspException( "formatSource attribute can only be true or false"); formatSource = value; } /** * The output HTML generated by the editor will be processed and formatted. * * @param value true/false * @throws JspException if value is not true or false */ public void setFormatOutput(String value) throws JspException { if (!value.equals("true") && !value.equals("false")) throw new JspException( "formatOutput attribute can only be true or false"); formatOutput = value; } /** * Sets the characters to be used when indenting the HTML source when formatting it.<BR> * Useful values are a sequence of spaces (' ') or a tab char ('\t'). * * @param value indentator */ public void setFormatIndentator(String value) { formatIndentator = value; } /** * Tells Gecko browsers to use SPAN instead of <B>, <I> and <U> for bold, italic an underline * * @param value true/false * @throws JspException if value is not true or false */ public void setGeckoUseSPAN(String value) throws JspException { if (!value.equals("true") && !value.equals("false")) throw new JspException( "GeckoUseSPAN attribute can only be true or false"); geckoUseSPAN = value; } /** * Forces the editor to get the keyboard input focus on startup (page load) * * @param value true/false * @throws JspException if value is not true or false */ public void setStartupFocus(String value) throws JspException { if (!value.equals("true") && !value.equals("false")) throw new JspException( "startupFocus attribute can only be true or false"); startupFocus = value; } /** * Converts the clipboard contents to pure text on pasting operations * * @param value true/false * @throws JspException if value is not true or false */ public void setForcePasteAsPlainText(String value) throws JspException { if (!value.equals("true") && !value.equals("false")) throw new JspException( "forcePasteAsPlainText attribute can only be true or false"); forcePasteAsPlainText = value; } /** * Forces the ampersands (&) on tags attributes to not be converted to "&amp;"<BR> * This conversion is a W3C requirement for XHTML, so it is recommended to leave this option to "false". * * @param value true/false * @throws JspException if value is not true or false */ public void setForceSimpleAmpersand(String value) throws JspException { if (!value.equals("true") && !value.equals("false")) throw new JspException( "forceSimpleAmpersand attribute can only be true or false"); forceSimpleAmpersand = value; } /** * Set the number of spaces (&nbsp;) to be inserted when the user hits the "tab" key.<BR> * This is an Internet Explorer only feature. Other browsers insert spaces automatically by default. * * @param value number of spaces */ public void setTabSpaces(String value) { tabSpaces = value; } /** * Inserts a <BR> tag when the user hits the "enter" key, instead of starting a new paragraph (<P> or <DIV>).<BR> * This is an Internet Explorer only feature. Other browsers insert the <BR> tag by default. * * @param value true/false * @throws JspException if value is not true or false */ public void setUseBROnCarriageReturn(String value) throws JspException { if (!value.equals("true") && !value.equals("false")) throw new JspException( "useBROnCarriageReturn attribute can only be true or false"); useBROnCarriageReturn = value; } /** * The toolbar is Expanded on startup, otherwise it is Collapsed and the user must click on it to show it. * * @param value true/false * @throws JspException if value is not true or false */ public void setToolbarStartExpanded(String value) throws JspException { if (!value.equals("true") && !value.equals("false")) throw new JspException( "ToolbarStartExpanded attribute can only be true or false"); toolbarStartExpanded = 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). * * @param value true/false * @throws JspException if value is not true or false */ public void setToolbarCanCollapse(String value) throws JspException { if (!value.equals("true") && !value.equals("false")) throw new JspException( "ToolbarCanCollapse attribute can only be true or false"); toolbarCanCollapse = value; } /** * Sets the colors that must be shown in the colors panels (in the toolbar). * * @param value colors */ public void setFontColors(String value) { fontColors = value; } /** * Sets the list of fonts to be shown in the "Font" toolbar command. * * @param value fonts */ public void setFontNames(String value) { fontNames = value; } /** * Sets the list of font sizes to be shown in the "Size" toolbar command. * * @param value sizes */ public void setFontSizes(String value) { fontSizes = value; } /** * Sets the list of formats to be shown in the "Format" toolbar command. * * @param value format list */ public void setFontFormats(String value) { fontFormats = value; } /** * Sets the path to the XML file that has the definitions and rules of the styles used by the "Style" toolbar command * * @param value path */ public void setStylesXmlPath(String value) { stylesXmlPath = value; } /** * Sets the URL of the page called when the user clicks the "Browse Server" button in the "Link" dialog window.<BR> * In this way, you can create your custom File Browser that is well integrated with your system. * * @param value path */ public void setLinkBrowserURL(String value) { linkBrowserURL = value; } /** * Sets the URL of the page called when the user clicks the "Browse Server" button in the "Image" dialog window.<BR> * In this way, you can create your custom Image Browser that is well integrated with your system. * * @param value path */ public void setImageBrowserURL(String value) { imageBrowserURL = value; } /** * Sets the URL of the page called when the user clicks the "Browse Server" button in the "Flash" dialog window.<BR> * In this way, you can create your custom Flash Browser that is well integrated with your system. * * @param value path */ public void setFlashBrowserURL(String value) { flashBrowserURL = value; } /** * Sets the URL of the upload handler called when the user clicks the "Send it to server" button in the "Link" dialog window.<BR> * In this way, you can create your custom Link Uploader that is well integrated with your system. * * @param value path */ public void setLinkUploadURL(String value) { linkUploadURL = value; } /** * Sets the URL of the upload handler called when the user clicks the "Send it to server" button in the "Image" dialog window.<BR> * In this way, you can create your custom Image Uploader that is well integrated with your system. * * @param value path */ public void setImageUploadURL(String value) { imageUploadURL = value; } /** * Sets the URL of the upload handler called when the user clicks the "Send it to server" button in the "Flash" dialog window.<BR> * In this way, you can create your custom Flash Uploader that is well integrated with your system. * * @param value path */ public void setFlashUploadURL(String value) { flashUploadURL = value; } /** * Initialize the FCKeditor container and set attributes * * @return EVAL_BODY_BUFFERED */ public int doStartTag() throws JspException { fcked = new FCKeditor((HttpServletRequest) pageContext.getRequest(), id); if (toolbarSet != null) fcked.setToolbarSet(toolbarSet); if (basePath != null) fcked.setBasePath(basePath); if (width != null) fcked.setWidth(width); if (height != null) fcked.setHeight(height); if (customConfigurationsPath != null) fcked.getConfig().put("CustomConfigurationsPath", customConfigurationsPath); if (editorAreaCSS != null) fcked.getConfig().put("EditorAreaCSS", editorAreaCSS); if (baseHref != null) fcked.getConfig().put("BaseHref", baseHref); if (skinPath != null) fcked.getConfig().put("SkinPath", skinPath); if (pluginsPath != null) fcked.getConfig().put("PluginsPath", pluginsPath); if (fullPage != null) fcked.getConfig().put("FullPage", fullPage); if (debug != null) fcked.getConfig().put("Debug", debug); if (autoDetectLanguage != null) fcked.getConfig().put("AutoDetectLanguage", autoDetectLanguage); if (defaultLanguage != null) fcked.getConfig().put("DefaultLanguage", defaultLanguage); if (contentLangDirection != null) fcked.getConfig().put("ContentLangDirection", contentLangDirection); if (enableXHTML != null) fcked.getConfig().put("EnableXHTML", enableXHTML); if (enableSourceXHTML != null) fcked.getConfig().put("EnableSourceXHTML", enableSourceXHTML); if (fillEmptyBlocks != null) fcked.getConfig().put("FillEmptyBlocks", fillEmptyBlocks); if (formatSource != null) fcked.getConfig().put("FormatSource", formatSource); if (formatOutput != null) fcked.getConfig().put("FormatOutput", formatOutput); if (formatIndentator != null) fcked.getConfig().put("FormatIndentator", formatIndentator); if (geckoUseSPAN != null) fcked.getConfig().put("GeckoUseSPAN", geckoUseSPAN); if (startupFocus != null) fcked.getConfig().put("StartupFocus", startupFocus); if (forcePasteAsPlainText != null) fcked.getConfig().put("ForcePasteAsPlainText", forcePasteAsPlainText); if (forceSimpleAmpersand != null) fcked.getConfig().put("ForceSimpleAmpersand", forceSimpleAmpersand); if (tabSpaces != null) fcked.getConfig().put("TabSpaces", tabSpaces); if (useBROnCarriageReturn != null) fcked.getConfig().put("UseBROnCarriageReturn", useBROnCarriageReturn); if (toolbarStartExpanded != null) fcked.getConfig().put("ToolbarStartExpanded", toolbarStartExpanded); if (toolbarCanCollapse != null) fcked.getConfig().put("ToolbarCanCollapse", toolbarCanCollapse); if (fontColors != null) fcked.getConfig().put("FontColors", fontColors); if (fontNames != null) fcked.getConfig().put("FontNames", fontNames); if (fontSizes != null) fcked.getConfig().put("FontSizes", fontSizes); if (fontFormats != null) fcked.getConfig().put("FontFormats", fontFormats); if (stylesXmlPath != null) fcked.getConfig().put("StylesXmlPath", stylesXmlPath); if (linkBrowserURL != null) fcked.getConfig().put("LinkBrowserURL", linkBrowserURL); if (imageBrowserURL != null) fcked.getConfig().put("ImageBrowserURL", imageBrowserURL); if (flashBrowserURL != null) fcked.getConfig().put("FlashBrowserURL", flashBrowserURL); if (linkUploadURL != null) fcked.getConfig().put("LinkUploadURL", linkUploadURL); if (imageUploadURL != null) fcked.getConfig().put("ImageUploadURL", imageUploadURL); if (flashUploadURL != null) fcked.getConfig().put("FlashUploadURL", flashUploadURL); return EVAL_BODY_BUFFERED; } /** * Retrive initial value to be edited and writes the HTML code in the page * * @return SKIP_BODY * @throws JspException if an error occurs while writing to the out buffer */ public int doAfterBody() throws JspException { BodyContent body = getBodyContent(); JspWriter writer = body.getEnclosingWriter(); String bodyString = body.getString(); fcked.setValue(bodyString); try { writer.println(fcked.create()); } catch (IOException ioe) { throw new JspException( "Error: IOException while writing to the user"); } return SKIP_BODY; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -