FCKeditorConfigurations.java
资源名称:Myblog.rar [点击查看]
上传用户:wlfwy2004
上传日期:2016-12-12
资源大小:33978k
文件大小:2k
源码类别:
Jsp/Servlet
开发平台:
Java
- /*
- * FCKeditor - The text editor for internet
- * Copyright (C) 2003-2005 Frederico Caldeira Knabben
- *
- * Licensed under the terms of the GNU Lesser General Public License:
- * http://www.opensource.org/licenses/lgpl-license.php
- *
- * For further information visit:
- * http://www.fckeditor.net/
- *
- * File Name: FCKeditorConfigurations.java
- * FCKeditor configurations container.
- *
- * Version: 2.1
- * Modified: 2005-03-29 21:30:00
- *
- * File Authors:
- * Simone Chiaretta (simo@users.sourceforge.net)
- */
- package com.fredck.FCKeditor;
- import java.util.*;
- /**
- * Contains the configuration settings for the FCKEditor.<br>
- * Adding element to this collection you can override the settings specified in the config.js file.
- *
- * @author Simone Chiaretta (simo@users.sourceforge.net)
- */
- public class FCKeditorConfigurations
- extends HashMap {
- /**
- * Initialize the configuration collection
- */
- public FCKeditorConfigurations() {
- super();
- }
- /**
- * Generate the url parameter sequence used to pass this configuration to the editor.
- *
- *
- *@return html endocode sequence of configuration parameters
- */
- public String getUrlParams() {
- StringBuffer osParams = new StringBuffer();
- for (Iterator i = this.entrySet().iterator(); i.hasNext(); ) {
- Map.Entry entry = (Map.Entry) i.next();
- if (entry.getValue() != null) {
- osParams.append("&" + encodeConfig(entry.getKey().toString()) + "=" +
- encodeConfig(entry.getValue().toString()));
- }
- }
- return osParams.toString();
- }
- private String encodeConfig(String txt) {
- txt = txt.replaceAll("&", "%26");
- txt = txt.replaceAll("=", "%3D");
- txt = txt.replaceAll(""", "%22");
- return txt;
- }
- }