01: // @@
02: // @@
03: /*
04: * Wi.Ser Framework
05: *
06: * Version: 1.8.1, 20-September-2007
07: * Copyright (C) 2005 Dirk von der Weiden <dvdw@imail.de>
08: *
09: * This library is free software; you can redistribute it and/or
10: * modify it under the terms of the GNU Lesser General Public
11: * License as published by the Free Software Foundation; either
12: * version 2 of the License, or (at your option) any later version.
13: *
14: * This library is distributed in the hope that it will be useful,
15: * but WITHOUT ANY WARRANTY; without even the implied warranty of
16: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17: * Lesser General Public License for more details.
18: *
19: * You should have received a copy of the GNU Lesser General Public
20: * License along with this library located in LGPL.txt in the
21: * license directory; if not, write to the
22: * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23: * Boston, MA 02111-1307, USA.
24: *
25: * If this agreement does not cover your requirements, please contact us
26: * via email to get detailed information about the commercial license
27: * or our service offerings!
28: *
29: */
30: // @@
31: package de.ug2t.channel.markup.generic;
32:
33: import de.ug2t.connector.*;
34: import de.ug2t.kernel.*;
35: import de.ug2t.unifiedGui.*;
36: import de.ug2t.unifiedGui.interfaces.*;
37:
38: public final class MuGenericTreeMenu extends MuGenericTreeView
39: implements IUnMenu {
40: protected UnMenuFunction pdm_active;
41:
42: class MuTreeMenuListener implements IUnGuiEventListener {
43: public void pcmf_execListener(UnComponent xParam) {
44: MuGenericTreeMenu l_menu = (MuGenericTreeMenu) xParam;
45: Object l_clicked = l_menu.pcmf_getValue();
46:
47: if (l_clicked instanceof UnMenuFunction) {
48: Object l_ret = ((UnMenuFunction) l_clicked)
49: .pcmf_execObj(xParam);
50: if (l_ret == null)
51: KeLog.pcmf_log("ug2t",
52: "calling disabled menuItem (no function executed): "
53: + l_clicked, this , KeLog.MESSAGE);
54: else
55: KeLog.pcmf_log("ug2t", "calling menuItem: "
56: + l_clicked, this , KeLog.MESSAGE);
57: }
58: ;
59:
60: return;
61: };
62: };
63:
64: public MuGenericTreeMenu(String xName, KeTreeNode xRoot,
65: ACoDataGetter xTplGetter, Object xTplName,
66: MuGenericApplication xAppl) throws Exception {
67: super (xName, xRoot, xTplGetter, xTplName, xAppl);
68:
69: this .pcmf_setEventOnChange(true);
70: this .pcmf_addListener(new MuTreeMenuListener());
71: this .pcmf_setGlobal(true);
72:
73: return;
74: };
75:
76: public void pcmf_commitMenu() {
77: pdm_root.pcmf_hideLevel(1);
78: return;
79: };
80:
81: public void pcmf_setMenuWidth(int xWi) {
82: // Does nothing
83: KeLog.pcmf_log("ug2t", "pcmf_setMenuWidth is not implemented",
84: this, KeLog.DEBUG);
85: }
86: }
|