KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > Raptor > listeners > openCBrowser2_li


1 /*******************************************************************************
2  * Copyright (c) 2004, Dirk von der Weiden.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Common Public License v1.0
5  * which accompanies this distribution.
6  *
7  * Contributors:
8  * Dirk von der Weiden - initial API and implementation
9  *
10  * Created on 04.04.2004
11  *
12  * date: 04.04.2004
13  * project: WiSer Builder
14  *
15  *******************************************************************************/

16
17 package Raptor.listeners;
18
19 import Jmc.baseGui.*;
20 import Jmc.commonGui.*;
21 import Jmc.connector.*;
22 import Jmc.baseTools.*;
23 import java.util.*;
24
25 /**
26  * @author Dirk
27  *
28  * date: 13.02.2004
29  * project: WiSer-Builder
30  *
31  * <p>
32  * ...
33  * </p>
34  */

35 public class openCBrowser2_li implements base_guiListener
36 {
37   private remote_treeNode pem_listEntries = new remote_treeNode("le");
38   private base_guiObj pem_input = null;
39   
40   /**
41    *
42    */

43   public openCBrowser2_li() throws Exception JavaDoc
44   {
45     super();
46   }
47
48   /**
49      * <p>
50      * Does...
51      * </p><p>
52      *
53      * @return a Type with
54      * </p><p>
55      * @param
56      * </p>
57      */

58   public void pcmf_execListener(base_guiObj xParam) throws Exception JavaDoc
59   {
60     classBrowser l_cBrowser = new classBrowser();
61     Vector l_classes = null;
62     
63     ((base_guiObj)base_registredObject.pcmf_getObjByName("CBrowserIf")).pcmf_setValue("plugins");
64     base_dialog_if l_br = (base_dialog_if)base_registredObject.pcmf_getObjByName("CBrowser_dlg");
65     base_listBox_if l_list = (base_listBox_if)base_registredObject.pcmf_getObjByName("CBrowserList");
66     l_list.pcmf_clearListBox();
67     
68     // Liste leeren
69
this.pem_listEntries.pcmf_clearAndRelease();
70     
71     // zugehöriges Inputfeld setzen
72
this.pem_input = (base_guiObj)xParam.pcmf_getParentNode().pcmf_getSubNode("Input");
73     
74     // interface lesen
75
Class JavaDoc l_cl = Class.forName("Jmc.commonGui.base_guiWidget_if");
76     
77     // Workaround für ServletContainer mit wegen ClassLoader
78
String JavaDoc l_addCp = (String JavaDoc)base_environment.pcmf_getParameter("environment.xml", "SERVLET", "CLASSPATH");
79     l_addCp = base_tools.pcmf_stringSubst(l_addCp, "{$ROOT}", base_environment.pcmf_getRootDir());
80     l_classes = l_cBrowser.pcmf_getClasses(l_addCp, l_cl);
81             
82     Iterator l_it = l_classes.iterator();
83     remote_treeNode l_node = null;
84     Class JavaDoc l_cl2 = null;
85     while (l_it.hasNext())
86     {
87       l_cl2=(Class JavaDoc)l_it.next();
88       l_node = new remote_treeNode(l_cl2.toString());
89       l_node.pcmf_setValue(l_cl2.toString());
90       l_node.pcmf_setIcon((base_image_if)base_registredObject.pcmf_getObjByName("class_icon"));
91       pem_listEntries.pcmf_addNode(l_cl2.toString(), l_node);
92       l_list.pcmf_addValueObj(l_cl2.toString(), l_node);
93     }
94     l_br.pcmf_displayDialog();
95     l_list.pcmf_setSelectedRow(0);
96   }
97   
98   public void pcmf_setSelection()
99   {
100     String JavaDoc l_res = (String JavaDoc)((base_listBox_if)base_registredObject.pcmf_getObjByName("CBrowserList")).pcmf_getValue();
101
102     if (l_res != null && l_res.equals("") == false)
103       this.pem_input.pcmf_setValue(l_res.substring(6));
104   }
105 }
Popular Tags