KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > Raptor > listeners > createNewFactConf_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.baseTools.*;
22 import Jmc.connector.*;
23
24 /**
25  * @author Dirk
26  *
27  * date: 15.02.2004
28  * project: WiSer-Builder
29  *
30  * <p>
31  * ...
32  * </p>
33  */

34 public class createNewFactConf_li implements base_guiListener
35 {
36     public void pcmf_execListener(base_guiObj xParam) throws Exception JavaDoc
37     {
38     base_dialog_if l_br = (base_dialog_if)base_registredObject.pcmf_getObjByName("NewFactConfig_dlg");
39     String JavaDoc l_cpname = (String JavaDoc)((base_guiObj)base_registredObject.pcmf_getObjByName("NewFactCopyCombo")).pcmf_getValue();
40     String JavaDoc l_name = (String JavaDoc)((base_guiObj)base_registredObject.pcmf_getObjByName("NewFactName")).pcmf_getValue();
41     String JavaDoc l_path = (String JavaDoc)((base_guiObj)base_registredObject.pcmf_getObjByName("NewFactPath")).pcmf_getValue();
42     
43     if (l_name != null && l_path != null)
44     {
45       if (base_environment.pcmf_getParameter("environment.xml", l_name, "FACTORY_DEF") != null)
46       {
47         ((base_optionDlg_if)base_registredObject.pcmf_getObjByName("optDlg")).pcmf_showAlert("Can not create an existing configuration");
48         return;
49       }
50       String JavaDoc l_cpyPath = (String JavaDoc)base_environment.pcmf_getParameter("environment.xml", l_cpname, "FACTORY_DEF");
51       xml_parameterWriter l_writer = new xml_parameterWriter();
52       l_writer.pcmf_writeSource(null, l_cpyPath, l_path);
53       base_environment.pcmf_setParameter("environment.xml", "templateKitMap", l_name, "environment.xml");
54       base_environment.pcmf_addParameterCluster("environment.xml", l_name);
55       base_environment.pcmf_setParameter("environment.xml", l_name, "FACTORY_DEF", l_path);
56       l_writer.pcmf_writeSource(base_environment.pcmf_getParameterGetter(), "environment.xml", "environment.xml");
57       ((base_comboBox_if)base_registredObject.pcmf_getObjByName("FactConfCombo")).pcmf_addValue(l_name,l_name);
58     }
59         
60     l_br.pcmf_hideDialog();
61     }
62
63 }
Popular Tags