Index: /FCKeditor.Java/branches/2.4/src/main/java/net/fckeditor/FCKeditor.java
===================================================================
--- /FCKeditor.Java/branches/2.4/src/main/java/net/fckeditor/FCKeditor.java (revision 1341)
+++ /FCKeditor.Java/branches/2.4/src/main/java/net/fckeditor/FCKeditor.java (revision 1342)
@@ -28,6 +28,6 @@
/**
* FCKeditor control class.
- * It's the container for all properties and the class that generate the output based on browser capabilities and
- * configurations passed by the developer.
+ * It's the container for all properties and the class that generate the output
+ * based on browser capabilities and configurations passed by the developer.
*
* @version $Id$
@@ -35,272 +35,286 @@
public class FCKeditor {
- private FCKeditorConfigurations oConfig;
- private String instanceName;
- private String value;
- private String basePath;
- private String toolbarSet;
- private String width;
- private String height;
-
- private HttpServletRequest request;
-
- /**
- * Initialize the object setting all basic configurations.
- *
- * The basePath is context root + {@link ConfigurationHandler#getFckEditorDir()}.
- *
- * @param request
- * request object
- * @param instanceName
- * unique name
- * @param width
- * width
- * @param height
- * height
- * @param toolbarSet
- * toolbarSet name
- * @param value
- * initial value
- */
- public FCKeditor(final HttpServletRequest request, final String instanceName, final String width,
- final String height, final String toolbarSet, final String value) {
- this.request = request;
- // TODO muss das mit einem Slash abgeschlossen werden?
- this.basePath = request.getContextPath() + ConfigurationHandler.getFckEditorDir() + "/";
- this.instanceName = instanceName;
-
- // set defaults, if required
- this.value = (value == null) ? "" : value;
- this.toolbarSet = (toolbarSet == null) ? ConfigurationHandler.getFckEditorToolbarSet() : toolbarSet;
- this.width = (width == null) ? ConfigurationHandler.getFckEditorWidth() : width;
- this.height = (height == null) ? ConfigurationHandler.getFckEditorHeight() : height;
-
- oConfig = new FCKeditorConfigurations();
- }
-
- /**
- * Just a wrapper to {@link FCKeditor}.
- *
- * @param req
- * request object
- * @param parInstanceName
- * unique name
- */
- public FCKeditor(HttpServletRequest req, String parInstanceName) {
- this(req, parInstanceName, null, null, null, null);
- }
-
- /**
- * Get the unique name of the editor
- *
- * @return name
- */
- public String getInstanceName() {
- return instanceName;
- }
-
- /**
- * Set the unique name of the editor
- *
- * @param value
- * name
- */
- public void setInstanceName(String value) {
- instanceName = value;
- }
-
- /**
- * Get the initial value to be edited.
- * In HTML code
- *
- * @return value
- */
- public String getValue() {
- return value;
- }
-
- /**
- * Set the initial value to be edited.
- * In HTML code
- *
- * @param value
- * value
- */
- public void setValue(String value) {
- this.value = value;
- }
-
- /**
- * Get the dir where the FCKeditor files reside on the server
- *
- * @return path
- */
- public String getBasePath() {
- return basePath;
- }
-
- /**
- * Set the dir where the FCKeditor files reside on the server.
- * Remarks:
- * Avoid using relative paths. It is preferable to set the base path starting from the root (/).
- * Always finish the path with a slash (/).
- *
- * @param value
- * path
- */
- public void setBasePath(String value) {
- basePath = value;
- }
-
- /**
- * Get the name of the toolbar to display
- *
- * @return toolbar name
- */
- public String getToolbarSet() {
- return toolbarSet;
- }
-
- /**
- * Set the name of the toolbar to display
- *
- * @param value
- * toolbar name
- */
- public void setToolbarSet(String value) {
- toolbarSet = value;
- }
-
- /**
- * Get the width of the textarea
- *
- * @return width
- */
- public String getWidth() {
- return width;
- }
-
- /**
- * Set the width of the textarea
- *
- * @param value
- * width
- */
- public void setWidth(String value) {
- width = value;
- }
-
- /**
- * Get the height of the textarea
- *
- * @return height
- */
- public String getHeight() {
- return height;
- }
-
- /**
- * Set the height of the textarea
- *
- * @param value
- * height
- */
- public void setHeight(String value) {
- height = value;
- }
-
- /**
- * Get the advanced configuation set.
- * Adding element to this collection you can override the settings specified in the config.js file.
- *
- * @return configuration collection
- */
- public FCKeditorConfigurations getConfig() {
- return oConfig;
- }
-
- /**
- * Set the advanced configuation set.
- *
- * @param value
- * configuration collection
- */
- public void setConfig(FCKeditorConfigurations value) {
- oConfig = value;
- }
-
- // TODO Methoden fangen mit Kleinbuchstaben an
- private String HTMLEncode(String txt) {
- txt = txt.replaceAll("&", "&");
- txt = txt.replaceAll("<", "<");
- txt = txt.replaceAll(">", ">");
- txt = txt.replaceAll("\"", """);
- txt = txt.replaceAll("'", "");
- return txt;
- }
-
- /**
- * Generate the HTML Code for the editor.
- * Evalute the browser capabilities and generate the editor if compatible, or a simple textarea otherwise.
- *
- * @return html code
- */
- public String create() {
- // TODO Eventuell StringBuilder, da der schneller ist
- // Wie sind dann aber in Multiuser env
- StringBuffer strEditor = new StringBuffer();
-
- strEditor.append("