Project

General

Profile

Download (3.48 KB) Statistics
| Branch: | Tag: | Revision:
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.dialog.selection;
12

    
13
import java.util.UUID;
14

    
15
import org.eclipse.swt.widgets.Composite;
16
import org.eclipse.swt.widgets.Control;
17
import org.eclipse.swt.widgets.Shell;
18

    
19
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
20
import eu.etaxonomy.cdm.api.service.IClassificationService;
21
import eu.etaxonomy.cdm.model.taxon.Classification;
22
import eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard;
23
import eu.etaxonomy.taxeditor.store.CdmStore;
24

    
25
/**
26
 * <p>
27
 * FilteredClassificationSelectionDialog class.
28
 * </p>
29
 * 
30
 * @author n.hoffmann
31
 * @created Sep 21, 2009
32
 * @version 1.0
33
 */
34
public class ClassificationSelectionDialog extends
35
		AbstractFilteredCdmResourceSelectionDialog<Classification> {
36

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

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

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

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

    
107
	/*
108
	 * (non-Javadoc)
109
	 * 
110
	 * @see
111
	 * eu.etaxonomy.taxeditor.dialogs.AbstractFilteredCdmResourceSelectionDialog
112
	 * #initModel()
113
	 */
114
	/** {@inheritDoc} */
115
	@Override
116
	protected void initModel() {
117
		model = CdmStore.getService(IClassificationService.class)
118
				.getUuidAndTitleCache();
119
	}
120

    
121
	/** {@inheritDoc} */
122
	@Override
123
	protected AbstractNewEntityWizard getNewEntityWizard(String parameter) {
124
		return null;
125
	}
126

    
127
	/** {@inheritDoc} */
128
	@Override
129
	protected String getNewWizardLinkText() {
130
		return null;
131
	}
132
}
(3-3/20)