Revision 45782 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/dynformfield/selectableforeingkey/JDynFormFieldSelectableForeingKey.java
JDynFormFieldSelectableForeingKey.java | ||
---|---|---|
22 | 22 |
*/ |
23 | 23 |
package org.gvsig.featureform.swing.impl.dynformfield.selectableforeingkey; |
24 | 24 |
|
25 |
import java.util.Objects; |
|
26 |
import org.apache.commons.lang3.StringUtils; |
|
25 | 27 |
import org.gvsig.featureform.swing.JFeaturesForm.FeaturesFormContext; |
26 | 28 |
import org.gvsig.fmap.dal.StoresRepository; |
27 | 29 |
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor; |
... | ... | |
76 | 78 |
DynObjectValueItem[] values = foreingKey.getAvailableValues(null); |
77 | 79 |
return values; |
78 | 80 |
} |
81 |
|
|
82 |
@Override |
|
83 |
public boolean isModified() { |
|
84 |
String s = getValueFromJComponent(); |
|
85 |
Object assigned = getAssignedValue(); |
|
86 |
if (StringUtils.isBlank(s)) { |
|
87 |
return assigned != null; |
|
88 |
} |
|
89 |
try { |
|
90 |
Object value = this.getDefinition().coerce(s); |
|
91 |
return !Objects.equals(value, assigned); |
|
92 |
} catch (Exception ex) { |
|
93 |
return false; |
|
94 |
} |
|
95 |
} |
|
79 | 96 |
|
97 |
|
|
80 | 98 |
} |
Also available in: Unified diff