001: // @@
002: // @@
003: /*
004: * Wi.Ser Framework
005: *
006: * Version: 1.8.1, 20-September-2007
007: * Copyright (C) 2005 Dirk von der Weiden <dvdw@imail.de>
008: *
009: * This library is free software; you can redistribute it and/or
010: * modify it under the terms of the GNU Lesser General Public
011: * License as published by the Free Software Foundation; either
012: * version 2 of the License, or (at your option) any later version.
013: *
014: * This library is distributed in the hope that it will be useful,
015: * but WITHOUT ANY WARRANTY; without even the implied warranty of
016: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
017: * Lesser General Public License for more details.
018: *
019: * You should have received a copy of the GNU Lesser General Public
020: * License along with this library located in LGPL.txt in the
021: * license directory; if not, write to the
022: * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
023: * Boston, MA 02111-1307, USA.
024: *
025: * If this agreement does not cover your requirements, please contact us
026: * via email to get detailed information about the commercial license
027: * or our service offerings!
028: *
029: */
030: // @@
031: package de.ug2t.channel.markup.html.renderer;
032:
033: import de.ug2t.channel.markup.generic.*;
034: import de.ug2t.kernel.*;
035: import de.ug2t.unifiedGui.interfaces.*;
036:
037: public final class HtmlCheckBoxRenderer implements IKeView {
038: private MuGenericCache pem_cache = new MuGenericCache();
039:
040: public boolean pcmf_supportsCaching() {
041: return (true);
042: }
043:
044: public void pcmf_clearCache() {
045: this .pem_cache.pcmf_clearCache();
046: }
047:
048: public void pcmf_activateCache(boolean xAc) {
049: this .pem_cache.pcmf_activateThisCache(xAc);
050: return;
051: }
052:
053: public Object pcmf_output(KeTreeElement xTreeEl) {
054: MuGenericCheckBox html_xTreeEl = (MuGenericCheckBox) xTreeEl;
055:
056: // @@
057:
058: KeStringTemplate l_string = html_xTreeEl
059: .pcmf_getMarkupString("MAIN");
060: IUnImage l_ico = html_xTreeEl.pcmf_getIcon();
061:
062: l_string = html_xTreeEl.pcmf_insertToolTip(l_string);
063: l_string = html_xTreeEl
064: .pcmf_insertColorandFontandBorder(l_string);
065: l_string = html_xTreeEl.pcmf_insertPosition(l_string);
066: l_string = html_xTreeEl.pcmf_insertChannelandMenu(l_string);
067: l_string = html_xTreeEl.pcmf_insertTabIndex(l_string);
068:
069: l_string.pcmf_beginTR();
070:
071: if (html_xTreeEl.pcmf_getWrap())
072: l_string = KeTools.pcmf_stringSubst(l_string, "$WRAP", "");
073: else
074: l_string = KeTools.pcmf_stringSubst(l_string, "$WRAP",
075: html_xTreeEl.pcmf_getMarkupString("NOWRAP")
076: .toString());
077:
078: if (html_xTreeEl.pcmf_getValue().equals(IUnCheckBox.NOTCHECKED))
079: KeTools.pcmf_stringSubst(l_string, "$CHECKED", "");
080: else
081: KeTools.pcmf_stringSubst(l_string, "$CHECKED", "checked");
082:
083: KeTools.pcmf_stringSubst(l_string, "$NAME", html_xTreeEl
084: .pcmf_getObjName());
085: KeTools.pcmf_stringSubst(l_string, "$OID", html_xTreeEl
086: .pcmf_getObjName());
087: KeTools.pcmf_stringSubst(l_string, "$STRING",
088: IUnKeyAccess.UnInsertHTMLString.pcmf_modValue(
089: (IUnKeyAccess) xTreeEl, html_xTreeEl
090: .pcmf_getLabel()));
091:
092: if (l_ico != null)
093: KeTools.pcmf_stringSubst(l_string, "$ICO", l_ico
094: .pcmf_getUnComponent().pcmf_execView().toString());
095: else
096: KeTools.pcmf_stringSubst(l_string, "$ICO", "");
097:
098: if (html_xTreeEl.pcmf_isDisabled())
099: KeTools.pcmf_stringSubst(l_string, "$DISABLED", "disabled");
100: else
101: KeTools.pcmf_stringSubst(l_string, "$DISABLED", "");
102:
103: if (html_xTreeEl.pcmf_isReadOnly())
104: KeTools.pcmf_stringSubst(l_string, "$READONLY", "readonly");
105: else
106: KeTools.pcmf_stringSubst(l_string, "$READONLY", "");
107:
108: if (html_xTreeEl.pcmf_isSubmit()) {
109: KeStringTemplate l_stpl = html_xTreeEl
110: .pcmf_getMarkupString("SUBMIT");
111: if (l_stpl != null)
112: KeTools.pcmf_stringSubst(l_string, "$SUBMIT", l_stpl);
113: else
114: KeTools.pcmf_stringSubst(l_string, "$SUBMIT",
115: html_xTreeEl.pcmf_getKit().getSUBMIT());
116: } else
117: KeTools.pcmf_stringSubst(l_string, "$SUBMIT", "");
118:
119: l_string = IUnKeyAccess.UnInsertHTMLString.pcmf_insert(
120: html_xTreeEl, l_string);
121:
122: l_string.pcmf_endTR(true);
123:
124: // @@
125:
126: return (l_string);
127: };
128:
129: public Object pcmf_execView(KeTreeElement xTreeEl) {
130: return (xTreeEl.pcmf_execView().toString());
131: };
132: };
|