1 |
729887cf
|
n.hoffmann
|
/**
|
2 |
|
|
* Copyright (C) 2007 EDIT
|
3 |
f0a072ff
|
Patric Plitzner
|
* European Distributed Institute of Taxonomy
|
4 |
729887cf
|
n.hoffmann
|
* http://www.e-taxonomy.eu
|
5 |
f0a072ff
|
Patric Plitzner
|
*
|
6 |
729887cf
|
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 |
729887cf
|
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 |
729887cf
|
n.hoffmann
|
import eu.etaxonomy.cdm.model.agent.Team;
|
18 |
968bf39e
|
Andreas Müller
|
import eu.etaxonomy.cdm.model.common.CdmBase;
|
19 |
f211dd28
|
n.hoffmann
|
import eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard;
|
20 |
|
|
import eu.etaxonomy.taxeditor.newWizard.NewTeamWizard;
|
21 |
729887cf
|
n.hoffmann
|
import eu.etaxonomy.taxeditor.store.CdmStore;
|
22 |
|
|
|
23 |
|
|
/**
|
24 |
3be6ef3e
|
n.hoffmann
|
* <p>FilteredTeamSelectionDialog class.</p>
|
25 |
|
|
*
|
26 |
729887cf
|
n.hoffmann
|
* @author n.hoffmann
|
27 |
|
|
* @created Sep 24, 2009
|
28 |
|
|
* @version 1.0
|
29 |
|
|
*/
|
30 |
9a0f58cd
|
n.hoffmann
|
public class TeamSelectionDialog extends
|
31 |
729887cf
|
n.hoffmann
|
AbstractFilteredCdmResourceSelectionDialog<Team> {
|
32 |
f0a072ff
|
Patric Plitzner
|
|
33 |
3be6ef3e
|
n.hoffmann
|
/**
|
34 |
|
|
* <p>select</p>
|
35 |
|
|
*
|
36 |
|
|
* @param shell a {@link org.eclipse.swt.widgets.Shell} object.
|
37 |
|
|
* @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
|
38 |
|
|
* @param team a {@link eu.etaxonomy.cdm.model.agent.Team} object.
|
39 |
|
|
* @return a {@link eu.etaxonomy.cdm.model.agent.Team} object.
|
40 |
|
|
*/
|
41 |
f5979052
|
Katja Luther
|
public static Team select(Shell shell, //ConversationHolder conversation,
|
42 |
|
|
Team team){
|
43 |
|
|
TeamSelectionDialog dialog = new TeamSelectionDialog(shell, //conversation,
|
44 |
9a0f58cd
|
n.hoffmann
|
"Choose Team", false, TeamSelectionDialog.class.getCanonicalName(), team);
|
45 |
729887cf
|
n.hoffmann
|
return getSelectionFromDialog(dialog);
|
46 |
|
|
}
|
47 |
f0a072ff
|
Patric Plitzner
|
|
48 |
729887cf
|
n.hoffmann
|
/**
|
49 |
3be6ef3e
|
n.hoffmann
|
* <p>Constructor for FilteredTeamSelectionDialog.</p>
|
50 |
|
|
*
|
51 |
|
|
* @param shell a {@link org.eclipse.swt.widgets.Shell} 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 cdmObject a {@link eu.etaxonomy.cdm.model.agent.Team} object.
|
56 |
|
|
* @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
|
57 |
729887cf
|
n.hoffmann
|
*/
|
58 |
f5979052
|
Katja Luther
|
protected TeamSelectionDialog(Shell shell, //ConversationHolder conversation,
|
59 |
729887cf
|
n.hoffmann
|
String title, boolean multi, String settings,
|
60 |
|
|
Team cdmObject) {
|
61 |
f5979052
|
Katja Luther
|
super(shell, //conversation,
|
62 |
|
|
title, multi, settings, cdmObject);
|
63 |
729887cf
|
n.hoffmann
|
}
|
64 |
|
|
|
65 |
|
|
/* (non-Javadoc)
|
66 |
d41c6a72
|
Katja Luther
|
* @see eu.etaxonomy.taxeditor.dialogs.filteredSelection.AbstractFilteredCdmResourceSelectionDialog#search
|
67 |
729887cf
|
n.hoffmann
|
*/
|
68 |
3be6ef3e
|
n.hoffmann
|
/** {@inheritDoc} */
|
69 |
729887cf
|
n.hoffmann
|
@Override
|
70 |
0ce80af9
|
Katja Luther
|
protected void callService(String pattern) {
|
71 |
|
|
model = CdmStore.getService(IAgentService.class).getUuidAndTitleCache(Team.class, limitOfInitialElements, pattern);
|
72 |
|
|
|
73 |
729887cf
|
n.hoffmann
|
}
|
74 |
|
|
|
75 |
3be6ef3e
|
n.hoffmann
|
/** {@inheritDoc} */
|
76 |
729887cf
|
n.hoffmann
|
@Override
|
77 |
9a0f58cd
|
n.hoffmann
|
protected AbstractNewEntityWizard getNewEntityWizard(String parameter) {
|
78 |
2d9a13f7
|
n.hoffmann
|
return new NewTeamWizard();
|
79 |
|
|
}
|
80 |
|
|
|
81 |
3be6ef3e
|
n.hoffmann
|
/** {@inheritDoc} */
|
82 |
2d9a13f7
|
n.hoffmann
|
@Override
|
83 |
5aeccadc
|
Katja Luther
|
protected String[] getNewWizardText() {
|
84 |
0ce80af9
|
Katja Luther
|
return new String[]{"New Team"};
|
85 |
729887cf
|
n.hoffmann
|
}
|
86 |
|
|
|
87 |
3be6ef3e
|
n.hoffmann
|
/** {@inheritDoc} */
|
88 |
729887cf
|
n.hoffmann
|
@Override
|
89 |
2d9a13f7
|
n.hoffmann
|
protected Team getPersistentObject(UUID uuid) {
|
90 |
968bf39e
|
Andreas Müller
|
return CdmBase.deproxy(CdmStore.getService(IAgentService.class).load(uuid), Team.class);
|
91 |
729887cf
|
n.hoffmann
|
}
|
92 |
|
|
}
|