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 HtmlButtonRenderer 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: MuGenericButton html_xTreeEl = (MuGenericButton) xTreeEl;
055:
056: // @@
057:
058: KeStringTemplate l_string = html_xTreeEl
059: .pcmf_getMarkupString("MAIN");
060: KeStringTemplate l_iString = html_xTreeEl
061: .pcmf_getMarkupString("IPT");
062:
063: IUnImage l_ico = html_xTreeEl.pcmf_getIcon();
064:
065: if (xTreeEl.pcmf_getValue() instanceof MuGenericComponent
066: && !(xTreeEl.pcmf_getValue() instanceof MuGenericButton)) {
067: l_string = KeTools.pcmf_stringSubst(l_string, "$VALUE",
068: (String) ((MuGenericComponent) xTreeEl
069: .pcmf_getValue()).pcmf_execView());
070: l_string = KeTools.pcmf_stringSubst(l_string, "$ICON", "");
071: } else {
072: if (l_ico != null) {
073: l_string = KeTools.pcmf_stringSubst(l_string, "$ICON",
074: l_ico.pcmf_getUnComponent().pcmf_execView()
075: .toString());
076: l_string = KeTools.pcmf_stringSubst(l_string, "$VALUE",
077: IUnKeyAccess.UnInsertHTMLString.pcmf_modValue(
078: (IUnKeyAccess) xTreeEl,
079: ((MuGenericComponent) xTreeEl)
080: .pcmf_getValue().toString()));
081: } else {
082: l_string = l_iString;
083: l_string = KeTools.pcmf_stringSubst(l_string, "$VALUE",
084: IUnKeyAccess.UnInsertHTMLString.pcmf_modValue(
085: (IUnKeyAccess) xTreeEl,
086: ((MuGenericComponent) xTreeEl)
087: .pcmf_getValue().toString()));
088: l_string = KeTools.pcmf_stringSubst(l_string, "$ICON",
089: "");
090: }
091: }
092: ;
093:
094: l_string = html_xTreeEl.pcmf_insertToolTip(l_string);
095: l_string = html_xTreeEl
096: .pcmf_insertColorandFontandBorder(l_string);
097: l_string = html_xTreeEl.pcmf_insertPosition(l_string);
098: l_string = html_xTreeEl.pcmf_insertChannelandMenu(l_string);
099: l_string = html_xTreeEl.pcmf_insertTabIndex(l_string);
100:
101: l_string = KeTools.pcmf_stringSubst(l_string, "$NAME",
102: html_xTreeEl.pcmf_getObjName());
103: l_string = KeTools.pcmf_stringSubst(l_string, "$OID",
104: html_xTreeEl.pcmf_getObjName());
105:
106: if (html_xTreeEl.pcmf_isDisabled())
107: l_string = KeTools.pcmf_stringSubst(l_string, "$DISABLED",
108: "disabled");
109: else
110: l_string = KeTools.pcmf_stringSubst(l_string, "$DISABLED",
111: "");
112:
113: if (html_xTreeEl.pcmf_isReadOnly())
114: l_string = KeTools.pcmf_stringSubst(l_string, "$READONLY",
115: "readonly");
116: else
117: l_string = KeTools.pcmf_stringSubst(l_string, "$READONLY",
118: "");
119:
120: l_string = IUnKeyAccess.UnInsertHTMLString.pcmf_insert(
121: html_xTreeEl, l_string);
122:
123: // @@
124:
125: return (l_string);
126: };
127:
128: public Object pcmf_execView(KeTreeElement xTreeEl) {
129: return (xTreeEl.pcmf_execView());
130: };
131: };
|