- Timestamp:
- 2008-07-03 00:03:15 (6 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
FCKeditor.Java/trunk/java-core/src/main/java/net/fckeditor/FCKeditor.java
r2146 r2151 30 30 31 31 /** 32 * FCKeditor class.<br />33 * It creates the html code forthe FCKeditor based on the following things:32 * Java represantation of the FCKeditor. This class creates the html code for 33 * the FCKeditor based on the following things: 34 34 * <ul> 35 35 * <li>browser capabilities</li> … … 107 107 * Set the unique name of the editor 108 108 * 109 * @param value109 * @param instanceName 110 110 * name 111 111 */ 112 public void setInstanceName(final String value) {113 instanceName = value;112 public void setInstanceName(final String instanceName) { 113 this.instanceName = instanceName; 114 114 } 115 115 … … 129 129 * path from the context (e.g. /fckeditor). 130 130 * 131 * @param value131 * @param basePath 132 132 * path 133 133 */ 134 public void setBasePath(final String value) {135 basePath = value;134 public void setBasePath(final String basePath) { 135 this.basePath = basePath; 136 136 } 137 137 … … 139 139 * Set the name of the toolbar to display 140 140 * 141 * @param value141 * @param toolbarSet 142 142 * toolbar name 143 143 */ 144 public void setToolbarSet(final String value) {145 t oolbarSet = value;144 public void setToolbarSet(final String toolbarSet) { 145 this.toolbarSet = toolbarSet; 146 146 } 147 147 … … 149 149 * Set the width of the textarea 150 150 * 151 * @param value151 * @param width 152 152 * width 153 153 */ 154 public void setWidth(final String value) {155 width = value;154 public void setWidth(final String width) { 155 this.width = width; 156 156 } 157 157 … … 159 159 * Set the height of the textarea 160 160 * 161 * @param value161 * @param height 162 162 * height 163 163 */ 164 public void setHeight(final String value) {165 height = value;164 public void setHeight(final String height) { 165 this.height = height; 166 166 } 167 167 … … 176 176 return config; 177 177 } 178 179 /** 180 * Set the advanced configuration set. 181 * 182 * @param value 178 /** 179 * Set the advanced configuation set. 180 * 181 * @param config 183 182 * configuration collection 184 183 */ 185 public void setConfig(FCKeditorConfig value) {186 config = value;184 public void setConfig(FCKeditorConfig config) { 185 this.config = config; 187 186 } 188 187 189 188 /** 190 189 * Escape base XML entities as specified <a 191 * href="http://en.wikipedia.org/wiki/Xml#Entity_references">here</a> 192 * 193 * @param txt190 * href="http://en.wikipedia.org/wiki/Xml#Entity_references">here</a>. 191 * 192 * @param str 194 193 * Text to escape. 195 194 * @return Escaped text. 196 195 */ 197 private String escapeXml(String txt) { 198 if (Utils.isEmpty(txt)) 199 return txt; 200 txt = txt.replaceAll("&", "&"); 201 txt = txt.replaceAll("<", "<"); 202 txt = txt.replaceAll(">", ">"); 203 txt = txt.replaceAll("\"", """); 204 txt = txt.replaceAll("'", "'"); 205 return txt; 206 } 207 208 /* 209 * (non-Javadoc) 210 * @see #createHtml() 211 */ 212 public String create() { 213 return createHtml(); 196 private String escapeXml(String str) { 197 if (Utils.isEmpty(str)) 198 return str; 199 200 /* 201 * TODO Strings are inefficent. It should be done like in Commons Lang 202 * 2.4 StringUtils#replaceEach(String, String[], String[]) 203 */ 204 str = str.replaceAll("&", "&"); 205 str = str.replaceAll("<", "<"); 206 str = str.replaceAll(">", ">"); 207 str = str.replaceAll("\"", """); 208 str = str.replaceAll("'", "'"); 209 return str; 214 210 } 215 211 216 212 /* 217 213 * (non-Javadoc) 214 * 215 * @see #createHtml() 216 */ 217 /** 218 * This method simply wraps to {@link #createHtml()}. 218 219 * @see #createHtml() 219 220 */