Revision 47403 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/DefaultFeatureAttributePanel.java
DefaultFeatureAttributePanel.java | ||
---|---|---|
133 | 133 |
private String previousDefaultValue; |
134 | 134 |
private ToManyController toManyController; |
135 | 135 |
private JSplitPane splAttrTags; |
136 |
private FeatureType featureType; |
|
136 | 137 |
|
137 | 138 |
private static class ToOneController { |
138 | 139 |
|
... | ... | |
379 | 380 |
private AttributeDescriptorPickerController pickerMyField; |
380 | 381 |
private boolean editable; |
381 | 382 |
private boolean disableEvents; |
383 |
private FeatureType featureType; |
|
382 | 384 |
|
383 | 385 |
public ToManyController( |
384 | 386 |
JComboBox cboRelationType, |
... | ... | |
627 | 629 |
boolean prevDisableEvents = this.disableEvents; |
628 | 630 |
try { |
629 | 631 |
this.disableEvents = true; |
630 |
this.pickerMyField.setFeatureType(descriptor.getFeatureType());
|
|
632 |
this.pickerMyField.setFeatureType(getFeatureType(descriptor));
|
|
631 | 633 |
ListElement.setSelected(this.cboRelationType, descriptor.getRelationType()); |
632 | 634 |
FeatureAttributeEmulator attrEmulator = descriptor.getFeatureAttributeEmulator(); |
633 | 635 |
if (attrEmulator instanceof FeatureAttributeEmulatorExpression) { |
... | ... | |
653 | 655 |
} |
654 | 656 |
} |
655 | 657 |
|
658 |
public void setFeatureType(FeatureType featureType){ |
|
659 |
this.featureType = featureType; |
|
660 |
} |
|
661 |
|
|
662 |
private FeatureType getFeatureType(FeatureAttributeDescriptor descriptor) { |
|
663 |
if(descriptor == null || descriptor.getFeatureType() == null){ |
|
664 |
return this.featureType; |
|
665 |
} |
|
666 |
return descriptor.getFeatureType(); |
|
667 |
} |
|
668 |
|
|
656 | 669 |
public void fetch(EditableFeatureAttributeDescriptor descriptor) { |
657 | 670 |
if( descriptor == null ) { |
658 | 671 |
this.clean(); |
... | ... | |
1521 | 1534 |
} else { |
1522 | 1535 |
DataManager dataManager = DALLocator.getDataManager(); |
1523 | 1536 |
FeatureAttributeEmulatorExpression emulator = dataManager.createFeatureAttributeEmulatorExpression( |
1524 |
descriptor.getFeatureType(),
|
|
1537 |
getFeatureType(descriptor),
|
|
1525 | 1538 |
expression |
1526 | 1539 |
); |
1527 | 1540 |
if (!emulator.isValid()) { |
... | ... | |
1867 | 1880 |
} |
1868 | 1881 |
this.updateEditableStates(); |
1869 | 1882 |
} |
1883 |
|
|
1884 |
public void setFeatureType(FeatureType featureType){ |
|
1885 |
this.featureType = featureType; |
|
1886 |
this.toManyController.setFeatureType(featureType); |
|
1887 |
} |
|
1888 |
|
|
1889 |
private FeatureType getFeatureType(FeatureAttributeDescriptor descriptor) { |
|
1890 |
if(descriptor == null || descriptor.getFeatureType() == null){ |
|
1891 |
return this.featureType; |
|
1892 |
} |
|
1893 |
return descriptor.getFeatureType(); |
|
1894 |
} |
|
1870 | 1895 |
|
1871 | 1896 |
private DataType getDataType() { |
1872 | 1897 |
Integer fieldType = (Integer) ListElement.getSelected(this.cboFieldType); |
Also available in: Unified diff