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 java.util.*;
034:
035: import de.ug2t.channel.markup.generic.*;
036: import de.ug2t.kernel.*;
037: import de.ug2t.unifiedGui.interfaces.*;
038:
039: public final class HtmlFormRenderer implements IKeView {
040: private MuGenericCache pem_cache = new MuGenericCache();
041: private MuGenericApplication pem_appl = null;
042:
043: public boolean pcmf_supportsCaching() {
044: return (true);
045: }
046:
047: public void pcmf_clearCache() {
048: this .pem_cache.pcmf_clearCache();
049: }
050:
051: public void pcmf_reset() {
052: this .pem_appl = null;
053: };
054:
055: public void pcmf_activateCache(boolean xAc) {
056: this .pem_cache.pcmf_activateThisCache(xAc);
057: return;
058: }
059:
060: public Object pcmf_output(KeTreeElement xTreeEl) {
061: MuGenericForm html_xTreeEl = (MuGenericForm) xTreeEl;
062:
063: // @@
064:
065: if (pem_appl == null) {
066: Object l_appl = KeRegisteredObject
067: .pcmf_getObjByName(IUnApplication.MY_APPL);
068: if (l_appl instanceof MuGenericApplication)
069: pem_appl = (MuGenericApplication) l_appl;
070: else
071: pem_appl = (MuGenericApplication) html_xTreeEl
072: .pcmf_getAppl();
073: }
074:
075: pem_appl.pcmf_getRenderer().pcmf_addScrollPos(
076: html_xTreeEl.pcmf_getScrollCrt());
077:
078: // @@
079:
080: KeStringTemplate l_string = html_xTreeEl
081: .pcmf_getMarkupString("MAIN");
082:
083: l_string = html_xTreeEl.pcmf_insertToolTip(l_string);
084: l_string = html_xTreeEl
085: .pcmf_insertColorandFontandBorder(l_string);
086: l_string = html_xTreeEl.pcmf_insertPosition(l_string);
087: l_string = html_xTreeEl.pcmf_insertChannelandMenu(l_string);
088: l_string = html_xTreeEl.pcmf_insertBgImage(l_string);
089:
090: l_string.pcmf_beginTR();
091:
092: l_string = KeTools.pcmf_stringSubst(l_string, "$URL", pem_appl
093: .pcmf_getHostName()
094: + ":"
095: + Integer.toString(pem_appl.pcmf_getPort())
096: + "/"
097: + pem_appl.pcmf_getRootUrl());
098: l_string = KeTools.pcmf_stringSubst(l_string, "$STATE", xTreeEl
099: .pcmf_getObjName());
100: l_string = KeTools.pcmf_stringSubst(l_string, "$PG_ID",
101: pem_appl.pcmf_getActive().pcmf_getObjName());
102: l_string = KeTools.pcmf_stringSubst(l_string, "$NAME",
103: html_xTreeEl.pcmf_getObjName());
104: l_string = KeTools.pcmf_stringSubst(l_string, "$OID",
105: html_xTreeEl.pcmf_getObjName());
106: l_string = KeTools.pcmf_stringSubst(l_string, "$PNAME",
107: html_xTreeEl.pcmf_getScrollCrt().pcmf_getObjName());
108: if (html_xTreeEl.pcmf_getScroll()) {
109: l_string = KeTools.pcmf_stringSubst(l_string, "$SCROLL",
110: "auto");
111: l_string = KeTools.pcmf_stringSubst(l_string,
112: "$POS_SCROLL", html_xTreeEl.pcmf_getScrollCrt()
113: .pcmf_getValue().toString());
114: } else {
115: l_string = KeTools.pcmf_stringSubst(l_string, "$SCROLL",
116: "hidden");
117: l_string = KeTools.pcmf_stringSubst(l_string,
118: "$POS_SCROLL", "");
119: }
120:
121: l_string.pcmf_endTR(true);
122:
123: // @@
124:
125: return (l_string);
126: };
127:
128: public Object pcmf_execView(KeTreeElement xTreeEl) {
129: return (xTreeEl.pcmf_execView());
130: };
131: };
|