Statistics
| Revision:

gvsig-tools / org.gvsig.tools / library / trunk / org.gvsig.tools / org.gvsig.tools.dynform / org.gvsig.tools.dynform.api / src / main / java / org / gvsig / tools / dynform / JDynFormField.java @ 2035

History | View | Annotate | Download (2.61 KB)

1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 3
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
package org.gvsig.tools.dynform;
25

    
26
import javax.swing.Action;
27
import javax.swing.JComponent;
28
import org.gvsig.tools.dynobject.DynObject;
29

    
30
import org.gvsig.tools.swing.api.Component;
31

    
32
public interface JDynFormField extends Component {
33
        
34
        public interface JDynFormFieldListener {
35
                public void fieldEnter(JDynFormField field);
36
                public void fieldExit(JDynFormField field);
37
                public void fieldChanged(JDynFormField field);
38
                public void message(JDynFormField field, String message);
39
        }
40
        
41
        public DynFormFieldDefinition getDefinition();
42
        
43
        public String getName();
44
        
45
        public String getLabel();
46
        
47
        public JComponent getJLabel();
48

    
49
        public boolean useEmptyLabel();
50
        
51
        public String getSeparatorTitleToUseBefore();
52
        
53
        public boolean hasValidValue();
54
        
55
        public void setValue(Object value);
56
        
57
        public boolean isModified();
58
        
59
        /**
60
         * Get the value of field from the form.
61
         * 
62
         * Throw an exception if the value of form is not valid
63
         * for this field.
64
         * 
65
         * @return value of field 
66
         */
67
        public Object getValue();
68
        
69
        /**
70
         * Get the value from field and put it in the container.
71
         * 
72
         * @param container 
73
         */
74
        public void fetch(DynObject container);
75
        
76
        public void addListener(JDynFormFieldListener listener);
77
        
78
        public void removeListener(JDynFormFieldListener listener);
79
        
80
        public void setReadOnly(boolean readonly);
81
        
82
        public boolean isReadOnly();
83
        
84
        public void addActionToPopupMenu(String name, Action action);
85

    
86
        public void addSeparatorToPopupMenu();
87

    
88
        public void fireMessageEvent(String message);
89
        
90
        public void clear();
91
        
92
        public JDynForm getForm();
93
        
94
        public double getResizeWeight();
95
}