Project

General

Profile

« Previous | Next » 

Revision 6d065581

Added by Patrick Plitzner over 9 years ago

  • added 3 non-editable URI text fields for DNA information

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/SequenceGeneralDetailElement.java
35 35
    private NumberWithLabelElement textConsensusSequenceLength;
36 36
    private TextWithLabelElement textBarcodeSequence;
37 37
    private TextWithLabelElement textGeneticAccessNo;
38
    private UriWithLabelElement textNCBIUri;
39
    private UriWithLabelElement textENAUri;
40
    private UriWithLabelElement textDDBJUri;
38 41
    private TextWithLabelElement textBoldProcessID;
39 42
    private UriWithLabelElement textBoldUri;
40 43

  
......
56 59
    @Override
57 60
    protected void createControls(ICdmFormElement formElement, Sequence entity, int style) {
58 61
        comboMarker = formFactory.createDefinedTermComboElement(TermType.DnaMarker, formElement, "DNA Marker", entity.getDnaMarker(), style);
59
        textConsensusSequence = formFactory.createTextWithLabelElement(formElement, "Consensus Sequence 5'->3'", entity.getConsensusSequence().getString(), style);
60
        textConsensusSequenceLength = formFactory.createNumberTextWithLabelElement(formElement, "Consensus Seq. Length", entity.getConsensusSequence().getLength(), style);
61
        ((Text) textConsensusSequenceLength.getMainControl()).setEditable(false);
62
//        textConsensusSequence = formFactory.createTextWithLabelElement(formElement, "Consensus Sequence 5'->3'", entity.getConsensusSequence().getString(), style);
63
//        textConsensusSequenceLength = formFactory.createNumberTextWithLabelElement(formElement, "Consensus Seq. Length", entity.getConsensusSequence().getLength(), style);
64
//        ((Text) textConsensusSequenceLength.getMainControl()).setEditable(false);
62 65
        textBarcodeSequence = formFactory.createTextWithLabelElement(formElement, "Barcode Sequence 5'->3'", entity.getBarcodeSequencePart()==null?"":entity.getBarcodeSequencePart().getString(), style);
63 66

  
64 67
        textGeneticAccessNo = formFactory.createTextWithLabelElement(formElement, "Genetic Acc. No.", entity.getGeneticAccessionNumber(), style);
68
        textNCBIUri = formFactory.createUriWithLabelElement(formElement, "NCBI URI", entity.getGenBankUri(), style);
69
        ((Text) textNCBIUri.getMainControl()).setEditable(false);
70
        textENAUri = formFactory.createUriWithLabelElement(formElement, "ENA URI", entity.getEmblUri(), style);
71
        ((Text) textENAUri.getMainControl()).setEditable(false);
72
        textDDBJUri = formFactory.createUriWithLabelElement(formElement, "DDBJ URI", entity.getDdbjUri(), style);
73
        ((Text) textDDBJUri.getMainControl()).setEditable(false);
65 74
        textBoldProcessID = formFactory.createTextWithLabelElement(formElement, "BOLD Process ID", entity.getBoldProcessId(), style);
66 75
        textBoldUri = formFactory.createUriWithLabelElement(formElement, "BOLD URI", entity.getBoldUri(), style);
67 76
        ((Text) textBoldUri.getMainControl()).setEditable(false);
68

  
77
        ((Text) textBoldUri.getMainControl()).setToolTipText("Query BOLD");
69 78
    }
70 79

  
71 80
    /*
......
89 98
            getEntity().setConsensusSequence(consensusSequence);
90 99
            textConsensusSequenceLength.setNumber(consensusSequence.getLength());
91 100
        }
92
        else if(eventSource==textConsensusSequenceLength){
93
            // this is a derived value and should not be edited
94
        }
95 101
        else if(eventSource==textBarcodeSequence){
96 102
            SequenceString barcodeSequencePart = getEntity().getBarcodeSequencePart();
97 103
            if(barcodeSequencePart==null){
......
102 108
        }
103 109
        else if(eventSource==textGeneticAccessNo){
104 110
            getEntity().setGeneticAccessionNumber(textGeneticAccessNo.getText());
111
            if(textGeneticAccessNo.getText()!=null && !textGeneticAccessNo.getText().isEmpty()){
112
                textNCBIUri.setUri(getEntity().getGenBankUri());
113
                textENAUri.setUri(getEntity().getEmblUri());
114
                textDDBJUri.setUri(getEntity().getDdbjUri());
115
            }
116
            else{
117
                textNCBIUri.setText("");
118
                textENAUri.setText("");
119
                textDDBJUri.setText("");
120
            }
105 121
        }
106 122
        else if(eventSource==textBoldProcessID){
107 123
            getEntity().setBoldProcessId(textBoldProcessID.getText());
......
112 128
                textBoldUri.setText("");
113 129
            }
114 130
        }
115
        else if(eventSource==textBoldUri){
116
            //cannot be set because it is generated from the genetic access number and a base URI
117
        }
118 131
    }
119 132

  
120 133
}

Also available in: Unified diff