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
|
|
10
|
package eu.etaxonomy.taxeditor.ui.dialog.selection;
|
11
|
|
12
|
import java.util.UUID;
|
13
|
|
14
|
import org.eclipse.swt.widgets.Shell;
|
15
|
|
16
|
import eu.etaxonomy.cdm.api.service.IPolytomousKeyService;
|
17
|
import eu.etaxonomy.cdm.model.description.PolytomousKey;
|
18
|
import eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard;
|
19
|
import eu.etaxonomy.taxeditor.store.CdmStore;
|
20
|
|
21
|
/**
|
22
|
* @author n.hoffmann
|
23
|
* @created Dec 6, 2010
|
24
|
* @version 1.0
|
25
|
*/
|
26
|
public class PolytomousKeySelectionDialog extends
|
27
|
AbstractFilteredCdmResourceSelectionDialog<PolytomousKey> {
|
28
|
|
29
|
public static PolytomousKey select(Shell shell, //ConversationHolder conversation,
|
30
|
PolytomousKey key){
|
31
|
PolytomousKeySelectionDialog dialog = new PolytomousKeySelectionDialog(shell, //conversation,
|
32
|
"Choose Polytomous Key", false, PolytomousKeySelectionDialog.class.getCanonicalName(), key);
|
33
|
return getSelectionFromDialog(dialog);
|
34
|
}
|
35
|
|
36
|
/**
|
37
|
* @param shell
|
38
|
* @param conversation
|
39
|
* @param title
|
40
|
* @param multi
|
41
|
* @param settings
|
42
|
* @param cdmObject
|
43
|
*/
|
44
|
protected PolytomousKeySelectionDialog(Shell shell,//ConversationHolder conversation,
|
45
|
String title, boolean multi,
|
46
|
String settings, PolytomousKey cdmObject) {
|
47
|
super(shell, //conversation,
|
48
|
title, multi, settings, cdmObject);
|
49
|
}
|
50
|
|
51
|
/* (non-Javadoc)
|
52
|
* @see eu.etaxonomy.taxeditor.dialogs.filteredSelection.AbstractFilteredCdmResourceSelectionDialog#getPersistentObject(java.util.UUID)
|
53
|
*/
|
54
|
@Override
|
55
|
protected PolytomousKey getPersistentObject(UUID uuid) {
|
56
|
return CdmStore.getService(IPolytomousKeyService.class).load(uuid);
|
57
|
}
|
58
|
|
59
|
/* (non-Javadoc)
|
60
|
* @see eu.etaxonomy.taxeditor.dialogs.filteredSelection.AbstractFilteredCdmResourceSelectionDialog#search
|
61
|
*/
|
62
|
@Override
|
63
|
protected void callService(String pattern) {
|
64
|
model = CdmStore.getService(IPolytomousKeyService.class).getUuidAndTitleCache(limitOfInitialElements, pattern);
|
65
|
}
|
66
|
|
67
|
/* (non-Javadoc)
|
68
|
* @see eu.etaxonomy.taxeditor.dialogs.filteredSelection.AbstractFilteredCdmResourceSelectionDialog#getNewWizardLinkText()
|
69
|
*/
|
70
|
@Override
|
71
|
protected String[] getNewWizardText() {
|
72
|
return null;
|
73
|
}
|
74
|
|
75
|
/* (non-Javadoc)
|
76
|
* @see eu.etaxonomy.taxeditor.dialogs.filteredSelection.AbstractFilteredCdmResourceSelectionDialog#getNewEntityWizard()
|
77
|
*/
|
78
|
@Override
|
79
|
protected AbstractNewEntityWizard getNewEntityWizard(String parameter) {
|
80
|
return null;
|
81
|
}
|
82
|
|
83
|
}
|