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 @ 2596

History | View | Annotate | Download (5.19 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 static final String ACTION_NAVIGATION = "#navigation";
51
        
52
        public interface JDynFormSetListener {
53
                public void formMessage(String message);
54
                public void formClose();
55
                public void formMovedTo(int currentPosition) throws AbortActionException;
56

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

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

    
70
        public void setLayoutMode(int layoutMode);
71
        public int getLayoutMode();
72

    
73
        public boolean hasValidValues();
74
        public boolean hasValidValues(List<String> fieldsName);
75

    
76
        public void setValues(DynObjectSet values);
77
        public void setValues(List values);
78

    
79
        public List getValues();
80

    
81
        public void message();
82
        public void message(String msg);
83

    
84
        public void setReadOnly(boolean readOnly);
85
        public boolean isReadOnly();
86

    
87
        public void addListener(JDynFormSetListener listener);
88
        public void removeListener(JDynFormSetListener listener);
89

    
90
        public boolean isAutosave();
91
        public void setAutosave(boolean autosave);
92

    
93
        public boolean allowUpdate();
94
        public boolean allowDelete();
95
        public boolean allowNew();
96
        public boolean allowSearch();
97
        public boolean allowClose();
98

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

    
105
        public void setFormSize(int width, int height);
106

    
107
        public DynObject get(int position);
108
        public int getCurrentIndex();
109
        public int countValues();
110
        
111
        /**
112
         * Set the current element of form.
113
         * If the form is modified, the changes will be lost.
114
         * @param index 
115
         */
116
        public void setCurrentIndex(int index);
117
        public boolean isInNewState();
118

    
119
        public void addAction(Action action);
120
        public Action getAction(String actionId);
121
        public List<Action> getActions();
122
        public void setActionVisible(String action, boolean visible);
123
        public void setActionEnabled(String action, boolean enabled);
124
        public boolean isActionVisible(String action);
125
        public boolean isActionEnabled(String action);
126
        public JComponent getActionButton(String action);
127
        public void fireEvent(String action, Object value);
128
        
129
        public void addActionToPopupMenu(DataType tipo, String name, Action action);
130
        public void addSeparatorToPopupMenu(DataType tipo);
131

    
132
        public void setUseScrollBars(boolean usesScrolls);
133
        public boolean getUseScrollBars();
134

    
135
        public void getFormValues(DynObject values);
136

    
137
        public JDynForm getForm();
138

    
139

    
140
}