Revision 0caafa75
Added by Andreas Müller over 1 year ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/PersonSelectionDialog.java | ||
---|---|---|
6 | 6 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
7 | 7 |
* See LICENSE.TXT at the top of this package for the full license terms. |
8 | 8 |
*/ |
9 |
|
|
10 | 9 |
package eu.etaxonomy.taxeditor.ui.dialog.selection; |
11 | 10 |
|
12 |
import java.util.List; |
|
13 | 11 |
import java.util.UUID; |
14 | 12 |
|
15 | 13 |
import org.eclipse.swt.widgets.Shell; |
... | ... | |
21 | 19 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
22 | 20 |
|
23 | 21 |
/** |
24 |
* <p>FilteredPersonSelectionDialog class.</p> |
|
25 |
* |
|
26 | 22 |
* @author n.hoffmann |
27 | 23 |
* @created Sep 24, 2009 |
28 |
* @version 1.0 |
|
29 | 24 |
*/ |
30 | 25 |
public class PersonSelectionDialog extends |
31 | 26 |
AgentSelectionDialog<Person> { |
32 | 27 |
|
33 |
/** |
|
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 person a {@link eu.etaxonomy.cdm.model.agent.Person} object. |
|
39 |
* @return a {@link eu.etaxonomy.cdm.model.agent.Person} object. |
|
40 |
*/ |
|
41 |
public static Person select(Shell shell, //onversationHolder conversation, |
|
42 |
Person person){ |
|
43 |
PersonSelectionDialog dialog = new PersonSelectionDialog(shell, //conversation, |
|
28 |
public static Person select(Shell shell, Person person){ |
|
29 |
PersonSelectionDialog dialog = new PersonSelectionDialog(shell, |
|
44 | 30 |
"Choose a person", false, PersonSelectionDialog.class.getCanonicalName(), person); |
45 | 31 |
return getSelectionFromDialog(dialog); |
46 | 32 |
} |
47 | 33 |
|
48 |
/** |
|
49 |
* <p>Constructor for FilteredPersonSelectionDialog.</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.Person} object. |
|
56 |
* @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object. |
|
57 |
*/ |
|
58 |
protected PersonSelectionDialog(Shell shell,// ConversationHolder conversation, |
|
59 |
String title, |
|
34 |
protected PersonSelectionDialog(Shell shell, String title, |
|
60 | 35 |
boolean multi, String settings, Person cdmObject) { |
61 | 36 |
super(shell, title, multi, settings, cdmObject, true); |
62 | 37 |
} |
63 | 38 |
|
64 |
|
|
65 |
|
|
66 |
/* (non-Javadoc) |
|
67 |
* @see eu.etaxonomy.taxeditor.dialogs.filteredSelection.AbstractFilteredCdmResourceSelectionDialog#getPersistentObject(java.util.UUID) |
|
68 |
*/ |
|
69 |
/** {@inheritDoc} */ |
|
70 | 39 |
@Override |
71 | 40 |
protected Person getPersistentObject(UUID uuid) { |
72 | 41 |
return (Person) CdmStore.getService(IAgentService.class).load(uuid); |
73 | 42 |
} |
74 | 43 |
|
75 |
/* (non-Javadoc) |
|
76 |
* @see eu.etaxonomy.taxeditor.dialogs.filteredSelection.AbstractFilteredCdmResourceSelectionDialog#search |
|
77 |
*/ |
|
78 |
/** {@inheritDoc} */ |
|
79 | 44 |
@Override |
80 | 45 |
protected void callService(String pattern) { |
81 | 46 |
model = CdmStore.getService(IAgentService.class).getUuidAndTitleCache(Person.class, limitOfInitialElements, pattern); |
82 | 47 |
} |
83 | 48 |
|
84 |
/** {@inheritDoc} */ |
|
85 | 49 |
@Override |
86 | 50 |
protected AbstractNewEntityWizard getNewEntityWizard(String parameter) { |
87 | 51 |
return new NewPersonWizard(); |
88 | 52 |
} |
89 | 53 |
|
90 |
/** {@inheritDoc} */ |
|
91 | 54 |
@Override |
92 | 55 |
protected String[] getNewWizardText() { |
93 | 56 |
return new String[]{"New Person"}; |
94 | 57 |
} |
95 |
} |
|
58 |
} |
Also available in: Unified diff
ref #10186 further remove ConversationHolder and cleanup