Project

General

Profile

Download (3.48 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
 * @version 1.0
29
 */
30
public class ClassificationSelectionDialog extends
31
		AbstractFilteredCdmResourceSelectionDialog<Classification> {
32

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

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

    
79
//	/*
80
//	 * (non-Javadoc)
81
//	 *
82
//	 * @see
83
//	 * org.eclipse.ui.dialogs.FilteredItemsSelectionDialog#createExtendedContentArea
84
//	 * (org.eclipse.swt.widgets.Composite)
85
//	 */
86
//	/** {@inheritDoc} */
87
//	@Override
88
//	protected Control createExtendedContentArea(Composite parent) {
89
//		return null;
90
//	}
91

    
92
	/*
93
	 * (non-Javadoc)
94
	 *
95
	 * @see
96
	 * eu.etaxonomy.taxeditor.dialogs.AbstractFilteredCdmResourceSelectionDialog
97
	 * #getPersistentObject(java.util.UUID)
98
	 */
99
	/** {@inheritDoc} */
100
	@Override
101
	protected Classification getPersistentObject(UUID cdmUuid) {
102
		return CdmStore.getService(IClassificationService.class).load(cdmUuid);
103
	}
104

    
105
	/*
106
	 * (non-Javadoc)
107
	 *
108
	 * @see
109
	 * eu.etaxonomy.taxeditor.dialogs.AbstractFilteredCdmResourceSelectionDialog
110
	 * #search
111
	 */
112
	/** {@inheritDoc} */
113
	@Override
114
	protected void callService(String pattern) {
115
	    model = CdmStore.getService(IClassificationService.class).getUuidAndTitleCache(limitOfInitialElements, pattern);
116
    }
117

    
118
	/** {@inheritDoc} */
119
	@Override
120
	protected AbstractNewEntityWizard getNewEntityWizard(String parameter) {
121
		return null;
122
	}
123

    
124
	/** {@inheritDoc} */
125
	@Override
126
	protected String[] getNewWizardText() {
127
		return null;
128
	}
129
}
(7-7/39)