Revision 44794
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/featureform/swing/impl/DefaultJFeaturesForm.java | ||
---|---|---|
809 | 809 |
if( filter instanceof ExpressionEvaluator ) { |
810 | 810 |
Expression expression = ((ExpressionEvaluator)filter).getExpression(); |
811 | 811 |
searchPanel.setFilter(expression); |
812 |
searchPanel.search(); |
|
812 | 813 |
} |
813 | 814 |
} |
814 | 815 |
searchPanel.asJComponent().setPreferredSize( |
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/searchpanel/DefaultSearchPanel.java | ||
---|---|---|
13 | 13 |
import java.util.HashMap; |
14 | 14 |
import java.util.List; |
15 | 15 |
import java.util.Map; |
16 |
import java.util.logging.Level; |
|
16 | 17 |
import javax.swing.AbstractAction; |
17 | 18 |
import javax.swing.Action; |
18 | 19 |
import static javax.swing.Action.ACTION_COMMAND_KEY; |
... | ... | |
39 | 40 |
import static org.gvsig.fmap.dal.DataManager.USE_LABELS_YES; |
40 | 41 |
import org.gvsig.fmap.dal.DataStore; |
41 | 42 |
import org.gvsig.fmap.dal.complements.Search; |
43 |
import org.gvsig.fmap.dal.exception.DataException; |
|
42 | 44 |
import org.gvsig.fmap.dal.feature.Feature; |
43 | 45 |
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor; |
44 | 46 |
import org.gvsig.fmap.dal.feature.FeatureQuery; |
45 | 47 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
46 | 48 |
import org.gvsig.fmap.dal.feature.FeatureStoreProviderFactory; |
47 | 49 |
import org.gvsig.fmap.dal.feature.FeatureType; |
50 |
import org.gvsig.fmap.dal.feature.paging.FacadeOfAFeaturePagingHelper; |
|
48 | 51 |
import org.gvsig.fmap.dal.swing.AbstractDALActionFactory.AbstractDALActionContext; |
49 | 52 |
import org.gvsig.fmap.dal.swing.DALActionFactory; |
50 | 53 |
import org.gvsig.fmap.dal.swing.DALSwingLocator; |
... | ... | |
596 | 599 |
try { |
597 | 600 |
final List<Feature> features; |
598 | 601 |
features = store.getFeatures(this.getQuery()); |
602 |
FacadeOfAFeaturePagingHelper facade = (FacadeOfAFeaturePagingHelper) features; |
|
603 |
FeatureType ftype = facade.getFeaturePagingHelper().getFeatureSet().getDefaultFeatureType(); |
|
604 |
// al modelo le pasamos el ftype de esas features |
|
599 | 605 |
model.setValue( new SimpleFeaturesTableModel( |
600 |
getFeatureType(),
|
|
606 |
ftype,
|
|
601 | 607 |
parameters.getResultColumnNames(), |
602 | 608 |
features |
603 | 609 |
) |
... | ... | |
623 | 629 |
if( this.conditionPanels==null ) { |
624 | 630 |
return; |
625 | 631 |
} |
626 |
SimpleFeaturesTableModel model = (SimpleFeaturesTableModel) this.tblResults.getModel(); |
|
627 |
List<Feature> features = model.getFeatures(); |
|
632 |
SimpleFeaturesTableModel model; |
|
633 |
model = (SimpleFeaturesTableModel) this.tblResults.getModel(); |
|
634 |
List<Feature> features = store.getFeatures(this.parameters.getQuery()); |
|
635 |
FacadeOfAFeaturePagingHelper facade = (FacadeOfAFeaturePagingHelper) features; |
|
636 |
FeatureType ftype = facade.getFeaturePagingHelper().getFeatureSet().getDefaultFeatureType(); |
|
628 | 637 |
model = new SimpleFeaturesTableModel( |
629 |
getFeatureType(),
|
|
638 |
ftype,
|
|
630 | 639 |
this.parameters.getResultColumnNames(), |
631 | 640 |
features |
632 | 641 |
); |
... | ... | |
653 | 662 |
} |
654 | 663 |
this.tabSearchMode.setSelectedIndex(selected); |
655 | 664 |
|
656 |
SimpleFeaturesTableModel model = new SimpleFeaturesTableModel(this.getStore()); |
|
657 |
tblResults.setModel(model); |
|
658 |
lblMsg.setText(""); |
|
665 |
// SimpleFeaturesTableModel model = new SimpleFeaturesTableModel(this.getStore()); |
|
666 |
// tblResults.setModel(model); |
|
667 |
// lblMsg.setText(""); |
|
668 |
|
|
659 | 669 |
return true; |
660 | 670 |
} catch(Exception ex) { |
661 | 671 |
LOGGER.warn("Can't set current search", ex); |
... | ... | |
870 | 880 |
WindowManager_v2 winmanager = (WindowManager_v2) ToolsSwingLocator.getWindowManager(); |
871 | 881 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
872 | 882 |
final FeatureAttributesSelectionPanel panel = DALSwingLocator.getManager().createFeatureAttributeSelectionPanel(); |
873 |
panel.setFeatureType(this.getFeatureType()); |
|
883 |
FeatureType ftype; |
|
884 |
try { |
|
885 |
ftype = store.findFirst(this.parameters.getQuery()).getType(); |
|
886 |
} catch (DataException ex) { |
|
887 |
ftype = this.getFeatureType(); |
|
888 |
} |
|
889 |
panel.setFeatureType(ftype); |
|
874 | 890 |
panel.setSelectedNames(this.parameters.getResultColumnNames()); |
875 | 891 |
final Dialog dialog = winmanager.createDialog( |
876 | 892 |
panel.asJComponent(), |
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/featuretype/DefaultFeatureAttributesSelectionPanel.java | ||
---|---|---|
15 | 15 |
import javax.swing.event.ListSelectionEvent; |
16 | 16 |
import org.apache.commons.io.FilenameUtils; |
17 | 17 |
import org.gvsig.fmap.dal.exception.DataException; |
18 |
import org.gvsig.fmap.dal.feature.EditableFeatureAttributeDescriptor; |
|
18 | 19 |
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor; |
19 | 20 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
20 | 21 |
import org.gvsig.fmap.dal.feature.FeatureType; |
... | ... | |
256 | 257 |
if( !this.selecteds.contains(attr.getName()) ) { |
257 | 258 |
modelAvailables.addElement(attr.getName()); |
258 | 259 |
} |
259 |
} |
|
260 |
} |
|
261 |
List<EditableFeatureAttributeDescriptor> columns = featureType.getExtraColumn().getColumns(); |
|
262 |
if (columns!=null && !columns.isEmpty()) { |
|
263 |
for (EditableFeatureAttributeDescriptor extraCol : columns) { |
|
264 |
if( !this.selecteds.contains(extraCol.getName()) ) { |
|
265 |
modelAvailables.addElement(extraCol.getName()); |
|
266 |
} |
|
267 |
} |
|
268 |
} |
|
260 | 269 |
modelAvailables.setFilter(this.txtColumnsFilter.getText()); |
261 | 270 |
modelAvailables.sort(true); |
262 | 271 |
for (String name : this.selecteds) { |
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/featurequery/DefaultFeatureQueryCalculatedColumnsPanel.java | ||
---|---|---|
487 | 487 |
this.columnController.setEnabled(true); |
488 | 488 |
|
489 | 489 |
this.lstAttributesModel.addElement(new ListElement(newAttr.getName(), newAttr)); |
490 |
ListElement.setSelected(this.lstAttributes, newAttr); |
|
491 |
this.actualEditableAttribute = newAttr; |
|
492 |
|
|
490 | 493 |
} |
491 | 494 |
|
492 | 495 |
private boolean checkIfValueExistInModel(String name, ListModel<ListElement<EditableFeatureAttributeDescriptor>> model) { |
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 | ||
---|---|---|
6 | 6 |
import javax.swing.table.AbstractTableModel; |
7 | 7 |
import org.gvsig.fmap.dal.complements.Search; |
8 | 8 |
import org.gvsig.fmap.dal.exception.DataException; |
9 |
import org.gvsig.fmap.dal.feature.EditableFeatureAttributeDescriptor; |
|
9 | 10 |
import org.gvsig.fmap.dal.feature.Feature; |
10 | 11 |
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor; |
11 | 12 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
... | ... | |
87 | 88 |
} |
88 | 89 |
FeatureAttributeDescriptor attrdesc = this.featureType.getAttributeDescriptor(attrName); |
89 | 90 |
if (attrdesc == null) { |
91 |
EditableFeatureAttributeDescriptor extraCol = this.featureType.getExtraColumn().get(attrName); |
|
92 |
if (extraCol!=null) { |
|
93 |
return extraCol.getLocalizedShortLabel(); |
|
94 |
} |
|
90 | 95 |
return "C" + columnIndex; |
91 | 96 |
} |
92 | 97 |
return attrdesc.getLocalizedShortLabel(); |
... | ... | |
100 | 105 |
String attrName = this.columnNames.get(columnIndex); |
101 | 106 |
FeatureAttributeDescriptor attrdesc = this.featureType.getAttributeDescriptor(attrName); |
102 | 107 |
if (attrdesc == null) { |
108 |
int extraIndex = featureType.getExtraColumn().getIndexOf(attrName); |
|
109 |
if (extraIndex != -1) { |
|
110 |
attrdesc = featureType.getExtraColumn().get(extraIndex); |
|
111 |
} |
|
112 |
} |
|
113 |
if (attrdesc == null) { |
|
103 | 114 |
return String.class; |
104 | 115 |
} |
105 | 116 |
if( attrdesc.isForeingKey() && attrdesc.getForeingKey().isClosedList() ) { |
... | ... | |
134 | 145 |
try { |
135 | 146 |
Feature feature = this.features.get(rowIndex); |
136 | 147 |
String attrName = this.columnNames.get(columnIndex); |
137 |
Object value = feature.get(attrName);
|
|
148 |
Object value = null;
|
|
138 | 149 |
FeatureAttributeDescriptor attrdesc = this.featureType.getAttributeDescriptor(attrName); |
150 |
if (attrdesc ==null) { |
|
151 |
int extraIndex = featureType.getExtraColumn().getIndexOf(attrName); |
|
152 |
if (extraIndex != -1) { |
|
153 |
attrdesc = featureType.getExtraColumn().get(extraIndex); |
|
154 |
value = feature.getExtraValue(attrName); |
|
155 |
} |
|
156 |
} else { |
|
157 |
value = feature.get(attrName); |
|
158 |
} |
|
139 | 159 |
if (attrdesc != null) { |
140 | 160 |
if( attrdesc.isForeingKey() && attrdesc.getForeingKey().isClosedList() ) { |
141 | 161 |
value = attrdesc.getForeingKey().getLabelForValue(value); |
trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.api/src/main/java/org/gvsig/fmap/dal/feature/paging/FeaturePagingHelper.java | ||
---|---|---|
151 | 151 |
public void setSelection(FeatureSelection selection); |
152 | 152 |
|
153 | 153 |
public boolean isEmpty(); |
154 |
|
|
155 |
public FeatureSet getFeatureSet(); |
|
154 | 156 |
} |
trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.impl/src/main/java/org/gvsig/fmap/dal/feature/paging/impl/FeaturePagingHelperImpl.java | ||
---|---|---|
354 | 354 |
} |
355 | 355 |
return features; |
356 | 356 |
} |
357 |
|
|
358 |
@Override |
|
359 |
public FeatureSet getFeatureSet() { |
|
360 |
return this.getFeatureSet(false); |
|
361 |
} |
|
357 | 362 |
|
358 | 363 |
/** |
359 | 364 |
* Gets the feature set. |
Also available in: Unified diff