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 / JDynForm.java @ 2547

History | View | Annotate | Download (3.71 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 java.util.List;
27

    
28
import javax.swing.Action;
29
import javax.swing.JComponent;
30

    
31
import org.gvsig.tools.dataTypes.DataType;
32
import org.gvsig.tools.dynobject.DynObject;
33
import org.gvsig.tools.swing.api.Component;
34
import org.gvsig.tools.util.PropertiesSupport;
35
import org.gvsig.tools.resourcesstorage.ResourcesStorage;
36
import org.gvsig.tools.script.Script;
37
import org.gvsig.tools.script.ScriptManager;
38

    
39
public interface JDynForm extends Component, PropertiesSupport {
40

    
41
        public interface JDynFormListener {
42
                public void message(String message);
43
                /**
44
                 * This event is fired when a field of the form is changed by the user.
45
                 * 
46
                 * Now this is not yet implemented.
47
                 * 
48
                 * @param field 
49
                 */
50
                public void fieldChanged(JDynFormField field);
51
        }
52
        
53
        public interface DynFormContext {
54
            public ResourcesStorage getResourcesStorage();
55
            
56
            public ScriptManager getScriptManager();
57
        }
58
        
59
        public static final int USE_PLAIN = 0;
60
        public static final int USE_TABS = 1;
61
        public static final int USE_SEPARATORS = 2;
62
        public static final int USE_TREE = 3;
63
        
64
        public void setLayoutMode(int layoutMode);
65
        public int getLayoutMode();
66
        
67
        public int getFormWidth();
68
        public int getFormHeight();
69
        public void setFormSize(int width, int height);
70
        
71
        public JDynFormField getField(String fieldName);
72
        
73
//        public Collection<JDynFormField> getShowFields();
74
        
75
        public DynFormDefinition getDefinition();
76
        
77
        public void setValues(DynObject values);
78
        public void getValues(DynObject values);
79
        
80
        public Object getValue(String fieldName);
81
        public void setValue(String fieldName, Object value);
82
        
83
        public boolean hasValidValues();
84
        public boolean hasValidValues(List<String> fieldsName);
85
        
86
        public void message();
87
        
88
        public void message(String msg);
89

    
90
        public void setReadOnly(boolean readOnly);
91
        public boolean isReadOnly();
92
        
93
        public void setShowMessageStatus(boolean showMessageStatus);
94
        
95
        public boolean isShowMessageStatus();
96
        
97
        public void setUseScrollBars(boolean usesScrolls);
98
        public boolean getUseScrollBars();
99
        
100
        public boolean isModified();
101
        
102
        public void addListener(JDynFormListener listener);
103
        public void removeListener(JDynFormListener listener);
104
        
105
        public void addActionToPopupMenu(DataType tipo, String name, Action action);
106
        public void addSeparatorToPopupMenu(DataType tipo);
107
        
108
        public JComponent getFieldsContainer();
109
        
110
        public void clear();
111
        
112
        public DynFormContext getContext();
113
        
114
        public void setContext(DynFormContext context);
115

    
116
        public Script getScript();
117
        
118
        public Object callUserFunction(String function, Object...args) throws Exception;
119
        
120
}