import java.text.ParseException;
+import org.apache.commons.lang.StringUtils;
import org.eclipse.jface.util.PropertyChangeEvent;
import eu.etaxonomy.cdm.model.common.TermType;
Object eventSource = event.getSource();
if (eventSource == text_latitude) {
try {
- getPoint().setLatitudeByParsing(text_latitude.getText());
- text_latitudeParsed.setText(point.getLatitudeSexagesimal()
- .toString(false));
- text_latitude
- .setBackground(getColor(Resources.COLOR_COMPOSITE_BACKGROUND));
+ if (StringUtils.isBlank(text_latitude.getText())){
+ getPoint().setLatitudeByParsing(null);
+ text_latitudeParsed.setText(null);
+ text_latitude
+ .setBackground(getColor(Resources.COLOR_COMPOSITE_BACKGROUND));
+ }else{
+ getPoint().setLatitudeByParsing(text_latitude.getText());
+ text_latitudeParsed.setText(point.getLatitudeSexagesimal()
+ .toString(false));
+ text_latitude
+ .setBackground(getColor(Resources.COLOR_COMPOSITE_BACKGROUND));
+ }
propagate = true;
} catch (ParseException e) {
text_latitude
}
} else if (eventSource == text_longitude) {
try {
- getPoint().setLongitudeByParsing(text_longitude.getText());
- text_longitudeParsed.setText(point.getLongitudeSexagesimal()
- .toString(false));
- text_longitude
- .setBackground(getColor(Resources.COLOR_COMPOSITE_BACKGROUND));
+ if (StringUtils.isBlank(text_longitude.getText())){
+ getPoint().setLongitudeByParsing(null);
+ text_longitudeParsed.setText(null);
+ text_longitude
+ .setBackground(getColor(Resources.COLOR_COMPOSITE_BACKGROUND));
+ }else{
+ getPoint().setLongitudeByParsing(text_longitude.getText());
+ text_longitudeParsed.setText(point.getLongitudeSexagesimal()
+ .toString(false));
+ text_longitude
+ .setBackground(getColor(Resources.COLOR_COMPOSITE_BACKGROUND));
+ }
propagate = true;
} catch (ParseException e) {
text_longitude