KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > Raptor > initClass


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;
18
19 import Jmc.baseTools.*;
20 import Jmc.commonGui.*;
21 import Jmc.baseGui.*;
22 import Jmc.views.*;
23 import Jmc.model.*;
24
25 import Raptor.model.*;
26
27 import java.util.*;
28
29 public class initClass implements base_executableObject_if
30 {
31     public Object JavaDoc pcmf_execObj(Object JavaDoc xObj)
32     {
33     base_appl_if l_appl = (base_appl_if)xObj;
34
35     try
36     {
37       // Application Tree vorbereiten
38
base_treeNode l_root = (base_treeNode)l_appl.pcmf_getGuiObj().pcmf_getModelTpl().pcmf_cloneModelValue(true, false);
39       base_treeView_if l_tr = (base_treeView_if)base_registredObject.pcmf_getObjByName("atree");
40
41       l_root.pcmf_setView(new iconValue_view((base_image_if)base_registredObject.pcmf_getObjByName("jmc_icon")));
42       l_root.pcmf_addNode("application", (base_treeNode)l_appl.pcmf_getGuiObj().pcmf_newModelValue("application", true));
43       l_root.pcmf_setName("applications");
44     
45       l_tr.pcmf_setRoot(l_root);
46       l_tr.pcmf_setWidgetValue(l_root);
47         
48       l_tr.pcmf_getGuiObj().pcmf_repaint();
49
50       // Settings einsortieren
51
raptor_mainModel l_model = (raptor_mainModel)l_appl.pcmf_getGuiObj().pcmf_getModel();
52
53       base_guiObj l_pathw= l_model.getPem_pathWin();
54       l_pathw.pcmf_setValue("applications");
55
56       ((base_guiObj)base_registredObject.pcmf_getObjByName("ViewerField")).pcmf_setValue(l_model.getPem_settings().getPem_iePath());
57       ((base_guiObj)base_registredObject.pcmf_getObjByName("PathField")).pcmf_setValue(l_model.getPem_settings().getPem_tmpPath());
58
59       ((base_guiObj)base_registredObject.pcmf_getObjByName("TAPP_TARGET")).pcmf_setValue(l_model.getPem_settings().getPem_tapp_target());
60       ((base_guiObj)base_registredObject.pcmf_getObjByName("TAPP_ROOT")).pcmf_setValue(l_model.getPem_settings().getPem_tapp_root());
61       ((base_guiObj)base_registredObject.pcmf_getObjByName("TAPP_COMMAND")).pcmf_setValue(l_model.getPem_settings().getPem_tapp_command());
62       ((base_guiObj)base_registredObject.pcmf_getObjByName("TAPP_URL")).pcmf_setValue(l_model.getPem_settings().getPem_tapp_url());
63       ((base_guiObj)base_registredObject.pcmf_getObjByName("TAPP_COPY")).pcmf_setValue(l_model.getPem_settings().getPem_tapp_copy());
64       ((base_guiObj)base_registredObject.pcmf_getObjByName("restoreDesktop")).pcmf_setValue(l_model.getPem_settings().isPem_doRestore()?base_checkBox_if.CHECKED:base_checkBox_if.NOTCHECKED);
65
66       Iterator l_it = l_model.getPem_settings().getPem_tplKits().iterator();
67       Object JavaDoc l_val= null;
68       while (l_it.hasNext())
69       {
70         l_val = l_it.next();
71         ((base_comboBox_if)base_registredObject.pcmf_getObjByName("FactConfCombo")).pcmf_addValue(l_val.toString(),l_val.toString());
72       }
73       ((base_comboBox_if)base_registredObject.pcmf_getObjByName("FactConfCombo")).pcmf_setValue(l_model.getPem_settings().getPem_actTplKit());
74       ((base_guiObj)base_registredObject.pcmf_getObjByName("FactField")).pcmf_setValue(l_model.getPem_settings().getPem_actTplKitPar());
75       l_model.pcmf_loadTplKitValues(l_model.getPem_settings().getPem_actTplKit());
76    
77       l_model.getPem_settings().pcmf_readPluginDef();
78       l_model.getPem_settings().pcmf_showPlDetail();
79       
80       base_comboBox_if l_cb = (base_comboBox_if)base_registredObject.pcmf_getObjByName("Plugin_la");
81       ArrayList l_alist = l_model.getPem_factory().pcmf_getAggregatedPlugins();
82       l_it = l_alist.iterator();
83       while (l_it.hasNext())
84       {
85         String JavaDoc l_sval = l_it.next().toString();
86         l_cb.pcmf_addValue(l_sval,l_sval);
87       }
88       l_model.setPem_root((base_modelValue_if)l_root);
89       l_model.pcmf_saveTransaction();
90
91       l_appl.pcmf_disableLazyWidgets();
92             
93       l_model.pcmf_loadDesktopSettings();
94       l_model.pcmf_restoreDesktop();
95                  
96       base_log.pcmf_log(l_appl.pcmf_getGuiObj().pcmf_getName(), "Application startup complete", this, base_log.MESSAGE);
97     }
98     catch (Exception JavaDoc e)
99     {
100       base_log.pcmf_log(l_appl.pcmf_getGuiObj().pcmf_getName(), "Error during application startup", this, base_log.ERROR);
101     }
102
103         return null;
104     }
105 }
Popular Tags