Project

General

Profile

Download (3.09 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
* Copyright (C) 2007 EDIT
3
* European Distributed Institute of Taxonomy
4
* http://www.e-taxonomy.eu
5
*
6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7
* See LICENSE.TXT at the top of this package for the full license terms.
8
*/
9
package eu.etaxonomy.taxeditor.ui.dialog.selection;
10

    
11
import java.util.List;
12
import java.util.UUID;
13

    
14
import org.eclipse.swt.widgets.Shell;
15

    
16
import eu.etaxonomy.cdm.api.service.IAgentService;
17
import eu.etaxonomy.cdm.model.agent.Team;
18
import eu.etaxonomy.cdm.model.common.CdmBase;
19
import eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard;
20
import eu.etaxonomy.taxeditor.newWizard.NewTeamWizard;
21
import eu.etaxonomy.taxeditor.store.CdmStore;
22

    
23
/**
24
 * FilteredNomenclaturalAuthorTeamSelectionDialog class.
25
 *
26
 * @author n.hoffmann
27
 * @created Jun 22, 2010
28
 */
29
public class NomenclaturalAuthorTeamSelectionDialog
30
        extends AbstractFilteredCdmResourceSelectionDialog<Team> {
31

    
32
	/**
33
	 * <p>select</p>
34
	 *
35
	 * @param shell a {@link org.eclipse.swt.widgets.Shell} object.
36
	 * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
37
	 * @param team a {@link eu.etaxonomy.cdm.model.agent.Team} object.
38
	 * @return a {@link eu.etaxonomy.cdm.model.agent.Team} object.
39
	 */
40
	public static Team select(Shell shell,
41
	        Team team){
42
		NomenclaturalAuthorTeamSelectionDialog dialog = new NomenclaturalAuthorTeamSelectionDialog(shell, //conversation,
43
				"Choose Author Team", false, NomenclaturalAuthorTeamSelectionDialog.class.getCanonicalName(), team);
44
		return getSelectionFromDialog(dialog);
45
	}
46

    
47
	/**
48
	 * <p>Constructor for FilteredNomenclaturalAuthorTeamSelectionDialog.</p>
49
	 *
50
	 * @param shell a {@link org.eclipse.swt.widgets.Shell} object.
51
	 * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
52
	 * @param title a {@link java.lang.String} object.
53
	 * @param multi a boolean.
54
	 * @param settings a {@link java.lang.String} object.
55
	 * @param agent a {@link eu.etaxonomy.cdm.model.agent.Team} object.
56
	 */
57
	protected NomenclaturalAuthorTeamSelectionDialog(Shell shell,
58
	        String title,
59
			boolean multi, String settings, Team agent) {
60
		super(shell,
61
		        title, multi, settings, agent);
62
	}
63

    
64
	@Override
65
	protected AbstractNewEntityWizard getNewEntityWizard(String parameter) {
66
		return new NewTeamWizard(true);
67
	}
68

    
69
	@Override
70
	protected String[] getNewWizardText() {
71
		return new String[]{"new Team"};
72
	}
73

    
74
//	@Override
75
//	protected void search() {
76
//	    Control control =getSearchField();
77
//        String pattern = null;
78
//        if (control != null){
79
//            pattern = ((Text)control).getText();
80
//        }
81
//
82
//		model = CdmStore.getService(IAgentService.class).getUuidAndAbbrevTitleCache(limitOfInitialElements, pattern, Team.class);
83
//	}
84

    
85
	@Override
86
	protected Team getPersistentObject(UUID uuid) {
87
		return CdmBase.deproxy(CdmStore.getService(IAgentService.class).load(uuid), Team.class) ;
88
	}
89

    
90
    @Override
91
    protected void callService(String pattern) {
92
        model = (List)CdmStore.getService(IAgentService.class).getUuidAndAbbrevTitleCache(Team.class, limitOfInitialElements, pattern);
93
    }
94
}
(26-26/46)