Project

General

Profile

« Previous | Next » 

Revision 0caafa75

Added by Andreas Müller over 1 year ago

ref #10186 further remove ConversationHolder and cleanup

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/selection/CollectorSelectionElement.java
6 6
import eu.etaxonomy.cdm.model.agent.Person;
7 7
import eu.etaxonomy.cdm.model.agent.Team;
8 8
import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
9
import eu.etaxonomy.cdm.model.common.CdmBase;
10
import eu.etaxonomy.cdm.model.reference.Reference;
11 9
import eu.etaxonomy.taxeditor.store.StoreUtil;
12 10
import eu.etaxonomy.taxeditor.ui.dialog.selection.SelectionDialogFactory;
13 11
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
14 12
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
15 13

  
16 14
public class CollectorSelectionElement extends EntitySelectionElement<AgentBase> {
17
	
18
	Team collectorTeam;
19
	/**
20
     * @param formFactory
21
     * @param conversation
22
     * @param parentElement
23
     * @param clazz
24
     * @param labelString
25
     * @param entity
26
     * @param mode
27
     * @param style
28
     */
29
    public CollectorSelectionElement(CdmFormFactory formFactory,// ConversationHolder conversation,
15

  
16
	private Team collectorTeam;
17

  
18
	public CollectorSelectionElement(CdmFormFactory formFactory,
30 19
            ICdmFormElement parentElement, String labelString, AgentBase entity, int mode, int style) {
31
    	super(formFactory, //conversation,
32
        parentElement, AgentBase.class,
33
        labelString, entity, mode, style);
20
    	super(formFactory,parentElement, AgentBase.class,
21
    	        labelString, entity, mode, style);
34 22
    }
35
    public CollectorSelectionElement(CdmFormFactory formFactory,// ConversationHolder conversation,
23

  
24
	public CollectorSelectionElement(CdmFormFactory formFactory,
36 25
            ICdmFormElement parentElement, String labelString, AgentBase entity, Person primaryCollector, int mode, int style) {
37
    	super(formFactory, //conversation,
26
    	super(formFactory,
38 27
        parentElement, AgentBase.class,
39 28
        labelString, primaryCollector, mode, style);
40 29
    	if (entity instanceof Team){
......
46 35
    protected String getTitle() {
47 36
		if (entity != null){
48 37
			if (entity instanceof TeamOrPersonBase){
49
				return ((TeamOrPersonBase)entity).getCollectorTitleCache();		  
38
				return ((TeamOrPersonBase)entity).getCollectorTitleCache();
50 39
			}else{
51 40
				return entity.getTitleCache();
52 41
			}
......
59 48
	public void setCollectorTeam(Team collectorTeam) {
60 49
		this.collectorTeam = collectorTeam;
61 50
	}
62
	
63
	public void widgetSelected(SelectionEvent e) {
51

  
52
	@Override
53
    public void widgetSelected(SelectionEvent e) {
64 54
	    if (e.getSource().equals(button_selection) ){
65 55
	    	AgentBase selection = null;
66 56
	    	if (this.collectorTeam != null){
67 57
	    		selection = SelectionDialogFactory.getSelectionFromDialog(AgentBase.class, getShell(),
68 58
		                collectorTeam, this);
69
	    	}else{	    	
59
	    	}else{
70 60
	    		selection = SelectionDialogFactory.getSelectionFromDialog(AgentBase.class, getShell(),
71 61
	                getEntity(), getParentElement());
72 62
	    	}
......
76 66
            }
77 67
	    }
78 68
	}
79
}
69
}

Also available in: Unified diff