KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > packager > listeners > GetInput_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 DeployTool
14  *
15  *******************************************************************************/

16
17 package packager.listeners;
18
19 import Jmc.baseGui.*;
20 import Jmc.commonGui.*;
21 import Jmc.baseTools.*;
22
23 /**
24  * @author Dirk
25  *
26  * date: 13.04.2004
27  * project: DeployTool
28  *
29  * <p>
30  * This listener's execution method is called when the option dialog "opt1" or "opt2" has been confirmed.
31  * </p>
32  */

33 /* Corresponding XML definition code:
34  * ----------------------------------
35  *
36  * The following lines from the xml_gui/packager.xml file show the corresponding configuration:
37  *
38  * <optDlg name = "opt1" submit="true" register = "optDlg1">
39  * <srvListener object = "AddZip_listener"/>
40  * </optDlg>
41  * <optDlg name = "opt2" submit="true" register = "optDlg2">
42  * <srvListener object = "AddFolder_listener"/>
43  * </optDlg>
44  *
45  * The tag <srvListener> connects the listener objects to widgets. In this case the attribute "object" is used
46  * which means that initialised instance of a listener object has to be available. This instances are created
47  * by the following xScript calls in the file xml_script/packager_init.xml:
48  *
49  * <Declare objname = "GetName_listener1" objtype = "packager.listeners.GetInput_li" objctx = "forever">
50  * <Parameter value = "optDlg1" objtype = "java.lang.String" obj = "false"/>
51  * </Declare>
52  * <Declare objname = "GetName_listener2" objtype = "packager.listeners.GetInput_li" objctx = "forever">
53  * <Parameter value = "optDlg2" objtype = "java.lang.String" obj = "false"/>
54  * </Declare>
55  *
56  */

57 public class GetInput_li implements base_guiListener, base_executableObject_if
58 {
59   private String JavaDoc pem_name = null;
60     
61   /**
62      * initialise with the registred name of the corresponding option dialog
63      */

64     public GetInput_li(String JavaDoc l_name)
65     {
66     this.pem_name = l_name;
67     }
68
69   /**
70      * <p>
71      * Execution method of the listener
72      * </p><p>
73      *
74      * </p><p>
75      * @param xParam widget which provided the event
76      * </p>
77      */

78     public void pcmf_execListener(base_guiObj xParam) throws Exception JavaDoc
79     {
80     // without any further words
81
base_optionDlg_if l_dlg = (base_optionDlg_if)base_registredObject.pcmf_getObjByName(pem_name);
82     l_dlg.pcmf_showTextInput("please enter name");
83     
84     return;
85     }
86
87     /**
88          * <p>
89          * Does...
90          * </p><p>
91          *
92          * @return a Type with
93          * </p><p>
94          * @param xObj
95          * </p>
96          */

97     public Object JavaDoc pcmf_execObj(Object JavaDoc xObj)
98     {
99     try
100     {
101       this.pcmf_execListener((base_guiObj)xObj);
102     }
103     catch (Exception JavaDoc e)
104     {
105       base_log.pcmf_logException("packager", this, e);
106     }
107         return null;
108     }
109
110 }
111
Popular Tags