Project

General

Profile

Download (2.89 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.service.IClassificationService;
17
import eu.etaxonomy.cdm.model.taxon.Classification;
18
import eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard;
19
import eu.etaxonomy.taxeditor.store.CdmStore;
20

    
21
/**
22
 * <p>
23
 * FilteredClassificationSelectionDialog class.
24
 * </p>
25
 *
26
 * @author n.hoffmann
27
 * @created Sep 21, 2009
28
 */
29
public class ClassificationSelectionDialog extends
30
		AbstractFilteredCdmResourceSelectionDialog<Classification> {
31

    
32
	/**
33
	 * <p>
34
	 * select
35
	 * </p>
36
	 *
37
	 * @param shell
38
	 *            a {@link org.eclipse.swt.widgets.Shell} object.
39
	 * @param conversation
40
	 *            a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder}
41
	 *            object.
42
	 * @param curentSelection
43
	 * @return a {@link eu.etaxonomy.cdm.model.taxon.TaxonomicTree} object.
44
	 */
45
	public static Classification select(Shell shell,//ConversationHolder conversation,
46
	        Classification curentSelection) {
47
		ClassificationSelectionDialog dialog = new ClassificationSelectionDialog(shell, //conversation,
48
		        "Choose a Classification", false, "", null);
49
		return getSelectionFromDialog(dialog);
50
	}
51

    
52
	/**
53
	 * <p>
54
	 * Constructor for FilteredClassificationSelectionDialog.
55
	 * </p>
56
	 *
57
	 * @param shell
58
	 *            a {@link org.eclipse.swt.widgets.Shell} object.
59
	 * @param title
60
	 *            a {@link java.lang.String} object.
61
	 * @param multi
62
	 *            a boolean.
63
	 * @param settings
64
	 *            a {@link java.lang.String} object.
65
	 * @param conversation
66
	 *            a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder}
67
	 *            object.
68
	 * @param classification
69
	 *            a {@link eu.etaxonomy.cdm.model.taxon.TaxonomicTree} object.
70
	 */
71
	protected ClassificationSelectionDialog(Shell shell,//ConversationHolder conversation,
72
	        String title, boolean multi,
73
			String settings, Classification classification) {
74
		super(shell, //conversation,
75
		        title, multi, settings, classification);
76
	}
77

    
78
	/** {@inheritDoc} */
79
	@Override
80
	protected Classification getPersistentObject(UUID cdmUuid) {
81
		return CdmStore.getService(IClassificationService.class).load(cdmUuid);
82
	}
83

    
84
	/** {@inheritDoc} */
85
	@Override
86
	protected void callService(String pattern) {
87
	    model = CdmStore.getService(IClassificationService.class).getUuidAndTitleCache(limitOfInitialElements, pattern);
88
    }
89

    
90
	/** {@inheritDoc} */
91
	@Override
92
	protected AbstractNewEntityWizard getNewEntityWizard(String parameter) {
93
		return null;
94
	}
95

    
96
	/** {@inheritDoc} */
97
	@Override
98
	protected String[] getNewWizardText() {
99
		return null;
100
	}
101
}
(7-7/44)