Project

General

Profile

Download (2.53 KB) Statistics
| Branch: | Tag: | Revision:
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.conversation.ConversationHolder;
17
import eu.etaxonomy.cdm.api.service.IPolytomousKeyService;
18
import eu.etaxonomy.cdm.model.description.PolytomousKey;
19
import eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard;
20
import eu.etaxonomy.taxeditor.store.CdmStore;
21

    
22
/**
23
 * @author n.hoffmann
24
 * @created Dec 6, 2010
25
 * @version 1.0
26
 */
27
public class PolytomousKeySelectionDialog extends
28
		AbstractFilteredCdmResourceSelectionDialog<PolytomousKey> {
29

    
30
	public static PolytomousKey select(Shell shell, ConversationHolder conversation, 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,
45
			ConversationHolder conversation, String title, boolean multi,
46
			String settings, PolytomousKey cdmObject) {
47
		super(shell, conversation, title, multi, settings, cdmObject);
48
	}
49

    
50
	/* (non-Javadoc)
51
	 * @see eu.etaxonomy.taxeditor.dialogs.filteredSelection.AbstractFilteredCdmResourceSelectionDialog#getPersistentObject(java.util.UUID)
52
	 */
53
	@Override
54
	protected PolytomousKey getPersistentObject(UUID uuid) {
55
		return CdmStore.getService(IPolytomousKeyService.class).load(uuid);
56
	}
57

    
58
	/* (non-Javadoc)
59
	 * @see eu.etaxonomy.taxeditor.dialogs.filteredSelection.AbstractFilteredCdmResourceSelectionDialog#search
60
	 */
61
	@Override
62
	protected void search() {
63
		model = CdmStore.getService(IPolytomousKeyService.class).getUuidAndTitleCache(null, null);
64
	}
65

    
66
	/* (non-Javadoc)
67
	 * @see eu.etaxonomy.taxeditor.dialogs.filteredSelection.AbstractFilteredCdmResourceSelectionDialog#getNewWizardLinkText()
68
	 */
69
	@Override
70
	protected String[] getNewWizardText() {
71
		return null;
72
	}
73

    
74
	/* (non-Javadoc)
75
	 * @see eu.etaxonomy.taxeditor.dialogs.filteredSelection.AbstractFilteredCdmResourceSelectionDialog#getNewEntityWizard()
76
	 */
77
	@Override
78
	protected AbstractNewEntityWizard getNewEntityWizard(String parameter) {
79
		return null;
80
	}
81

    
82
}
(27-27/40)