KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tonbeller > wcf > test > TestBean


1 /*
2  * ====================================================================
3  * This software is subject to the terms of the Common Public License
4  * Agreement, available at the following URL:
5  * http://www.opensource.org/licenses/cpl.html .
6  * Copyright (C) 2003-2004 TONBELLER AG.
7  * All Rights Reserved.
8  * You must accept the terms of that agreement to use this software.
9  * ====================================================================
10  *
11  *
12  */

13 package com.tonbeller.wcf.test;
14
15 import com.tonbeller.wcf.controller.RequestContext;
16 import com.tonbeller.wcf.form.FormBean;
17 import com.tonbeller.wcf.form.FormComponent;
18 import com.tonbeller.wcf.selection.SelectionChangeEvent;
19 import com.tonbeller.wcf.selection.SelectionChangeListener;
20 import com.tonbeller.wcf.table.TableModel;
21 import com.tonbeller.wcf.table.TestModel;
22 import com.tonbeller.wcf.tree.TestTreeModel;
23 import com.tonbeller.wcf.tree.TreeModel;
24
25 public class TestBean implements FormBean {
26
27   class MyTableModel extends TestModel implements SelectionChangeListener {
28     public MyTableModel() {
29       super.setTitle(null);
30     }
31
32     public void selectionChanged(SelectionChangeEvent event) {
33       //System.out.println("table selection changed");
34
}
35   };
36
37   class MyTreeModel extends TestTreeModel implements SelectionChangeListener {
38     public void selectionChanged(SelectionChangeEvent event) {
39       //System.out.println("tree selection changed");
40
}
41   };
42
43   String JavaDoc stringValue = "some String";
44   int intValue = 123;
45
46   TableModel tableValue = new MyTableModel();
47   TreeModel treeValue = new MyTreeModel();
48
49   public int getIntValue() {
50     return intValue;
51   }
52
53   public String JavaDoc getStringValue() {
54     return stringValue;
55   }
56
57   public void setIntValue(int i) {
58     intValue = i;
59   }
60
61   public void setStringValue(String JavaDoc string) {
62     stringValue = string;
63   }
64
65   public TableModel getTableValue() {
66     return tableValue;
67   }
68
69   public TreeModel getTreeValue() {
70     return treeValue;
71   }
72
73   public void testAction(RequestContext context) throws Exception JavaDoc {
74     System.out.println("testhandler called");
75   }
76
77   /**
78    * implement FormBean - this allows us to access the ui, e.g.
79    * hide some input elements or change the selectionmodel of an
80    * embedded tree component.
81    */

82   public void setFormComponent(RequestContext context, FormComponent form) {
83   }
84 }
85
Popular Tags