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 HtmlSplitPaneRenderer implements IKeView {
040: private MuGenericCache pem_cache = new MuGenericCache();
041:
042: public boolean pcmf_supportsCaching() {
043: return (true);
044: }
045:
046: public void pcmf_clearCache() {
047: this .pem_cache.pcmf_clearCache();
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: MuGenericSplitPane html_xTreeEl = (MuGenericSplitPane) xTreeEl;
057:
058: // @@
059:
060: KeStringTemplate l_string = null;
061:
062: if (html_xTreeEl.pcmf_getSplitMode() == IUnSplitPane.HSPLIT)
063: l_string = html_xTreeEl.pcmf_getMarkupString("HSPLIT");
064: else
065: l_string = html_xTreeEl.pcmf_getMarkupString("VSPLIT");
066:
067: l_string = html_xTreeEl.pcmf_insertToolTip(l_string);
068: l_string = html_xTreeEl
069: .pcmf_insertColorandFontandBorder(l_string);
070: l_string = html_xTreeEl.pcmf_insertPosition(l_string);
071: l_string = html_xTreeEl.pcmf_insertChannelandMenu(l_string);
072:
073: int l_fp1 = html_xTreeEl.pcmf_getSplitPercent();
074: int l_fp2 = l_fp1 + html_xTreeEl.pcmf_getSliderPercent();
075: int l_fp3 = 100 - l_fp2;
076:
077: l_string.pcmf_beginTR();
078:
079: l_string = l_string.pcmf_stringSubst("$SW", Integer
080: .toString(html_xTreeEl.pcmf_getSliderPercent()));
081: l_string = l_string.pcmf_stringSubst("$S1", Integer
082: .toString(l_fp1));
083: l_string = l_string.pcmf_stringSubst("$S2", Integer
084: .toString(l_fp2));
085: l_string = l_string.pcmf_stringSubst("$S3", Integer
086: .toString(l_fp3));
087: l_string = l_string.pcmf_stringSubst("$B1_NAME", html_xTreeEl
088: .pcmf_getSubmitW1().pcmf_getUnComponent()
089: .pcmf_getObjName());
090: l_string = l_string.pcmf_stringSubst("$B2_NAME", html_xTreeEl
091: .pcmf_getSubmitW2().pcmf_getUnComponent()
092: .pcmf_getObjName());
093: l_string = l_string.pcmf_stringSubst("$B3_NAME", html_xTreeEl
094: .pcmf_getSubmitW3().pcmf_getUnComponent()
095: .pcmf_getObjName());
096: l_string = l_string.pcmf_stringSubst("$B4_NAME", html_xTreeEl
097: .pcmf_getSubmitW4().pcmf_getUnComponent()
098: .pcmf_getObjName());
099: l_string = l_string.pcmf_stringSubst("$B5_NAME", html_xTreeEl
100: .pcmf_getSubmitW5().pcmf_getUnComponent()
101: .pcmf_getObjName());
102: l_string = KeTools.pcmf_stringSubst(l_string, "$OID",
103: html_xTreeEl.pcmf_getObjName());
104:
105: KeTreeNode l_b1 = html_xTreeEl
106: .pcmf_getSubNode(MuGenericSplitPane.FNAME);
107: KeTreeNode l_b2 = html_xTreeEl
108: .pcmf_getSubNode(MuGenericSplitPane.SNAME);
109:
110: try {
111: if (l_b1 == null)
112: l_b1 = (KeTreeNode) html_xTreeEl.pcmf_getAllSubs().get(
113: 0);
114:
115: if (l_b2 == null)
116: l_b2 = (KeTreeNode) html_xTreeEl.pcmf_getAllSubs().get(
117: 1);
118: } catch (Exception e) {
119: KeLog.pcmf_log("ug2t", "2 forms required in splitPane",
120: this , KeLog.MESSAGE);
121: }
122:
123: if (l_b1 != null)
124: l_string = l_string.pcmf_stringSubst("$BODY1", l_b1
125: .pcmf_execView().toString());
126: else
127: l_string = l_string.pcmf_stringSubst("$BODY1", "");
128:
129: if (l_b2 != null)
130: l_string = l_string.pcmf_stringSubst("$BODY2", l_b2
131: .pcmf_execView().toString());
132: else
133: l_string = l_string.pcmf_stringSubst("$BODY2", "");
134:
135: if (xTreeEl.pcmf_isDisabled())
136: l_string.pcmf_stringSubst("$DISABLED", "disabled");
137: else
138: l_string.pcmf_stringSubst("$DISABLED", "");
139:
140: l_string.pcmf_endTR(true);
141:
142: // @@
143:
144: return (l_string);
145: };
146:
147: public Object pcmf_execView(KeTreeElement xTreeEl) {
148: return (xTreeEl.pcmf_execView());
149: };
150: };
|