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