Revision 44259 trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.fmap.control/src/main/java/org/gvsig/fmap/mapcontrol/dal/feature/swing/FeatureTypesTablePanel.java
FeatureTypesTablePanel.java | ||
---|---|---|
25 | 25 |
|
26 | 26 |
import java.awt.BorderLayout; |
27 | 27 |
import java.awt.Dimension; |
28 |
import java.util.List; |
|
29 | 28 |
import javax.swing.DefaultListModel; |
30 | 29 |
import javax.swing.JComponent; |
31 | 30 |
|
... | ... | |
34 | 33 |
import javax.swing.JList; |
35 | 34 |
import javax.swing.event.ListSelectionEvent; |
36 | 35 |
import javax.swing.event.ListSelectionListener; |
36 |
import org.gvsig.fmap.dal.DataStore; |
|
37 | 37 |
|
38 | 38 |
import org.gvsig.fmap.dal.exception.DataException; |
39 | 39 |
import org.gvsig.fmap.dal.feature.Feature; |
... | ... | |
46 | 46 |
import org.gvsig.fmap.mapcontrol.dal.feature.swing.table.SelectedFeatureTypeChangeListener; |
47 | 47 |
import org.gvsig.tools.exception.BaseException; |
48 | 48 |
import org.gvsig.tools.swing.api.ListElement; |
49 |
import org.gvsig.tools.util.UnmodifiableBasicMap; |
|
49 | 50 |
import org.slf4j.Logger; |
50 | 51 |
import org.slf4j.LoggerFactory; |
51 | 52 |
|
... | ... | |
134 | 135 |
} |
135 | 136 |
|
136 | 137 |
private boolean hasManyFeatureTypes() throws DataException { |
137 |
List<String> childNames = this.model.getFeatureStore().getChildrenNames();
|
|
138 |
if( childNames!=null && !childNames.isEmpty() ) {
|
|
138 |
UnmodifiableBasicMap<String, DataStore> children = this.model.getFeatureStore().getChildren();
|
|
139 |
if( !children.isEmpty() ) {
|
|
139 | 140 |
return true; |
140 | 141 |
} |
141 | 142 |
return typesControl.getFeatureTypesSize() > 1; |
... | ... | |
241 | 242 |
DefaultListModel model = new DefaultListModel(); |
242 | 243 |
FeatureStore store = this.model.getFeatureStore(); |
243 | 244 |
model.addElement(new ListElement<>(store.getName(),store)); |
244 |
for (String childName : store.getChildrenNames()) {
|
|
245 |
model.addElement(new ListElement<>(childName,store.getChild(childName))); |
|
245 |
for (String childName : store.getChildren().keySet() ) {
|
|
246 |
model.addElement(new ListElement<>(childName,store.getChildren().get(childName)));
|
|
246 | 247 |
} |
247 | 248 |
l.setModel(model); |
248 | 249 |
l.addListSelectionListener(new ListSelectionListener() { |
Also available in: Unified diff