cdmlib version change
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / ui / dialogs / filteredSelection / PolytomousKeySelectionDialog.java
1 // $Id$
2 /**
3 * Copyright (C) 2007 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
6 *
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * See LICENSE.TXT at the top of this package for the full license terms.
9 */
10
11 package eu.etaxonomy.taxeditor.ui.dialogs.filteredSelection;
12
13 import java.util.UUID;
14
15 import org.eclipse.swt.widgets.Shell;
16
17 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
18 import eu.etaxonomy.cdm.api.service.IPolytomousKeyService;
19 import eu.etaxonomy.cdm.model.description.PolytomousKey;
20 import eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard;
21 import eu.etaxonomy.taxeditor.store.CdmStore;
22
23 /**
24 * @author n.hoffmann
25 * @created Dec 6, 2010
26 * @version 1.0
27 */
28 public class PolytomousKeySelectionDialog extends
29 AbstractFilteredCdmResourceSelectionDialog<PolytomousKey> {
30
31 public static PolytomousKey select(Shell shell, ConversationHolder conversation, PolytomousKey key){
32 PolytomousKeySelectionDialog dialog = new PolytomousKeySelectionDialog(shell, conversation,
33 "Choose Polytomous Key", false, PolytomousKeySelectionDialog.class.getCanonicalName(), key);
34 return getSelectionFromDialog(dialog);
35 }
36
37 /**
38 * @param shell
39 * @param conversation
40 * @param title
41 * @param multi
42 * @param settings
43 * @param cdmObject
44 */
45 protected PolytomousKeySelectionDialog(Shell shell,
46 ConversationHolder conversation, String title, boolean multi,
47 String settings, PolytomousKey cdmObject) {
48 super(shell, conversation, 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#initModel()
61 */
62 @Override
63 protected void initModel() {
64 model = CdmStore.getService(IPolytomousKeyService.class).getUuidAndTitleCache();
65 }
66
67 /* (non-Javadoc)
68 * @see eu.etaxonomy.taxeditor.dialogs.filteredSelection.AbstractFilteredCdmResourceSelectionDialog#getNewWizardLinkText()
69 */
70 @Override
71 protected String getNewWizardLinkText() {
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 }