+
+ /** {@inheritDoc} */
+ @Override
+ public void handleEvent(Object eventSource) {
+ super.handleEvent(eventSource);
+ if (eventSource == text_derivedUnitDefinitions) {
+ getEntity().addDerivedUnitDefinition(text_derivedUnitDefinitions.getText(), CdmStore.getDefaultLanguage());
+ } else if (eventSource == text_barcode) {
+ getEntity().setBarcode(text_barcode.getText());
+ } else if (eventSource == text_catalogNumber) {
+ getEntity().setCatalogNumber(text_catalogNumber.getText());
+ } else if (eventSource == combo_preservationMethod) {
+ try {
+ PreservationMethod preservationMethod = getEntity().getPreservationMethod();
+ if(preservationMethod!=null){
+ preservationMethod.setDefinedMaterialOrMethod(combo_preservationMethod.getSelection());
+ }
+ } catch (MethodNotSupportedByDerivedUnitTypeException e) {
+ MessagingUtils
+ .messageDialog(
+ "MethodNotSupportedByDerivedUnitTypeException",
+ this,
+ "MethodNotSupportedByDerivedUnitTypeException when trying to set preservation method for derive unit",
+ e);
+ }
+ } else if (eventSource == selection_storedUnder) {
+ getEntity().setStoredUnder(selection_storedUnder.getEntity());
+ } else if (eventSource == text_exsicatum) {
+ try {
+ getEntity().setExsiccatum(text_exsicatum.getText());
+ } catch (Exception e) {
+ MessagingUtils.error(this.getClass(), e);
+ }
+ }
+ }