Project

General

Profile

« Previous | Next » 

Revision cd024235

Added by Katja Luther over 3 years ago

ref #9199: adapt nomenclatural status to original source and layout issues

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/supplemental/AbstractSourcedEntityElement.java
30 30

  
31 31
	private SelectionArbitrator selectionArbitrator;
32 32
	private OriginalSourceElement sourceElement;
33
	private String label = "Source";
33 34
//	protected EntitySelectionElement<Reference> selection_reference;
34 35
//	protected TextWithLabelElement text_referenceDetail;
35 36

  
......
37 38

  
38 39
	public AbstractSourcedEntityElement(CdmFormFactory formFactory,
39 40
			AbstractFormSection section, T entity,
40
			SelectionListener removeListener, int style, boolean isCommonNameReference) {
41
			SelectionListener removeListener, String label, int style, boolean isCommonNameReference) {
41 42
		super(formFactory, section, entity, removeListener, null, style);
42 43
		// make this element selectable
43 44
		if(formFactory.getSelectionProvider() != null){
44 45
			selectionArbitrator = formFactory.createSelectionArbitrator(this);
45 46
		}
46 47
		this.isCommonNameReference = isCommonNameReference;
48

  
49

  
47 50
	}
48 51

  
49 52
    public AbstractSourcedEntityElement(CdmFormFactory formFactory,
50 53
            AbstractFormSection section, T entity,
51
            SelectionListener removeListener, int style) {
52
        super(formFactory, section, entity, removeListener, null, style);
53
        // make this element selectable
54
        if(formFactory.getSelectionProvider() != null){
55
            selectionArbitrator = formFactory.createSelectionArbitrator(this);
56
        }
54
            SelectionListener removeListener, String label, int style) {
55
        this(formFactory, section, entity, removeListener, label, style, false);
57 56
    }
58 57

  
59
	@Override
58

  
59
    @Override
60 60
	public void createControls(ICdmFormElement formElement, int style) {
61 61

  
62
	    sourceElement = formFactory.createOriginalSourceElement(formElement, entity);
62
	    sourceElement = formFactory.createOriginalSourceElement(formElement, entity, label);
63 63

  
64 64
        if (entity.getSource() == null){
65 65
            DescriptionElementSource source = DescriptionElementSource.NewPrimarySourceInstance(null, null);
......
75 75
	@Override
76 76
	public void setEntity(T entity) {
77 77
		this.entity = entity;
78

  
79
//		selection_reference.setEntity(entity.getCitation());
80
//		text_referenceDetail.setText(entity.getCitationMicroReference());
81 78
	}
82 79

  
83 80
	@Override
......
85 82
		return selectionArbitrator;
86 83
	}
87 84

  
85
	public void setSourceLabel(String sourceLabel){
86
	    this.label = sourceLabel;
87
	    if (sourceElement != null){
88
	        this.sourceElement.getReferenceSelectionElement().setLabel(sourceLabel);
89
	    }
90
	}
91

  
88 92
}

Also available in: Unified diff