Revision 45419 branches/org.gvsig.desktop-cvsgis1/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
DefaultJFeaturesForm.java | ||
---|---|---|
58 | 58 |
import org.gvsig.fmap.dal.feature.EditableFeature; |
59 | 59 |
import org.gvsig.fmap.dal.feature.Feature; |
60 | 60 |
import org.gvsig.fmap.dal.feature.FacadeOfAFeature; |
61 |
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor; |
|
61 | 62 |
import org.gvsig.fmap.dal.feature.FeatureQuery; |
62 | 63 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
63 | 64 |
import org.gvsig.fmap.dal.feature.FeatureStoreNotification; |
... | ... | |
79 | 80 |
import org.gvsig.tools.dynform.DynFormLocator; |
80 | 81 |
import org.gvsig.tools.dynform.DynFormManager; |
81 | 82 |
import org.gvsig.tools.dynform.JDynForm; |
83 |
import org.gvsig.tools.dynform.JDynFormField; |
|
82 | 84 |
import org.gvsig.tools.dynform.JDynFormSet; |
83 | 85 |
import static org.gvsig.tools.dynform.JDynFormSet.ACTION_CANCEL_NEW; |
84 | 86 |
import static org.gvsig.tools.dynform.JDynFormSet.ACTION_DELETE; |
... | ... | |
691 | 693 |
formset.setActionEnabled(ACTION_SEARCH,true); |
692 | 694 |
formset.setActionEnabled(REFRESHFORM_ACTION,true); |
693 | 695 |
} |
696 |
|
|
697 |
private void clearUniqueFields() { |
|
698 |
for(FeatureAttributeDescriptor attr : this.store.getDefaultFeatureTypeQuietly()){ |
|
699 |
if((attr.isPrimaryKey() && !attr.isAutomatic()) || (attr.isIndexed() && !attr.allowIndexDuplicateds())){ |
|
700 |
JDynFormField field = formset.getForm().getField(attr.getName()); |
|
701 |
if(field != null){ |
|
702 |
field.clear(); |
|
703 |
} |
|
704 |
} |
|
705 |
} |
|
706 |
} |
|
694 | 707 |
|
695 | 708 |
@Override |
696 | 709 |
public long getDataSetSize() { |
... | ... | |
731 | 744 |
@Override |
732 | 745 |
public void formBeforeNew(JDynFormSet dynformSet) throws AbortActionException { |
733 | 746 |
LOGGER.trace("formBeforeNew"); |
747 |
clearUniqueFields(); |
|
734 | 748 |
updateButtonEnabledStatus(); |
735 | 749 |
} |
736 | 750 |
|
Also available in: Unified diff