1 |
2d9a13f7
|
n.hoffmann
|
// $Id$
|
2 |
|
|
/**
|
3 |
|
|
* Copyright (C) 2007 EDIT
|
4 |
f0a072ff
|
Patric Plitzner
|
* European Distributed Institute of Taxonomy
|
5 |
2d9a13f7
|
n.hoffmann
|
* http://www.e-taxonomy.eu
|
6 |
f0a072ff
|
Patric Plitzner
|
*
|
7 |
2d9a13f7
|
n.hoffmann
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
8 |
|
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
9 |
|
|
*/
|
10 |
|
|
|
11 |
78222507
|
n.hoffmann
|
package eu.etaxonomy.taxeditor.ui.dialog.selection;
|
12 |
2d9a13f7
|
n.hoffmann
|
|
13 |
|
|
import java.util.UUID;
|
14 |
|
|
|
15 |
8f5ccc1e
|
Katja Luther
|
import org.eclipse.swt.widgets.Control;
|
16 |
2d9a13f7
|
n.hoffmann
|
import org.eclipse.swt.widgets.Shell;
|
17 |
8f5ccc1e
|
Katja Luther
|
import org.eclipse.swt.widgets.Text;
|
18 |
2d9a13f7
|
n.hoffmann
|
|
19 |
|
|
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
|
20 |
db5e366d
|
n.hoffmann
|
import eu.etaxonomy.cdm.api.service.IAgentService;
|
21 |
8f5ccc1e
|
Katja Luther
|
import eu.etaxonomy.cdm.model.agent.AgentBase;
|
22 |
2d9a13f7
|
n.hoffmann
|
import eu.etaxonomy.cdm.model.agent.Team;
|
23 |
968bf39e
|
Andreas Müller
|
import eu.etaxonomy.cdm.model.common.CdmBase;
|
24 |
f211dd28
|
n.hoffmann
|
import eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard;
|
25 |
|
|
import eu.etaxonomy.taxeditor.newWizard.NewTeamWizard;
|
26 |
2d9a13f7
|
n.hoffmann
|
import eu.etaxonomy.taxeditor.store.CdmStore;
|
27 |
|
|
|
28 |
|
|
/**
|
29 |
3be6ef3e
|
n.hoffmann
|
* <p>FilteredNomenclaturalAuthorTeamSelectionDialog class.</p>
|
30 |
|
|
*
|
31 |
2d9a13f7
|
n.hoffmann
|
* @author n.hoffmann
|
32 |
|
|
* @created Jun 22, 2010
|
33 |
|
|
* @version 1.0
|
34 |
|
|
*/
|
35 |
9a0f58cd
|
n.hoffmann
|
public class NomenclaturalAuthorTeamSelectionDialog extends
|
36 |
8f5ccc1e
|
Katja Luther
|
AbstractFilteredCdmResourceSelectionDialog<AgentBase> {
|
37 |
2d9a13f7
|
n.hoffmann
|
|
38 |
3be6ef3e
|
n.hoffmann
|
/**
|
39 |
|
|
* <p>select</p>
|
40 |
|
|
*
|
41 |
|
|
* @param shell a {@link org.eclipse.swt.widgets.Shell} object.
|
42 |
|
|
* @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
|
43 |
|
|
* @param team a {@link eu.etaxonomy.cdm.model.agent.Team} object.
|
44 |
|
|
* @return a {@link eu.etaxonomy.cdm.model.agent.Team} object.
|
45 |
|
|
*/
|
46 |
4afeb896
|
n.hoffmann
|
public static Team select(Shell shell, ConversationHolder conversation, Team team){
|
47 |
9a0f58cd
|
n.hoffmann
|
NomenclaturalAuthorTeamSelectionDialog dialog = new NomenclaturalAuthorTeamSelectionDialog(shell, conversation,
|
48 |
|
|
"Choose Author Team", false, NomenclaturalAuthorTeamSelectionDialog.class.getCanonicalName(), team);
|
49 |
8f5ccc1e
|
Katja Luther
|
return (Team)getSelectionFromDialog(dialog);
|
50 |
2d9a13f7
|
n.hoffmann
|
}
|
51 |
f0a072ff
|
Patric Plitzner
|
|
52 |
3be6ef3e
|
n.hoffmann
|
/**
|
53 |
|
|
* <p>Constructor for FilteredNomenclaturalAuthorTeamSelectionDialog.</p>
|
54 |
|
|
*
|
55 |
|
|
* @param shell a {@link org.eclipse.swt.widgets.Shell} object.
|
56 |
|
|
* @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
|
57 |
|
|
* @param title a {@link java.lang.String} object.
|
58 |
|
|
* @param multi a boolean.
|
59 |
|
|
* @param settings a {@link java.lang.String} object.
|
60 |
|
|
* @param agent a {@link eu.etaxonomy.cdm.model.agent.Team} object.
|
61 |
|
|
*/
|
62 |
9a0f58cd
|
n.hoffmann
|
protected NomenclaturalAuthorTeamSelectionDialog(Shell shell, ConversationHolder conversation, String title,
|
63 |
2d9a13f7
|
n.hoffmann
|
boolean multi, String settings, Team agent) {
|
64 |
|
|
super(shell, conversation, title, multi, settings, agent);
|
65 |
|
|
}
|
66 |
f0a072ff
|
Patric Plitzner
|
|
67 |
3be6ef3e
|
n.hoffmann
|
/** {@inheritDoc} */
|
68 |
2d9a13f7
|
n.hoffmann
|
@Override
|
69 |
9a0f58cd
|
n.hoffmann
|
protected AbstractNewEntityWizard getNewEntityWizard(String parameter) {
|
70 |
7efbd7cf
|
Katja Luther
|
return new NewTeamWizard(true);
|
71 |
2d9a13f7
|
n.hoffmann
|
}
|
72 |
|
|
|
73 |
3be6ef3e
|
n.hoffmann
|
/** {@inheritDoc} */
|
74 |
2d9a13f7
|
n.hoffmann
|
@Override
|
75 |
|
|
protected String getNewWizardLinkText() {
|
76 |
f0a072ff
|
Patric Plitzner
|
return String.format("Create a new <a>%1s</a>", "Team ");
|
77 |
2d9a13f7
|
n.hoffmann
|
}
|
78 |
|
|
|
79 |
3be6ef3e
|
n.hoffmann
|
/** {@inheritDoc} */
|
80 |
2d9a13f7
|
n.hoffmann
|
@Override
|
81 |
|
|
protected void initModel() {
|
82 |
8f5ccc1e
|
Katja Luther
|
Control control = getPatternControl();
|
83 |
|
|
String pattern = null;
|
84 |
|
|
if (control != null){
|
85 |
|
|
pattern = ((Text)control).getText();
|
86 |
|
|
}
|
87 |
|
|
|
88 |
|
|
model = CdmStore.getService(IAgentService.class).getUuidAndAbbrevTitleCache(limitOfInitialElements, pattern, Team.class);
|
89 |
2d9a13f7
|
n.hoffmann
|
}
|
90 |
|
|
|
91 |
3be6ef3e
|
n.hoffmann
|
/** {@inheritDoc} */
|
92 |
2d9a13f7
|
n.hoffmann
|
@Override
|
93 |
|
|
protected Team getPersistentObject(UUID uuid) {
|
94 |
968bf39e
|
Andreas Müller
|
return CdmBase.deproxy(CdmStore.getService(IAgentService.class).load(uuid), Team.class) ;
|
95 |
2d9a13f7
|
n.hoffmann
|
}
|
96 |
|
|
}
|