001: /*
002: * Wi.Ser Framework
003: *
004: * Version: 1.8.1, 20-September-2007
005: * Copyright (C) 2005 Dirk von der Weiden <dvdw@imail.de>
006: *
007: * This library is free software; you can redistribute it and/or
008: * modify it under the terms of the GNU Lesser General Public
009: * License as published by the Free Software Foundation; either
010: * version 2 of the License, or (at your option) any later version.
011: *
012: * This library is distributed in the hope that it will be useful,
013: * but WITHOUT ANY WARRANTY; without even the implied warranty of
014: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015: * Lesser General Public License for more details.
016: *
017: * You should have received a copy of the GNU Lesser General Public
018: * License along with this library located in LGPL.txt in the
019: * license directory; if not, write to the
020: * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
021: * Boston, MA 02111-1307, USA.
022: *
023: * If this agreement does not cover your requirements, please contact us
024: * via email to get detailed information about the commercial license
025: * or our service offerings!
026: *
027: */
028: package de.ug2t.channel.markup.html.renderer;
029:
030: import de.ug2t.channel.markup.generic.*;
031: import de.ug2t.kernel.*;
032:
033: public class HtmlAnchoredPopupRenderer extends
034: AMuGenericComponentRenderer {
035:
036: public String pcmf_render(MuGenericComponent xWidget) {
037: MuGenericAnchoredPopup html_xTreeEl = (MuGenericAnchoredPopup) xWidget;
038:
039: Object l_popup = null;
040: KeStringTemplate l_templ = html_xTreeEl
041: .pcmf_getMarkupString("MAIN");
042: KeStringTemplate l_templ2 = html_xTreeEl
043: .pcmf_getMarkupString("ITEM");
044: KeStringTemplate l_string = new KeStringTemplate(l_templ2);
045:
046: l_templ = html_xTreeEl.pcmf_insertToolTip(l_templ);
047: l_templ = html_xTreeEl
048: .pcmf_insertColorandFontandBorder(l_templ);
049: l_templ = html_xTreeEl.pcmf_insertPosition(l_templ);
050: l_templ = html_xTreeEl.pcmf_insertChannelandMenu(l_templ);
051: l_templ = html_xTreeEl.pcmf_insertTabIndex(l_templ);
052:
053: l_popup = html_xTreeEl.pcmf_getNodeAt(0);
054:
055: l_string.pcmf_beginTR();
056:
057: l_popup = ((MuGenericComponent) l_popup).pcmf_execView()
058: .toString();
059: l_string = KeTools.pcmf_stringSubst(l_string, "$STRING",
060: l_popup.toString());
061:
062: l_string.pcmf_endTR(true);
063:
064: l_templ.pcmf_beginTR();
065:
066: l_templ = KeTools.pcmf_stringSubst(l_templ, "$ITEMS", l_string);
067:
068: l_templ = KeTools.pcmf_stringSubst(l_templ, "$NAME",
069: html_xTreeEl.pcmf_getObjName());
070: l_templ = KeTools.pcmf_stringSubst(l_templ, "$OID",
071: html_xTreeEl.pcmf_getObjName());
072: l_templ = KeTools
073: .pcmf_stringSubst(l_templ, "$HOFFS", Integer
074: .toString(html_xTreeEl
075: .pcmf_getPopUpHorizontalOffset()));
076: l_templ = KeTools.pcmf_stringSubst(l_templ, "$VOFFS", Integer
077: .toString(html_xTreeEl.pcmf_getPopUpVerticalOffset()));
078:
079: KeStringTemplate l_disp = html_xTreeEl
080: .pcmf_getMarkupString("DISPLAY");
081: l_disp
082: .pcmf_stringSubst("$NAME", html_xTreeEl
083: .pcmf_getObjName());
084:
085: if (html_xTreeEl.pcmf_isDisplay())
086: l_disp.pcmf_stringSubst("$DISP", "true");
087: else
088: l_disp.pcmf_stringSubst("$DISP", "false");
089:
090: ((MuGenericApplication) html_xTreeEl.pcmf_getAppl())
091: .pcmf_getRenderer().pcmf_addCommand(l_disp.toString());
092:
093: if (html_xTreeEl.pcmf_getIcon() != null)
094: l_templ = KeTools.pcmf_stringSubst(l_templ, "$IMG",
095: html_xTreeEl.pcmf_getIcon().pcmf_getUnComponent()
096: .pcmf_execView().toString()
097: + html_xTreeEl.pcmf_getValue().toString());
098: else
099: l_templ = KeTools.pcmf_stringSubst(l_templ, "$IMG",
100: html_xTreeEl.pcmf_getValue().toString());
101:
102: if (html_xTreeEl.pcmf_isDisabled())
103: l_templ = KeTools.pcmf_stringSubst(l_templ, "$DISABLED",
104: "disabled");
105: else
106: l_templ = KeTools
107: .pcmf_stringSubst(l_templ, "$DISABLED", "");
108:
109: l_templ.pcmf_endTR(true);
110:
111: String l_return = l_templ.toString();
112:
113: return (l_return);
114: }
115:
116: }
|