Revision 44346 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/impl/DefaultFeatureAttributeDescriptor.java
DefaultFeatureAttributeDescriptor.java | ||
---|---|---|
112 | 112 |
protected boolean allowIndexDuplicateds = true; |
113 | 113 |
|
114 | 114 |
protected DynObjectValueItem[] availableValues; |
115 |
private Map<Object,String> labelOfValueMap; // No persistente |
|
115 | 116 |
protected String description; |
116 | 117 |
protected Object minValue; |
117 | 118 |
protected Object maxValue; |
... | ... | |
785 | 786 |
} |
786 | 787 |
|
787 | 788 |
@Override |
789 |
public String getLabelOfValue(Object value) { |
|
790 |
if( this.labelOfValueMap != null ) { |
|
791 |
String theLabel = this.labelOfValueMap.get(value); |
|
792 |
if( theLabel == null ) { |
|
793 |
theLabel = Objects.toString(value, ""); |
|
794 |
} |
|
795 |
return theLabel; |
|
796 |
} |
|
797 |
DynObjectValueItem[] values = this.getAvailableValues(); |
|
798 |
if( values == null ) { |
|
799 |
return Objects.toString(value, ""); |
|
800 |
} |
|
801 |
Map<Object, String> map = new HashMap<>(); |
|
802 |
for (DynObjectValueItem theValue : values) { |
|
803 |
map.put(theValue.getValue(), theValue.getLabel()); |
|
804 |
} |
|
805 |
this.labelOfValueMap = map; |
|
806 |
String theLabel = this.labelOfValueMap.get(value); |
|
807 |
if( theLabel == null ) { |
|
808 |
theLabel = Objects.toString(value, ""); |
|
809 |
} |
|
810 |
return theLabel; |
|
811 |
} |
|
812 |
|
|
813 |
@Override |
|
788 | 814 |
public String getDescription() { |
789 | 815 |
if( this.description == null ) { |
790 | 816 |
return getName(); |
Also available in: Unified diff