Revision 1098 org.gvsig.tools/library/trunk/org.gvsig.tools/org.gvsig.tools.dynform/org.gvsig.tools.dynform.services/src/main/java/org/gvsig/tools/dynform/services/dynformfield/DynObjectList/JDynFormFieldDynObjectList.java
JDynFormFieldDynObjectList.java | ||
---|---|---|
30 | 30 |
|
31 | 31 |
import javax.swing.JPanel; |
32 | 32 |
|
33 |
import org.gvsig.tools.ToolsLocator; |
|
34 |
import org.gvsig.tools.dynform.AbortActionException; |
|
33 | 35 |
import org.gvsig.tools.dynform.DynFormFieldDefinition; |
34 | 36 |
import org.gvsig.tools.dynform.DynFormLocator; |
35 | 37 |
import org.gvsig.tools.dynform.JDynForm.JDynFormListener; |
36 | 38 |
import org.gvsig.tools.dynform.JDynFormField; |
37 | 39 |
import org.gvsig.tools.dynform.JDynFormSet; |
40 |
import org.gvsig.tools.dynform.JDynFormSet.JDynFormSetListener; |
|
38 | 41 |
import org.gvsig.tools.dynform.spi.dynformfield.AbstractJDynFormField; |
39 | 42 |
import org.gvsig.tools.dynobject.DynField_v2; |
40 | 43 |
import org.gvsig.tools.dynobject.DynObject; |
... | ... | |
42 | 45 |
import org.gvsig.tools.service.ServiceException; |
43 | 46 |
import org.gvsig.tools.service.spi.ServiceManager; |
44 | 47 |
|
45 |
public class JDynFormFieldDynObjectList extends AbstractJDynFormField implements JDynFormField, JDynFormListener, FocusListener { |
|
48 |
public class JDynFormFieldDynObjectList extends AbstractJDynFormField implements JDynFormField, JDynFormListener, JDynFormSetListener, FocusListener {
|
|
46 | 49 |
|
47 | 50 |
protected List assignedValue = null; |
48 | 51 |
protected List currentValue = null; |
... | ... | |
84 | 87 |
}else{ |
85 | 88 |
this.jdynFormSet = DynFormLocator.getDynFormManager().createJDynFormSet(struct); |
86 | 89 |
} |
90 |
this.jdynFormSet.addListener(this); |
|
87 | 91 |
if( fielddef.getTags().has("layoutMode") ) { |
88 | 92 |
this.jdynFormSet.setLayoutMode(fielddef.getTags().getInt("layoutMode")); |
93 |
|
|
89 | 94 |
} |
95 |
|
|
96 |
if( fielddef.getTags().has("allowNew") ) { |
|
97 |
this.jdynFormSet.setAllowNew(fielddef.getTags().getBoolean("allowNew")); |
|
98 |
|
|
99 |
} |
|
100 |
if( fielddef.getTags().has("allowUpdate") ) { |
|
101 |
this.jdynFormSet.setAllowUpdate(fielddef.getTags().getBoolean("allowUpdate")); |
|
102 |
|
|
103 |
} |
|
104 |
if( fielddef.getTags().has("allowDelete") ) { |
|
105 |
this.jdynFormSet.setAllowDelete(fielddef.getTags().getBoolean("allowDelete")); |
|
106 |
|
|
107 |
} |
|
108 |
if( fielddef.getTags().has("allowSearch") ) { |
|
109 |
this.jdynFormSet.setAllowSearch(fielddef.getTags().getBoolean("allowSearch")); |
|
110 |
|
|
111 |
} |
|
112 |
|
|
113 |
this.jdynFormSet.setAllowClose(false); |
|
90 | 114 |
this.jdynFormSet.setUseScrollBars(false); |
91 | 115 |
// this.jdynFormSet.setShowMessageStatus(false); |
92 | 116 |
// this.jdynFormSet.addListener(this); |
... | ... | |
146 | 170 |
// TODO Auto-generated method stub |
147 | 171 |
|
148 | 172 |
} |
173 |
|
|
174 |
public void formMessage(String message) { |
|
175 |
// TODO Auto-generated method stub |
|
176 |
|
|
177 |
} |
|
178 |
|
|
179 |
public void formClose() { |
|
180 |
// TODO Auto-generated method stub |
|
181 |
|
|
182 |
} |
|
183 |
|
|
184 |
public void formMovedTo(int currentPosition) { |
|
185 |
// TODO Auto-generated method stub |
|
186 |
|
|
187 |
} |
|
188 |
|
|
189 |
public void formBeforeSave(JDynFormSet dynformSet) throws AbortActionException { |
|
190 |
// TODO Auto-generated method stub |
|
191 |
|
|
192 |
} |
|
193 |
|
|
194 |
public void formBeforeNew(JDynFormSet dynformSet) throws AbortActionException { |
|
195 |
DynFormFieldDefinition def = this.getDefinition(); |
|
196 |
DynField_v2 fielddef = (DynField_v2)def; |
|
197 |
DynStruct struct = fielddef.getStructWhenTypeIsDynObject(); |
|
198 |
DynObject value = ToolsLocator.getDynObjectManager().createDynObject(struct); |
|
199 |
this.currentValue.add(value); |
|
200 |
|
|
201 |
|
|
202 |
} |
|
203 |
|
|
204 |
public void formBeforeDelete(JDynFormSet dynformSet) throws AbortActionException { |
|
205 |
this.currentValue.remove(dynformSet.getCurrentIndex()); |
|
206 |
} |
|
207 |
|
|
208 |
public void formBeforeSearch(JDynFormSet dynformSet) throws AbortActionException { |
|
209 |
// TODO Auto-generated method stub |
|
210 |
|
|
211 |
} |
|
212 |
|
|
213 |
public void formAfterSave(JDynFormSet dynformSet) { |
|
214 |
// TODO Auto-generated method stub |
|
215 |
|
|
216 |
} |
|
217 |
|
|
218 |
public void formAfterNew(JDynFormSet dynformSet) { |
|
219 |
// TODO Auto-generated method stub |
|
220 |
|
|
221 |
} |
|
222 |
|
|
223 |
public void formAfterDelete(JDynFormSet dynformSet) { |
|
224 |
// TODO Auto-generated method stub |
|
225 |
|
|
226 |
} |
|
227 |
|
|
228 |
public void formAfterSearch(JDynFormSet dynformSet) { |
|
229 |
// TODO Auto-generated method stub |
|
230 |
|
|
231 |
} |
|
149 | 232 |
|
150 | 233 |
} |
Also available in: Unified diff