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 / JDynFormSet.java @ 2039

History | View | Annotate | Download (4.86 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.dynobject.DynObjectSet;
34
import org.gvsig.tools.swing.api.Component;
35

    
36
public interface JDynFormSet  extends Component {
37

    
38
        public static final String ACTION_FIRST = "first";
39
        public static final String ACTION_PREVIOUS = "previous";
40
        public static final String ACTION_NEXT = "next";
41
        public static final String ACTION_LAST = "last";
42
        public static final String ACTION_SAVE = "save";
43
        public static final String ACTION_NEW = "new";
44
        public static final String ACTION_CANCEL_NEW = "cancel-new";
45
        public static final String ACTION_DELETE = "delete";
46
        public static final String ACTION_SEARCH = "search";
47
        public static final String ACTION_CLOSE = "close";
48
        public static final String ACTION_SET_CURRENT_RECORD = "set-current-record";
49

    
50
        public interface JDynFormSetListener {
51
                public void formMessage(String message);
52
                public void formClose();
53
                public void formMovedTo(int currentPosition) throws AbortActionException;
54

    
55
                public void formBeforeSave(JDynFormSet dynformSet) throws AbortActionException;
56
                public void formBeforeNew(JDynFormSet dynformSet) throws AbortActionException;
57
                public void formBeforeCancelNew(JDynFormSet dynformSet) throws AbortActionException;
58
                public void formBeforeDelete(JDynFormSet dynformSet) throws AbortActionException;
59
                public void formBeforeSearch(JDynFormSet dynformSet) throws AbortActionException;
60

    
61
                public void formAfterSave(JDynFormSet dynformSet) throws AbortActionException;
62
                public void formAfterNew(JDynFormSet dynformSet) throws AbortActionException;
63
                public void formAfterCancelNew(JDynFormSet dynformSet) throws AbortActionException;
64
                public void formAfterDelete(JDynFormSet dynformSet) throws AbortActionException;
65
                public void formAfterSearch(JDynFormSet dynformSet) throws AbortActionException;
66
        }
67

    
68
        public void setLayoutMode(int layoutMode);
69
        public int getLayoutMode();
70

    
71
        public boolean hasValidValues();
72
        public boolean hasValidValues(List<String> fieldsName);
73

    
74
        public void setValues(DynObjectSet values);
75
        public void setValues(List values);
76

    
77
        public List getValues();
78

    
79
        public void message();
80
        public void message(String msg);
81

    
82
        public void setReadOnly(boolean readOnly);
83
        public boolean isReadOnly();
84

    
85
        public void addListener(JDynFormSetListener listener);
86
        public void removeListener(JDynFormSetListener listener);
87

    
88
        public boolean isAutosave();
89
        public void setAutosave(boolean autosave);
90

    
91
        public boolean allowUpdate();
92
        public boolean allowDelete();
93
        public boolean allowNew();
94
        public boolean allowSearch();
95
        public boolean allowClose();
96

    
97
        public void setAllowUpdate(boolean allowUpdate);
98
        public void setAllowDelete(boolean allowDelete);
99
        public void setAllowNew(boolean allowNew);
100
        public void setAllowSearch(boolean allowSearch);
101
        public void setAllowClose(boolean allowClose);
102

    
103
        public void setFormSize(int width, int height);
104

    
105
        public DynObject get(int position);
106
        public int getCurrentIndex();
107
        public int countValues();
108
        public void setCurrentIndex(int index);
109
        public boolean isInNewState();
110

    
111
        public void addAction(Action action);
112
        public void setActionVisible(String action, boolean visible);
113
        public void setActionEnabled(String action, boolean enabled);
114
        public boolean isActionVisible(String action);
115
        public boolean isActionEnabled(String action);
116
        public JComponent getActionButton(String action);
117
        public void fireEvent(String action, Object value);
118
        
119
        public void addActionToPopupMenu(DataType tipo, String name, Action action);
120
        public void addSeparatorToPopupMenu(DataType tipo);
121

    
122
        public void setUseScrollBars(boolean usesScrolls);
123
        public boolean getUseScrollBars();
124

    
125
        public void getFormValues(DynObject values);
126

    
127
        public JDynForm getForm();
128

    
129

    
130
}