Revision 6356 trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/edition/EditableAdapter.java
EditableAdapter.java | ||
---|---|---|
21 | 21 |
import com.iver.cit.gvsig.fmap.drivers.FieldDescription; |
22 | 22 |
import com.iver.cit.gvsig.fmap.drivers.ITableDefinition; |
23 | 23 |
import com.iver.cit.gvsig.fmap.drivers.TableDefinition; |
24 |
import com.iver.cit.gvsig.fmap.drivers.dbf.DBFDriver; |
|
24 | 25 |
import com.iver.cit.gvsig.fmap.edition.commands.AddFieldCommand; |
25 | 26 |
import com.iver.cit.gvsig.fmap.edition.commands.AddRowCommand; |
26 | 27 |
import com.iver.cit.gvsig.fmap.edition.commands.Command; |
... | ... | |
231 | 232 |
|
232 | 233 |
saveEdits(writer, sourceType); |
233 | 234 |
isEditing = false; |
235 |
cr.clearAll(); |
|
234 | 236 |
fireStopEditionEvent(sourceType); |
235 | 237 |
} |
236 | 238 |
|
... | ... | |
308 | 310 |
try { |
309 | 311 |
ds= null; |
310 | 312 |
clean(); |
313 |
cr.clearAll(); |
|
311 | 314 |
} catch (DriverException e) { |
312 | 315 |
e.printStackTrace(); |
313 | 316 |
throw new IOException("Error: " + e.getMessage()); |
... | ... | |
1260 | 1263 |
* @see com.iver.cit.gvsig.fmap.edition.IEditableSource#getFieldManager() |
1261 | 1264 |
*/ |
1262 | 1265 |
public IFieldManager getFieldManager() { |
1263 |
if (ods.getDriver() instanceof IFieldManager) |
|
1264 |
return (IFieldManager) ods.getDriver(); |
|
1266 |
if (ods.getDriver() instanceof IWriteable) |
|
1267 |
{ |
|
1268 |
IWriter writer = ((IWriteable)ods.getDriver()).getWriter(); |
|
1269 |
if ((writer != null) && (writer instanceof IFieldManager)) |
|
1270 |
{ |
|
1271 |
return (IFieldManager) writer; |
|
1272 |
} |
|
1273 |
} |
|
1265 | 1274 |
return null; |
1266 | 1275 |
} |
1267 | 1276 |
|
... | ... | |
1332 | 1341 |
field.setFieldIndex(actualFields.size()); |
1333 | 1342 |
actualFields.put(field.getFieldId(), field); |
1334 | 1343 |
fieldsChanged(); |
1344 |
fireAfterFieldAdded(field.getFieldDesc()); |
|
1335 | 1345 |
} |
1336 | 1346 |
|
1337 | 1347 |
public void doRemoveField(InternalField field) throws EditionException { |
... | ... | |
1406 | 1416 |
return field.getFieldIndex(); |
1407 | 1417 |
} |
1408 | 1418 |
|
1419 |
public Driver getDriver() |
|
1420 |
{ |
|
1421 |
return ods.getDriver(); |
|
1422 |
} |
|
1423 |
|
|
1409 | 1424 |
} |
Also available in: Unified diff