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 HtmlDialogRenderer implements IKeView {
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: /**
054: * <p>
055: * Does...
056: * </p>
057: * <p>
058: *
059: * @return a Type with
060: * </p>
061: * <p>
062: * @param
063: * </p>
064: */
065: public Object pcmf_execView(KeTreeElement xTreeEl) {
066: return (xTreeEl.pcmf_execView());
067: }
068:
069: /**
070: * <p>
071: * Does...
072: * </p>
073: * <p>
074: *
075: * @return a Type with
076: * </p>
077: * <p>
078: * @param
079: * </p>
080: */
081: private MuGenericCache pem_cache = new MuGenericCache();
082:
083: public Object pcmf_output(KeTreeElement xTreeEl) {
084: // @@
085:
086: MuGenericDialog l_dlg = (MuGenericDialog) xTreeEl;
087: MuGenericApplication l_appl = (MuGenericApplication) l_dlg
088: .pcmf_getAppl();
089:
090: // @@
091:
092: try {
093: if (l_dlg.pcmf_isHidden())
094: return ("");
095:
096: KeStringTemplate l_retval = new KeStringTemplate("");
097: KeStringTemplate l_body = new KeStringTemplate("");
098:
099: l_dlg.pcmf_setPosition(l_dlg.pcmf_getPosMark().pcmf_getX(),
100: l_dlg.pcmf_getPosMark().pcmf_getY(), l_dlg
101: .pcmf_getSizeMark().pcmf_getWi(), l_dlg
102: .pcmf_getSizeMark().pcmf_getHi(), null);
103: l_dlg.pcmf_setPropChanged(false);
104:
105: if (l_dlg.pcmf_isDisplay() == true) {
106: Iterator it = l_dlg.pcmf_getSubIterator();
107:
108: if (l_dlg.pcmf_getDeco())
109: l_retval = l_dlg.pcmf_getMarkupString("MAIN");
110: else
111: l_retval = l_dlg.pcmf_getMarkupString("NONDECO");
112:
113: if (l_dlg.pcmf_getMini() == false) {
114: Object l_obj = null;
115: if (!l_dlg.pcmf_isHidden()) {
116: while (it.hasNext()) {
117: l_obj = it.next();
118: l_body
119: .pcmf_stringAddEnd(((KeTreeElement) l_obj)
120: .pcmf_execView().toString());
121: }
122: ;
123: }
124: ;
125: }
126:
127: if (l_dlg.pcmf_getMini()) {
128: l_retval = KeTools.pcmf_stringSubst(l_retval,
129: "$SIZEBUTS", "");
130: l_retval = KeTools.pcmf_stringSubst(l_retval,
131: "$DRAGRSIZE", "");
132: } else {
133: if (l_dlg.pcmf_isResizable()) {
134: if (l_dlg.pcmf_getShowSizeButs()) {
135: l_retval = KeTools
136: .pcmf_stringSubstAppend(l_retval,
137: "$SIZEBUTS", l_dlg
138: .pcmf_getSubmitWP()
139: .pcmf_execView()
140: .toString(),
141: "$SIZEBUTS");
142: l_retval = KeTools
143: .pcmf_stringSubstAppend(l_retval,
144: "$SIZEBUTS", l_dlg
145: .pcmf_getSubmitWM()
146: .pcmf_execView()
147: .toString(),
148: "$SIZEBUTS");
149: l_retval = KeTools
150: .pcmf_stringSubstAppend(l_retval,
151: "$SIZEBUTS", l_dlg
152: .pcmf_getSubmitHP()
153: .pcmf_execView()
154: .toString(),
155: "$SIZEBUTS");
156: l_retval = KeTools
157: .pcmf_stringSubst(l_retval,
158: "$SIZEBUTS", l_dlg
159: .pcmf_getSubmitHM()
160: .pcmf_execView()
161: .toString());
162: } else
163: l_retval = KeTools.pcmf_stringSubst(
164: l_retval, "$SIZEBUTS", "");
165:
166: if (l_dlg.pcmf_isDisabled())
167: l_retval = KeTools.pcmf_stringSubst(
168: l_retval, "$DRAGRSIZE", "");
169: else
170: l_retval = KeTools
171: .pcmf_stringSubst(
172: l_retval,
173: "$DRAGRSIZE",
174: l_dlg
175: .pcmf_getMarkupString("DRAGRSIZE"));
176: } else {
177: l_retval = KeTools.pcmf_stringSubst(l_retval,
178: "$DRAGRSIZE", "");
179: l_retval = KeTools.pcmf_stringSubst(l_retval,
180: "$SIZEBUTS", "");
181: }
182: }
183:
184: if (l_appl.pcmf_getRenderer().pcmf_checkDialogStackTop(
185: l_dlg)
186: || l_dlg.pcmf_isDisabled())
187: l_retval = KeTools.pcmf_stringSubst(l_retval,
188: "$TFC", "");
189: else {
190: KeStringTemplate l_tfc = l_dlg
191: .pcmf_getMarkupString("TFC");
192: l_tfc.pcmf_stringSubst("$BFN", l_dlg
193: .pcmf_getSubmitFront().pcmf_getObjName());
194: l_retval = KeTools.pcmf_stringSubst(l_retval,
195: "$TFC", l_tfc.toString());
196: }
197:
198: l_retval.pcmf_beginTR();
199:
200: l_retval = KeTools.pcmf_stringSubst(l_retval, "$NAME",
201: l_dlg.pcmf_getObjName());
202: l_retval = KeTools.pcmf_stringSubst(l_retval, "$TITLE",
203: l_dlg.pcmf_getName());
204: l_retval = KeTools.pcmf_stringSubst(l_retval, "$PNAME",
205: l_dlg.pcmf_getPosMark().pcmf_getObjName());
206: l_retval = KeTools.pcmf_stringSubst(l_retval, "$SNAME",
207: l_dlg.pcmf_getSizeMark().pcmf_getObjName());
208:
209: if (l_dlg.pcmf_getShowCtrlButs()) {
210: if (!l_dlg.pcmf_isModal()) {
211: l_retval = KeTools.pcmf_stringSubst(l_retval,
212: "$LOCK", l_dlg.pcmf_getSubmitLock()
213: .pcmf_execView().toString());
214: l_retval = KeTools.pcmf_stringSubst(l_retval,
215: "$FRONT", l_dlg.pcmf_getSubmitFront()
216: .pcmf_execView().toString());
217: } else {
218: l_retval = KeTools.pcmf_stringSubst(l_retval,
219: "$LOCK", "");
220: l_retval = KeTools.pcmf_stringSubst(l_retval,
221: "$FRONT", "");
222: }
223: l_retval = KeTools.pcmf_stringSubst(l_retval,
224: "$MIMA", l_dlg.pcmf_getSubmitMiMa()
225: .pcmf_execView().toString());
226: l_retval = KeTools.pcmf_stringSubst(l_retval,
227: "$CLOSE", l_dlg.pcmf_getSubmitClose()
228: .pcmf_execView().toString());
229: } else {
230: l_retval = KeTools.pcmf_stringSubst(l_retval,
231: "$LOCK", "");
232: l_retval = KeTools.pcmf_stringSubst(l_retval,
233: "$CLOSE", "");
234: l_retval = KeTools.pcmf_stringSubst(l_retval,
235: "$FRONT", "");
236: l_retval = KeTools.pcmf_stringSubst(l_retval,
237: "$MIMA", "");
238: }
239:
240: l_retval = KeTools.pcmf_stringSubst(l_retval, "$URL",
241: l_appl.pcmf_getHostName()
242: + ":"
243: + Integer.toString(l_appl
244: .pcmf_getPort()) + "/"
245: + l_appl.pcmf_getRootUrl());
246: l_retval = KeTools.pcmf_stringSubst(l_retval, "$OID",
247: ((MuGenericComponent) xTreeEl)
248: .pcmf_getObjName());
249: if (l_dlg.pcmf_getScroll())
250: l_retval = KeTools.pcmf_stringSubst(l_retval,
251: "$SCROLL", "auto");
252: else
253: l_retval = KeTools.pcmf_stringSubst(l_retval,
254: "$SCROLL", "hidden");
255:
256: if (l_dlg.pcmf_isSubmit()
257: && l_dlg.pcmf_getGenerateReshapeEvents())
258: l_retval = KeTools.pcmf_stringSubst(l_retval,
259: "$SUBMIT", "SUBMIT");
260: else
261: l_retval = KeTools.pcmf_stringSubst(l_retval,
262: "$SUBMIT", "");
263:
264: l_retval.pcmf_endTR(true);
265:
266: l_retval = l_dlg.pcmf_insertToolTip(l_retval);
267: l_retval = l_dlg
268: .pcmf_insertColorandFontandBorder(l_retval);
269: l_retval = l_dlg.pcmf_insertPosition(l_retval);
270: l_retval = l_dlg.pcmf_insertChannelandMenu(l_retval);
271: l_retval = l_dlg.pcmf_insertBgImage(l_retval);
272:
273: l_retval = KeTools.pcmf_stringSubst(l_retval, "$BODY",
274: l_body.toString());
275: }
276:
277: String l_return = l_retval.toString();
278:
279: // @@
280:
281: return (l_return);
282: } catch (Exception e) {
283: KeLog.pcmf_logException("ug2t", l_dlg, e);
284: return ("ERROR");
285: }
286: }
287: }
|