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
|
public static Team select(Shell shell,
|
33
|
Team team){
|
34
|
NomenclaturalAuthorTeamSelectionDialog dialog = new NomenclaturalAuthorTeamSelectionDialog(shell, //conversation,
|
35
|
"Choose Author Team", false, NomenclaturalAuthorTeamSelectionDialog.class.getCanonicalName(), team);
|
36
|
return getSelectionFromDialog(dialog);
|
37
|
}
|
38
|
|
39
|
protected NomenclaturalAuthorTeamSelectionDialog(Shell shell,
|
40
|
String title,
|
41
|
boolean multi, String settings, Team agent) {
|
42
|
super(shell,
|
43
|
title, multi, settings, agent);
|
44
|
}
|
45
|
|
46
|
@Override
|
47
|
protected AbstractNewEntityWizard getNewEntityWizard(String parameter) {
|
48
|
return new NewTeamWizard(true, false);
|
49
|
}
|
50
|
|
51
|
@Override
|
52
|
protected String[] getNewWizardText() {
|
53
|
return new String[]{"new Team"};
|
54
|
}
|
55
|
|
56
|
@Override
|
57
|
protected Team getPersistentObject(UUID uuid) {
|
58
|
return CdmBase.deproxy(CdmStore.getService(IAgentService.class).load(uuid), Team.class) ;
|
59
|
}
|
60
|
|
61
|
@Override
|
62
|
protected void callService(String pattern) {
|
63
|
model = (List)CdmStore.getService(IAgentService.class).getUuidAndAbbrevTitleCache(Team.class, limitOfInitialElements, pattern);
|
64
|
}
|
65
|
}
|