ListProperty editor and "nested" properties [message #1011132] |
Mon, 18 February 2013 22:55 |
Ellen Badgley Messages: 35 Registered: October 2012 |
Member |
|
|
I'm not sure how this would be accomplished. I have a ListProperty consisting of a list of Sensor elements. Each Sensor has a series of properties, all declared as ValueProperties. Most of these properties are primitive types, but one is a custom GeoPosition type, representing a basic coordinate:
@XmlBinding(path="position")
@Type(base=GeoPosition.class)
@Label(full="Position", standard = "Position")
@Required
ValueProperty PROP_POSITION = new ValueProperty(TYPE, "position");
Value<GeoPosition> getPosition();
void setPosition(GeoPosition position);
void setPosition(String position);
GeoPosition has two ValueProperties of its own:
@XmlBinding(path="Lat")
@Type(base=BigDecimal.class)
@Required
ValueProperty PROP_LAT = new ValueProperty(TYPE, "Lat");
Value<BigDecimal> getLat();
void setLat(BigDecimal value);
void setLat(String value);
@XmlBinding(path="Lon")
@Type(base=BigDecimal.class)
@Required
ValueProperty PROP_LON = new ValueProperty(TYPE, "Lon");
Value<BigDecimal> getLon();
void setLon(BigDecimal value);
void setLon(String value);
I'd like to allow the user to edit the lat/lon in the ListProperty editor, *but* I'm not sure how to do this and preserve the use of the GeoPosition type. Could this be done?
(The alternative is to declare lat and lon as properties of the Sensor type directly and adjust the @XmlBinding annotation accordingly (setting path to "position/lat", for example). This would probably be fine for my purposes, but I'd like to know if I have another option.)
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03185 seconds