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:
037: public final class HtmlLinkRenderer implements IKeView {
038: private MuGenericCache pem_cache = new MuGenericCache();
039:
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: public Object pcmf_output(KeTreeElement xTreeEl) {
054: MuGenericLink html_xTreeEl = (MuGenericLink) xTreeEl;
055:
056: // @@
057:
058: MuGenericApplication l_appl = (MuGenericApplication) html_xTreeEl
059: .pcmf_getAppl();
060: KeStringTemplate l_string = null;
061:
062: if (html_xTreeEl.pcmf_isDisabled())
063: l_string = html_xTreeEl.pcmf_getMarkupString("DISABLED");
064: else {
065: if (html_xTreeEl.pcmf_getFixedSize() == null)
066: l_string = html_xTreeEl.pcmf_getMarkupString("MAIN");
067: else
068: l_string = html_xTreeEl.pcmf_getMarkupString("MAINF");
069: }
070:
071: IUnImage l_ico = html_xTreeEl.pcmf_getIcon();
072:
073: l_string = html_xTreeEl.pcmf_insertToolTip(l_string);
074: l_string = html_xTreeEl
075: .pcmf_insertColorandFontandBorder(l_string);
076: l_string = html_xTreeEl.pcmf_insertPosition(l_string);
077: l_string = html_xTreeEl.pcmf_insertChannelandMenu(l_string);
078:
079: l_string.pcmf_beginTR();
080:
081: if (html_xTreeEl.pcmf_getWrap())
082: l_string = KeTools.pcmf_stringSubst(l_string, "$WRAP", "");
083: else
084: l_string = KeTools.pcmf_stringSubst(l_string, "$WRAP",
085: html_xTreeEl.pcmf_getMarkupString("NOWRAP")
086: .toString());
087:
088: int l_talign = html_xTreeEl.pcmf_getTextAlign();
089: if (l_talign == IUnInputField.TEXT_ALIGN_EAST)
090: KeTools.pcmf_stringSubst(l_string, "$TALIGN", "right");
091: else if (l_talign == IUnInputField.TEXT_ALIGN_CENTER)
092: KeTools.pcmf_stringSubst(l_string, "$TALIGN", "center");
093: else
094: KeTools.pcmf_stringSubst(l_string, "$TALIGN", "left");
095:
096: l_string = KeTools.pcmf_stringSubst(l_string, "$URL", l_appl
097: .pcmf_getHostName()
098: + ":"
099: + Integer.toString(l_appl.pcmf_getPort())
100: + "/"
101: + l_appl.pcmf_getRootUrl());
102: l_string = KeTools.pcmf_stringSubst(l_string, "$NAME",
103: html_xTreeEl.pcmf_getObjName());
104: l_string = KeTools.pcmf_stringSubst(l_string, "$VALUE",
105: IUnKeyAccess.UnInsertHTMLString.pcmf_modValue(
106: (IUnKeyAccess) xTreeEl,
107: ((MuGenericComponent) xTreeEl).pcmf_getValue()
108: .toString()));
109: l_string = KeTools.pcmf_stringSubst(l_string, "$OID",
110: html_xTreeEl.pcmf_getObjName());
111:
112: if (l_ico == null)
113: l_string = KeTools.pcmf_stringSubst(l_string, "$ICON", "");
114: else {
115: l_string = KeTools.pcmf_stringSubst(l_string, "$ICON",
116: l_ico.pcmf_getUnComponent().pcmf_execView()
117: .toString());
118: }
119:
120: l_string = IUnKeyAccess.UnInsertHTMLString.pcmf_insert(
121: html_xTreeEl, l_string);
122: l_string.pcmf_endTR(true);
123:
124: // @@
125:
126: return (l_string);
127: };
128:
129: public Object pcmf_execView(KeTreeElement xTreeEl) {
130: return (xTreeEl.pcmf_execView());
131: };
132: };
|