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: import de.ug2t.xmlScript.*;
037:
038: public final class HtmlLabelRenderer implements IKeView {
039: private MuGenericCache pem_cache = new MuGenericCache();
040:
041: public boolean pcmf_supportsCaching() {
042: return (true);
043: }
044:
045: public void pcmf_clearCache() {
046: this .pem_cache.pcmf_clearCache();
047: }
048:
049: public void pcmf_activateCache(boolean xAc) {
050: this .pem_cache.pcmf_activateThisCache(xAc);
051: return;
052: }
053:
054: public Object pcmf_output(KeTreeElement xTreeEl) {
055: MuGenericLabel html_xTreeEl = (MuGenericLabel) xTreeEl;
056:
057: // @@
058:
059: KeStringTemplate l_string = null;
060:
061: if ((html_xTreeEl.pcmf_getFixedSize() == null
062: && !html_xTreeEl.pcmf_getHFill()
063: && !html_xTreeEl.pcmf_getVFill() || html_xTreeEl
064: .pcmf_isInlineForced()))
065: l_string = html_xTreeEl.pcmf_getMarkupString("MAIN");
066: else
067: l_string = html_xTreeEl.pcmf_getMarkupString("MAINF");
068:
069: IUnImage l_ico = html_xTreeEl.pcmf_getIcon();
070:
071: l_string = html_xTreeEl.pcmf_insertToolTip(l_string);
072: l_string = html_xTreeEl
073: .pcmf_insertColorandFontandBorder(l_string);
074: l_string = html_xTreeEl.pcmf_insertPosition(l_string);
075: l_string = html_xTreeEl.pcmf_insertChannelandMenu(l_string);
076:
077: Object l_obj = html_xTreeEl.pcmf_getValue();
078: if (l_obj == null)
079: l_obj = "";
080:
081: String l_value = l_obj.toString();
082: String l_derefVal = KeTools.pcmf_deRef(l_value);
083:
084: String l_svalue = ScXmlScript.pcmf_filterSignsHTML(l_derefVal);
085: if (l_svalue.equals(" "))
086: l_svalue = " ";
087:
088: l_string.pcmf_beginTR();
089:
090: if (html_xTreeEl.pcmf_getWrap())
091: l_string = KeTools.pcmf_stringSubst(l_string, "$WRAP", "");
092: else
093: l_string = KeTools.pcmf_stringSubst(l_string, "$WRAP",
094: html_xTreeEl.pcmf_getMarkupString("NOWRAP")
095: .toString());
096:
097: int l_talign = html_xTreeEl.pcmf_getTextAlign();
098: if (l_talign == IUnInputField.TEXT_ALIGN_EAST)
099: KeTools.pcmf_stringSubst(l_string, "$TALIGN", "right");
100: else if (l_talign == IUnInputField.TEXT_ALIGN_CENTER)
101: KeTools.pcmf_stringSubst(l_string, "$TALIGN", "center");
102: else
103: KeTools.pcmf_stringSubst(l_string, "$TALIGN", "left");
104:
105: KeTools.pcmf_stringSubst(l_string, "$TEXT", l_svalue);
106: if (l_ico != null)
107: KeTools.pcmf_stringSubst(l_string, "$ICO", l_ico
108: .pcmf_getUnComponent().pcmf_execView().toString());
109: else
110: KeTools.pcmf_stringSubst(l_string, "$ICO", "");
111:
112: KeTools.pcmf_stringSubst(l_string, "$OID", html_xTreeEl
113: .pcmf_getObjName());
114:
115: l_string.pcmf_endTR(true);
116:
117: // @@
118:
119: return (l_string);
120: };
121:
122: public Object pcmf_execView(KeTreeElement xTreeEl) {
123: return (xTreeEl.pcmf_execView());
124: };
125: };
|