KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > Raptor > listeners > quickEdit_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, and is available at
6  * http://www.eclipse.org/legal/cpl-v10.html
7  *
8  * Contributors:
9  * Dirk von der Weiden - initial API and implementation
10  *
11  * Created on 24.10.2004
12  *
13  * date: 24.10.2004
14  * project:
15  *
16  * *******************************************************************************/

17
18 package Raptor.listeners;
19
20 import java.util.*;
21
22 import Jmc.baseGui.*;
23 import Jmc.commonGui.*;
24 import Jmc.model.*;
25 import Jmc.baseTools.*;
26
27 import Raptor.model.*;
28
29
30 /**
31  * @author Dirk
32  *
33  * date: 24.10.2004
34  *
35  * <p>
36  * Purpose:
37  * </p>
38  */

39 public class quickEdit_li implements base_guiListener
40 {
41     /**
42      *
43      */

44     public quickEdit_li()
45     {
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     base_appl_if l_appl = xParam.pcmf_getAppl();
61     raptor_mainModel l_model = (raptor_mainModel)l_appl.pcmf_getGuiObj().pcmf_getModel();
62           
63     base_treeNode l_mVal = l_model.getPem_treeNodeSelection();
64     
65     if (l_mVal != null && l_mVal instanceof base_multipleModelValue_if == false)
66     {
67       base_singleModelValue_if l_iv = (base_singleModelValue_if)l_mVal.pcmf_getValue();
68       
69       if (l_iv.pcmf_getValue() != null && l_iv.pcmf_getValue().equals(xParam.pcmf_getValue().toString()))
70       {
71         xParam.pcmf_setBgColor("white");
72         return;
73       }
74
75       if (l_iv.pcmf_getUiMap() != null && l_iv.pcmf_getUiMap() instanceof base_comboBox_if)
76       {
77         if (((base_comboBox_if)l_iv.pcmf_getUiMap()).pcmf_getValues().get(xParam.pcmf_getValue().toString()) == null)
78         {
79           xParam.pcmf_setBgColor("red");
80           String JavaDoc l_values = "";
81           
82           Iterator l_it = ((base_comboBox_if)l_iv.pcmf_getUiMap()).pcmf_getValues().keySet().iterator();
83           while (l_it.hasNext())
84           {
85             l_values += l_it.next().toString();
86             if (l_it.hasNext())
87               l_values +=", ";
88           }
89           
90           l_model.pcmf_addMessage("- parameter error, must be: " + l_values, raptor_mainModel.RAPTOR_ERROR);
91           return;
92         }
93       }
94
95       Object JavaDoc l_ret = l_iv.pcmf_setValueValidate(xParam.pcmf_getValue().toString());
96       
97       if (l_ret != null && l_ret.equals(xParam.pcmf_getValue()) == false)
98         xParam.pcmf_setBgColor("white");
99       else
100       {
101         xParam.pcmf_setBgColor("red");
102         l_model.pcmf_addMessage("- parameter error", raptor_mainModel.RAPTOR_ERROR);
103         return;
104       }
105       
106       l_iv.pcmf_model2UI();
107       l_model.pcmf_createAutoWdgPreview();
108       l_appl.pcmf_getGuiObj().pcmf_repaint();
109     }
110     }
111 }
112
Popular Tags