KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jdesktop > swing > binding > FormBinding


1 /*
2  * $Id: FormBinding.java,v 1.1.1.1 2004/06/16 01:43:39 davidson1 Exp $
3  *
4  * Copyright 2004 Sun Microsystems, Inc., 4150 Network Circle,
5  * Santa Clara, California 95054, U.S.A. All rights reserved.
6  */

7
8 package org.jdesktop.swing.binding;
9
10 import org.jdesktop.swing.data.Converters;
11 import org.jdesktop.swing.data.Converter;
12 import org.jdesktop.swing.data.DataModel;
13 import org.jdesktop.swing.data.MetaData;
14 import org.jdesktop.swing.data.Validator;
15
16 import org.jdesktop.swing.form.JForm;
17
18 import java.util.ArrayList JavaDoc;
19 import java.util.List JavaDoc;
20
21 import javax.swing.InputVerifier JavaDoc;
22 import javax.swing.JComponent JavaDoc;
23
24 /**
25  * Class which binds a JForm component to a data model field which is
26  * type DataModel in order to support nested data models.
27  *
28  * @author Amy Fowler
29  * @version 1.0
30  */

31
32 public class FormBinding extends AbstractBinding {
33     protected JForm form;
34
35     public FormBinding(JForm form, DataModel dataModel, String JavaDoc fieldName) {
36         super(form, dataModel, fieldName, Binding.AUTO_VALIDATE_NONE);
37     }
38
39     public boolean pull() {
40         return form.pull();
41     }
42
43     public boolean isModified() {
44         return form.isModified();
45     }
46
47     /**
48      *
49      */

50     public boolean isValid() {
51         return form.isFormValid();
52     }
53
54     public JComponent JavaDoc getComponent() {
55         return form;
56     }
57
58     protected void setComponent(JComponent JavaDoc component) {
59         form = (JForm)component;
60     }
61
62     protected Object JavaDoc getComponentValue() {
63         // no-op
64
return null;
65     }
66
67     protected void setComponentValue(Object JavaDoc value) {
68         // no-op
69
}
70
71     public boolean push() {
72         return form.push();
73     }
74 }
75
Popular Tags