KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > helloworld > listeners > HelloWorldTableChange_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 26.02.2005
12  *
13  * date: 26.02.2005
14  * project: WiSer-HelloWorld
15  *
16  * *******************************************************************************/

17
18 package helloworld.listeners;
19
20 import Jmc.baseGui.base_guiListener;
21 import Jmc.commonGui.*;
22 import Jmc.commonGui.loader.*;
23 import Jmc.baseTools.*;
24 import Jmc.baseGui.*;
25
26 /**
27  * @author Dirk
28  *
29  * date: 13.02.2005
30  *
31  * <p>
32  * Purpose: The listener changes a value of the table.
33  * </p>
34  */

35 public class HelloWorldTableChange_li implements base_guiListener
36 {
37   /**
38      * <p>
39      * Is called by the framework whenever an event has been fired by the corresponding widget
40      * </p><p>
41      *
42      * </p><p>
43      * @param Widget which generated the event
44      * </p>
45      */

46   public void pcmf_execListener(base_guiObj xParam) throws Exception JavaDoc
47   {
48     // get all relevant widgets from the registry
49
base_table_if l_table=(base_table_if) base_registredObject.pcmf_getObjByName("atable");
50     base_tableLoader l_load = (base_tableLoader)base_registredObject.pcmf_getObjByName("tableLoader");
51     base_inputField_if l_inp = (base_inputField_if)base_registredObject.pcmf_getObjByName("myTableValueInput");
52     base_inputField_if l_inpR = (base_inputField_if)base_registredObject.pcmf_getObjByName("myTableRowInput");
53     base_inputField_if l_inpC = (base_inputField_if)base_registredObject.pcmf_getObjByName("myTableColInput");
54
55     // set value
56
l_load.pcmf_getModel().setValueAt(l_inp.pcmf_getValue(), Integer.parseInt(l_inpR.pcmf_getValue().toString()), Integer.parseInt(l_inpC.pcmf_getValue().toString()));
57     l_table.pcmf_repaint();
58     
59     return;
60   }
61 }
62
Popular Tags