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.generic;
032:
033: import java.util.*;
034:
035: import de.ug2t.channel.markup.html.renderer.*;
036: import de.ug2t.connector.*;
037: import de.ug2t.kernel.*;
038: import de.ug2t.unifiedGui.interfaces.*;
039:
040: public final class MuGenericEmbeddedPanel extends MuGenericForm {
041: private IKeView pem_view = new HtmlEmbeddedPanelRenderer();
042:
043: public MuGenericEmbeddedPanel(String xName,
044: ACoDataGetter xTplGetter, Object xTplName,
045: MuGenericApplication xAppl) throws Exception {
046: super (xName, xTplGetter, xTplName, xAppl);
047:
048: this .pcmf_setView(pem_view);
049: this .pcmf_setValue(xName);
050: this .pcmf_setBgColor(this .pdm_kit.getPANEL_BG());
051:
052: return;
053: };
054:
055: public Object pcmf_execView() {
056: try {
057: KeStringTemplate l_retval = null;
058: KeStringTemplate l_body = new KeStringTemplate("");
059:
060: Iterator it = this .pcmf_getSubIterator();
061:
062: l_retval = (KeStringTemplate) pdm_NodeView
063: .pcmf_output(this );
064:
065: if (((MuGenericApplication) this .pcmf_getAppl())
066: .pcmf_getRootPane().pcmf_getValue().equals(
067: this .pcmf_getObjName())) {
068: IMuGenericLayoutManager l_layout = this
069: .pcmf_getLayoutManager();
070: if (l_layout == null) {
071: if (!this .pcmf_isHidden()) {
072: Object l_obj = null;
073: while (it.hasNext()) {
074: l_obj = it.next();
075: if (l_obj instanceof IUnMenu) {
076: if (l_obj instanceof MuGenericContextMenu)
077: ((MuGenericContextMenu) l_obj)
078: .pcmf_setShowInPage(true);
079:
080: l_retval = KeTools.pcmf_stringSubst(
081: l_retval, "$MENU",
082: ((KeTreeElement) l_obj)
083: .pcmf_execView()
084: .toString());
085: } else
086: l_body
087: .pcmf_stringAddEnd(((KeTreeElement) l_obj)
088: .pcmf_execView()
089: .toString());
090: }
091: }
092: } else {
093: l_layout.pcmf_layout();
094: l_body.pcmf_stringAddEnd(l_layout
095: .pcmf_getMarkupString());
096: }
097:
098: l_retval = KeTools.pcmf_stringSubst(l_retval, "$MENU",
099: "");
100: l_retval = KeTools.pcmf_stringSubst(l_retval, "$BODY",
101: l_body.toString());
102: }
103: return (l_retval.toString());
104: } catch (Exception e) {
105: KeLog.pcmf_logException("ug2t", this , e);
106: return ("ERROR");
107: }
108: };
109: }
|