Revision 44262 trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.file/org.gvsig.fmap.dal.file.lib/src/main/java/org/gvsig/fmap/dal/feature/spi/simpleprovider/SimpleSequentialReaderStoreProvider.java
SimpleSequentialReaderStoreProvider.java | ||
---|---|---|
274 | 274 |
|
275 | 275 |
private Envelope envelope; |
276 | 276 |
private boolean need_calculate_envelope = false; |
277 |
private final SimpleTaskStatus taskStatus; |
|
278 | 277 |
private String name = ""; |
279 | 278 |
private final SimpleSequentialReaderFactory readerFactory; |
280 | 279 |
private List<ReaderData> childrenData; |
... | ... | |
304 | 303 |
this.childrenData = childrenData; |
305 | 304 |
this.readerData = readerData; |
306 | 305 |
this.readerFactory = readerFactory; |
307 |
TaskStatusManager manager = ToolsLocator.getTaskStatusManager(); |
|
308 |
this.taskStatus = manager.createDefaultSimpleTaskStatus(readerFactory.getName()); |
|
309 | 306 |
|
310 | 307 |
File file = getParameters().getFile(); |
311 | 308 |
resource = this.createResource( |
... | ... | |
720 | 717 |
case "allownull": |
721 | 718 |
fad.setAllowNull((boolean) dataTypesManager.coerce(DataTypes.BOOLEAN, entry.getValue())); |
722 | 719 |
break; |
720 |
case "pk": |
|
721 |
case "ispk": |
|
722 |
case "primarykey": |
|
723 |
case "isprimarykey": |
|
724 |
fad.setIsPrimaryKey((boolean) dataTypesManager.coerce(DataTypes.BOOLEAN, entry.getValue())); |
|
725 |
break; |
|
723 | 726 |
case "isautomatic": |
724 | 727 |
case "automatic": |
725 | 728 |
fad.setIsAutomatic((boolean) dataTypesManager.coerce(DataTypes.BOOLEAN, entry.getValue())); |
... | ... | |
942 | 945 |
private void loadFeatures(SimpleSequentialReader reader, ReaderData readerData) throws IOException, DataException, |
943 | 946 |
CoercionException, CloneNotSupportedException { |
944 | 947 |
|
948 |
TaskStatusManager manager = ToolsLocator.getTaskStatusManager(); |
|
949 |
SimpleTaskStatus taskStatus = manager.createDefaultSimpleTaskStatus(reader.getName()); |
|
950 |
taskStatus.setAutoremove(true); |
|
951 |
taskStatus.setIndeterminate(); |
|
952 |
taskStatus.add(); |
|
945 | 953 |
try { |
946 | 954 |
List<String> headers; |
947 | 955 |
|
956 |
taskStatus.message("_preparing"); |
|
948 | 957 |
readerData.setName(reader.getName()); |
949 | 958 |
|
950 | 959 |
boolean ignore_errors = getParameters().getIgnoreErrors(); |
... | ... | |
993 | 1002 |
|
994 | 1003 |
Locale locale = getParameters().getLocale(); |
995 | 1004 |
taskStatus.message("_loading"); |
1005 |
long rowCount = reader.getRowCount(); |
|
1006 |
if( rowCount >0 ) { |
|
1007 |
taskStatus.setRangeOfValues(0, rowCount); |
|
1008 |
} |
|
1009 |
|
|
996 | 1010 |
int count = 0; |
997 | 1011 |
|
998 | 1012 |
int count_errors = 0; |
... | ... | |
1058 | 1072 |
|
1059 | 1073 |
taskStatus.terminate(); |
1060 | 1074 |
} catch (Exception ex) { |
1075 |
taskStatus.abort(); |
|
1061 | 1076 |
LOGGER.warn("Can't load features from '"+getProviderName()+"' file '" + getFullFileName() + "'.", ex); |
1062 | 1077 |
} |
1063 | 1078 |
} |
Also available in: Unified diff