Project

General

Profile

« Previous | Next » 

Revision 15d44593

Added by Patrick Plitzner almost 10 years ago

  • disabling event handling for DetailsView of TissueSample

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/TissueSampleGeneralDetailElement.java
97 97
     */
98 98
    @Override
99 99
    public void handleEvent(Object eventSource) {
100
//        if (eventSource==comboPreservationMedium) {
101
//            addPreservationMethod().setMedium(comboPreservationMedium.getSelection());
102
//        }
103
//        else if (eventSource==datePreservation) {
104
//            addPreservationMethod().setTimeperiod(datePreservation.getTimePeriod());
105
//        }
106
//        else if(eventSource==selectionCollection){
107
//            getEntity().setCollection(selectionCollection.getSelection());
108
//        }
109
//        else if(eventSource==textAccessionNumber){
110
//            getEntity().setAccessionNumber(textAccessionNumber.getText());
111
//        }
112
//        else if(eventSource==textBarcode){
113
//            getEntity().setBarcode(textBarcode.getText());
114
//        }
115
    }
116

  
117
    private PreservationMethod addPreservationMethod(){
118
        PreservationMethod preservationMethod = null;
100 119
        try {
101
            if (eventSource==comboPreservationMedium) {
102
                PreservationMethod preservationMethod = getEntity().getPreservationMethod();
103
                if(preservationMethod==null){
104
                    preservationMethod = PreservationMethod.NewInstance();
105
                    getEntity().setPreservationMethod(preservationMethod);
106
                }
107
                preservationMethod.setMedium(comboPreservationMedium.getSelection());
120
            preservationMethod = getEntity().getPreservationMethod();
121
            if(getEntity().getPreservationMethod()==null){
122
                preservationMethod = PreservationMethod.NewInstance();
123
                getEntity().setPreservationMethod(preservationMethod);
108 124
            }
109
            else if (eventSource==datePreservation) {
110
                PreservationMethod preservationMethod = getEntity().getPreservationMethod();
111
                if(preservationMethod==null){
112
                    preservationMethod = PreservationMethod.NewInstance();
113
                    getEntity().setPreservationMethod(preservationMethod);
114
                }
115
                preservationMethod.setTimeperiod(datePreservation.getTimePeriod());
116
            }
117
        }catch (MethodNotSupportedByDerivedUnitTypeException e) {
118
            AbstractUtility.errorDialog("Parameter not available", this, "Could not set preservation parameter!", e);
119
        }
120
        if(eventSource==selectionCollection){
121
            getEntity().setCollection(selectionCollection.getSelection());
122
        }
123
        else if(eventSource==textAccessionNumber){
124
            getEntity().setAccessionNumber(textAccessionNumber.getText());
125
        }
126
        else if(eventSource==textBarcode){
127
            getEntity().setBarcode(textBarcode.getText());
125
        } catch (MethodNotSupportedByDerivedUnitTypeException e) {
126
            // TODO Auto-generated catch block
127
            e.printStackTrace();
128 128
        }
129

  
129
        return preservationMethod;
130 130
    }
131 131
}

Also available in: Unified diff