import org.eclipse.ui.forms.widgets.ExpandableComposite;
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
-import eu.etaxonomy.taxeditor.model.AbstractUtility;
-import eu.etaxonomy.taxeditor.preference.Resources;
import eu.etaxonomy.taxeditor.ui.campanula.basicFields.NumberFieldController;
import eu.etaxonomy.taxeditor.ui.campanula.basicFields.TextFieldController;
import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
private GatheringEventDetailsElement gatheringEventDetailsElement;
- private NumberFieldController number_absoluteElevationError;
+// private NumberFieldController number_absoluteElevationError;
- private NumberFieldController number_absoluteElevationMinimum;
+// private NumberFieldController number_absoluteElevationMinimum;
private NumberFieldController number_absoluteElevationMaximum;
@Override
protected void createControls(ICdmFormElement formElement, DerivedUnitFacade entity, int style) {
- number_absoluteElevationError = new NumberFieldController(gatheringEventDetailsElement.getTextElevationError(), formFactory, this, entity.getAbsoluteElevation());
- number_absoluteElevationMinimum = new NumberFieldController(gatheringEventDetailsElement.getText_ElevationMinimum(), formFactory, this, entity.getAbsoluteElevationMinimum());
+// number_absoluteElevationError = new NumberFieldController(gatheringEventDetailsElement.getTextElevationError(), formFactory, this, entity.getAbsoluteElevation());
+// number_absoluteElevationMinimum = new NumberFieldController(gatheringEventDetailsElement.getText_ElevationMinimum(), formFactory, this, entity.getAbsoluteElevationMinimum());
number_absoluteElevationMaximum = new NumberFieldController(gatheringEventDetailsElement.getText_ElevationMaximum(), formFactory, this, entity.getAbsoluteElevationMaximum());
text_collectingMethod = new TextFieldController(gatheringEventDetailsElement.getText_CollectingMethod(), formFactory, this, entity.getCollectingMethod(), null);
number_distanceToGround = new NumberFieldController(gatheringEventDetailsElement.getText_DistanceToGround(), formFactory, this, entity.getDistanceToGround());
/** {@inheritDoc} */
@Override
public void handleEvent(Object eventSource) {
- if (eventSource == number_absoluteElevationError) {
- getEntity().setAbsoluteElevationError(number_absoluteElevationError.getInteger());
- } else if (eventSource == number_absoluteElevationMinimum) {
- try {
- getEntity().setAbsoluteElevationRange(number_absoluteElevationMinimum.getInteger(), number_absoluteElevationMaximum.getInteger());
- number_absoluteElevationMinimum.setBackground(getColor(Resources.COLOR_COMPOSITE_BACKGROUND));
- } catch (IllegalArgumentException e) {
- number_absoluteElevationMinimum.setBackground(getColor(Resources.COLOR_PARSE_ERROR));
- AbstractUtility.warn(getClass(), e.getLocalizedMessage());
- }
- } else if (eventSource == number_absoluteElevationMaximum) {
- try {
- getEntity().setAbsoluteElevationRange(number_absoluteElevationMinimum.getInteger(), number_absoluteElevationMaximum.getInteger());
- number_absoluteElevationMaximum.setBackground(getColor(Resources.COLOR_COMPOSITE_BACKGROUND));
- } catch (IllegalArgumentException e) {
- number_absoluteElevationMaximum.setBackground(getColor(Resources.COLOR_PARSE_ERROR));
- AbstractUtility.warn(getClass(), e.getLocalizedMessage());
- }
- } else if (eventSource == text_collectingMethod) {
+// if (eventSource == number_absoluteElevationError) {
+// getEntity().setAbsoluteElevationError(number_absoluteElevationError.getDouble());
+// }
+// else if (eventSource == number_absoluteElevationMinimum) {
+// try {
+// getEntity().setAbsoluteElevationRange(number_absoluteElevationMinimum.getInteger(), number_absoluteElevationMaximum.getInteger());
+// number_absoluteElevationMinimum.setBackground(getColor(Resources.COLOR_COMPOSITE_BACKGROUND));
+// } catch (IllegalArgumentException e) {
+// number_absoluteElevationMinimum.setBackground(getColor(Resources.COLOR_PARSE_ERROR));
+// AbstractUtility.warn(getClass(), e.getLocalizedMessage());
+// }
+// }
+// else if (eventSource == number_absoluteElevationMaximum) {
+// try {
+// getEntity().setAbsoluteElevationRange(number_absoluteElevationError.getInteger(), number_absoluteElevationMaximum.getInteger());
+// number_absoluteElevationMaximum.setBackground(getColor(Resources.COLOR_COMPOSITE_BACKGROUND));
+// } catch (IllegalArgumentException e) {
+// number_absoluteElevationMaximum.setBackground(getColor(Resources.COLOR_PARSE_ERROR));
+// AbstractUtility.warn(getClass(), e.getLocalizedMessage());
+// }
+// } else
+ if (eventSource == text_collectingMethod) {
getEntity().setCollectingMethod(text_collectingMethod.getText());
} else if (eventSource == number_distanceToGround) {
- getEntity().setDistanceToGround(number_distanceToGround.getInteger());
+ getEntity().setDistanceToGround(number_distanceToGround.getDouble());
} else if (eventSource == number_distanceToWaterSurface) {
- getEntity().setDistanceToWaterSurface(number_distanceToWaterSurface.getInteger());
+ getEntity().setDistanceToWaterSurface(number_distanceToWaterSurface.getDouble());
} else if (eventSource == text_gatheringEventDescription) {
getEntity().setGatheringEventDescription(text_gatheringEventDescription.getText());
}