001: /***************************************************************
002: * This file is part of the [fleXive](R) project.
003: *
004: * Copyright (c) 1999-2008
005: * UCS - unique computing solutions gmbh (http://www.ucs.at)
006: * All rights reserved
007: *
008: * The [fleXive](R) project is free software; you can redistribute
009: * it and/or modify it under the terms of the GNU General Public
010: * License as published by the Free Software Foundation;
011: * either version 2 of the License, or (at your option) any
012: * later version.
013: *
014: * The GNU General Public License can be found at
015: * http://www.gnu.org/copyleft/gpl.html.
016: * A copy is found in the textfile GPL.txt and important notices to the
017: * license from the author are found in LICENSE.txt distributed with
018: * these libraries.
019: *
020: * This library is distributed in the hope that it will be useful,
021: * but WITHOUT ANY WARRANTY; without even the implied warranty of
022: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
023: * GNU General Public License for more details.
024: *
025: * For further information about UCS - unique computing solutions gmbh,
026: * please see the company website: http://www.ucs.at
027: *
028: * For further information about [fleXive](R), please see the
029: * project website: http://www.flexive.org
030: *
031: *
032: * This copyright notice MUST APPEAR in all copies of the file!
033: ***************************************************************/package com.flexive.shared.value;
034:
035: import java.util.Map;
036:
037: /**
038: * HTML Content, like FxString but with the optional <code>tidyHTML</code flag
039: *
040: * @author Markus Plesser (markus.plesser@flexive.com), UCS - unique computing solutions gmbh (http://www.ucs.at)
041: * @see FxString
042: * @see #isTidyHTML
043: */
044: public class FxHTML extends FxString {
045:
046: private static final long serialVersionUID = -3220473037731856950L;
047: /**
048: * tidy flag, if set
049: */
050: private boolean tidyHTML = false;
051:
052: /**
053: * Content is run through JTidy (http://jtidy.sourceforge.net) before its saved
054: *
055: * @return if content is run through tidy before saving
056: */
057: public boolean isTidyHTML() {
058: return tidyHTML;
059: }
060:
061: /**
062: * Enable or disable tidy before saving
063: *
064: * @param tidyHTML tidy flag
065: * @return this
066: */
067: public FxHTML setTidyHTML(boolean tidyHTML) {
068: this .tidyHTML = tidyHTML;
069: return this ;
070: }
071:
072: public FxHTML(boolean multiLanguage, Map<Long, String> translations) {
073: super (multiLanguage, translations);
074: }
075:
076: public FxHTML(boolean multiLanguage, long defaultLanguage,
077: Map<Long, String> translations) {
078: super (multiLanguage, defaultLanguage, translations);
079: }
080:
081: public FxHTML(boolean multiLanguage, long defaultLanguage,
082: String value) {
083: super (multiLanguage, defaultLanguage, value);
084: }
085:
086: public FxHTML(boolean multiLanguage, String value) {
087: super (multiLanguage, value);
088: }
089:
090: public FxHTML(Map<Long, String[]> translations, int pos) {
091: super (translations, pos);
092: }
093:
094: public FxHTML(FxHTML clone) {
095: super (clone);
096: }
097:
098: public FxHTML(FxString clone) {
099: super (clone);
100: }
101:
102: public FxHTML(Map<Long, String> translations) {
103: super (translations);
104: }
105:
106: public FxHTML(long defaultLanguage, Map<Long, String> translations) {
107: super (defaultLanguage, translations);
108: }
109:
110: public FxHTML(long defaultLanguage, String value) {
111: super (defaultLanguage, value);
112: }
113:
114: public FxHTML(String value) {
115: super (value);
116: }
117:
118: /**
119: * {@inheritDoc}
120: */
121: @Override
122: public FxHTML copy() {
123: return new FxHTML(this ).setTidyHTML(this .isTidyHTML());
124: }
125:
126: /**
127: * {@inheritDoc}
128: */
129: @Override
130: public Class<String> getValueClass() {
131: return String.class;
132: }
133: }
|