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 HtmlTabbedPaneRenderer implements IKeView {
040: private MuGenericCache pem_cache = new MuGenericCache();
041:
042: public void pcmf_clearCache() {
043: this .pem_cache.pcmf_clearCache();
044: }
045:
046: public boolean pcmf_supportsCaching() {
047: return (true);
048: }
049:
050: public void pcmf_activateCache(boolean xAc) {
051: this .pem_cache.pcmf_activateThisCache(xAc);
052: return;
053: }
054:
055: public Object pcmf_output(KeTreeElement xTreeEl) {
056: MuGenericTabbedPane html_xTreeEl = (MuGenericTabbedPane) xTreeEl;
057:
058: // @@
059:
060: KeStringTemplate l_tabatpl = null;
061: KeStringTemplate l_tabtpl = null;
062: KeStringTemplate l_tabartpl = null;
063: KeStringTemplate l_tabrtpl = null;
064: KeStringTemplate l_string = null;
065:
066: MuGenericApplication l_appl = (MuGenericApplication) html_xTreeEl
067: .pcmf_getAppl();
068:
069: // @@
070:
071: if (!html_xTreeEl.pcmf_isTabDown()) {
072: l_string = html_xTreeEl.pcmf_getMarkupString("MAIN");
073: l_tabartpl = html_xTreeEl.pcmf_getMarkupString("TABAR");
074: l_tabrtpl = html_xTreeEl.pcmf_getMarkupString("TABR");
075: l_tabatpl = html_xTreeEl.pcmf_getMarkupString("TABA");
076: l_tabtpl = html_xTreeEl.pcmf_getMarkupString("TAB");
077: } else {
078: l_string = html_xTreeEl.pcmf_getMarkupString("MAIN_TDOWN");
079: l_tabartpl = html_xTreeEl
080: .pcmf_getMarkupString("TABAR_TDOWN");
081: l_tabrtpl = html_xTreeEl.pcmf_getMarkupString("TABR_TDOWN");
082: l_tabatpl = html_xTreeEl.pcmf_getMarkupString("TABA_TDOWN");
083: l_tabtpl = html_xTreeEl.pcmf_getMarkupString("TAB_TDOWN");
084: }
085:
086: l_string = html_xTreeEl.pcmf_insertToolTip(l_string);
087: l_string = html_xTreeEl
088: .pcmf_insertColorandFontandBorder(l_string);
089: l_string = html_xTreeEl.pcmf_insertPosition(l_string);
090: l_string = html_xTreeEl.pcmf_insertChannelandMenu(l_string);
091:
092: // Kopf zusammenbauen
093: KeStringTemplate l_headString = new KeStringTemplate("");
094: Iterator l_it = html_xTreeEl.pcmf_getSubNameIterator();
095: String l_key = null;
096: MuGenericForm l_form = null;
097: IUnImage l_icon = null;
098: int l_idx = 0;
099: while (l_it.hasNext()) {
100: l_key = (String) l_it.next();
101:
102: l_form = (MuGenericForm) html_xTreeEl
103: .pcmf_getSubNode(l_key);
104: l_icon = l_form.pcmf_getIcon();
105:
106: if (l_key.equals(html_xTreeEl.pcmf_getActiveName()))
107: l_headString
108: .pcmf_stringAddEnd(l_form.pcmf_isDisabled() ? l_tabartpl
109: : l_tabatpl);
110: else
111: l_headString
112: .pcmf_stringAddEnd(l_form.pcmf_isDisabled() ? l_tabrtpl
113: : l_tabtpl);
114:
115: l_headString.pcmf_beginTR();
116:
117: MuGenericComponent l_tabc = html_xTreeEl
118: .pcmf_getTabComponent(l_idx++);
119: if (l_tabc != null)
120: l_headString = KeTools.pcmf_stringSubst(l_headString,
121: "$PTITLE", l_tabc.pcmf_execView().toString());
122: else {
123: if (l_icon == null)
124: l_headString = KeTools.pcmf_stringSubst(
125: l_headString, "$PTITLE", l_key);
126: else
127: l_headString = KeTools.pcmf_stringSubst(
128: l_headString, "$PTITLE", l_icon
129: .pcmf_getUnComponent()
130: .pcmf_execView()
131: + l_key);
132: }
133:
134: l_headString = KeTools.pcmf_stringSubst(l_headString,
135: "$NAME", html_xTreeEl.pcmf_getObjName());
136: l_headString = KeTools.pcmf_stringSubst(l_headString,
137: "$CLICKED", l_key);
138:
139: l_headString.pcmf_endTR(true);
140: }
141: ;
142:
143: // Pane entsetzen
144: l_string.pcmf_beginTR();
145:
146: l_string = KeTools.pcmf_stringSubst(l_string, "$OID",
147: html_xTreeEl.pcmf_getObjName());
148: l_string = KeTools.pcmf_stringSubst(l_string, "$TAB",
149: l_headString);
150: l_string = KeTools.pcmf_stringSubst(l_string, "$URL", l_appl
151: .pcmf_getHostName()
152: + ":"
153: + Integer.toString(l_appl.pcmf_getPort())
154: + "/"
155: + l_appl.pcmf_getRootUrl());
156: l_string = KeTools.pcmf_stringSubst(l_string, "$PBODY",
157: html_xTreeEl.pcmf_getActive() != null ? html_xTreeEl
158: .pcmf_getActive().pcmf_execView().toString()
159: : "");
160:
161: l_string.pcmf_endTR(true);
162:
163: // @@
164:
165: return (l_string);
166: };
167:
168: public Object pcmf_execView(KeTreeElement xTreeEl) {
169: return (xTreeEl.pcmf_execView());
170: };
171: };
|