Revision 44836 trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.swing/org.gvsig.fmap.dal.swing.impl/src/main/java/org/gvsig/fmap/dal/swing/impl/featuretable/SimpleFeaturesTableModel.java
SimpleFeaturesTableModel.java | ||
---|---|---|
31 | 31 |
private final List<String> columnNames; |
32 | 32 |
private final FeatureType featureType; |
33 | 33 |
private FilteredLogger logger; |
34 |
private boolean errors; |
|
34 | 35 |
|
35 | 36 |
public SimpleFeaturesTableModel(FeatureStore store) throws DataException { |
36 | 37 |
this(store.getDefaultFeatureType(), null, store.getFeatures()); |
... | ... | |
45 | 46 |
this.logger = new FilteredLogger(LOGGER, "SimpleFeaturesTableModel", 10); |
46 | 47 |
this.features = features; |
47 | 48 |
this.featureType = featureType; |
49 |
this.errors = false; |
|
48 | 50 |
if (columnNames == null || columnNames.isEmpty()) { |
49 | 51 |
this.columnNames = new ArrayList<>(); |
50 | 52 |
Search search = (Search) ToolsLocator.getComplementsManager().get( |
... | ... | |
72 | 74 |
if (this.features == null) { |
73 | 75 |
return 0; |
74 | 76 |
} |
75 |
return this.features.size(); |
|
77 |
try { |
|
78 |
return this.features.size(); |
|
79 |
} catch(Throwable ex) { |
|
80 |
this.errors = true; |
|
81 |
LOGGER.warn("Can't calculate row count.",ex); |
|
82 |
return 0; |
|
83 |
} |
|
76 | 84 |
} |
77 | 85 |
|
86 |
public boolean hasErrors() { |
|
87 |
return this.errors; |
|
88 |
} |
|
89 |
|
|
78 | 90 |
@Override |
79 | 91 |
public int getColumnCount() { |
80 | 92 |
return this.columnNames.size(); |
... | ... | |
163 | 175 |
} |
164 | 176 |
return value; |
165 | 177 |
} catch (Throwable th) { |
178 |
this.errors = true; |
|
166 | 179 |
logger.warn("Can't get cell value at "+rowIndex+", "+columnIndex+".", th); |
167 | 180 |
return null; |
168 | 181 |
} |
Also available in: Unified diff