Project

General

Profile

Download (2.29 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.selection;
12

    
13
import org.eclipse.swt.events.SelectionEvent;
14

    
15
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
16
import eu.etaxonomy.cdm.model.occurrence.Collection;
17
import eu.etaxonomy.taxeditor.singlesource.ui.forms.CdmFormFactoryFacade;
18
import eu.etaxonomy.taxeditor.ui.dialogs.filteredSelection.CollectionSelectionDialog;
19
import eu.etaxonomy.taxeditor.ui.forms.ICdmFormElement;
20

    
21
/**
22
 * <p>
23
 * CollectionSelectionElement class.
24
 * </p>
25
 * 
26
 * @author n.hoffmann
27
 * @created Oct 13, 2010
28
 * @version 1.0
29
 */
30
public class CollectionSelectionElement extends
31
		AbstractSelectionElement<Collection> {
32

    
33
	public static final int DEFAULT = EDITABLE | SELECTABLE | DELETABLE;
34

    
35
	/**
36
	 * <p>
37
	 * Constructor for CollectionSelectionElement.
38
	 * </p>
39
	 * 
40
	 * @param formFactory
41
	 *            a {@link eu.etaxonomy.taxeditor.singlesource.ui.forms.CdmFormFactoryFacade}
42
	 *            object.
43
	 * @param conversation
44
	 *            a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder}
45
	 *            object.
46
	 * @param parentElement
47
	 *            a {@link eu.etaxonomy.taxeditor.ui.forms.ICdmFormElement}
48
	 *            object.
49
	 * @param labelString
50
	 *            a {@link java.lang.String} object.
51
	 * @param entity
52
	 *            a {@link eu.etaxonomy.cdm.model.occurrence.Collection} object.
53
	 * @param style
54
	 *            a int.
55
	 */
56
	public CollectionSelectionElement(CdmFormFactoryFacade formFactory,
57
			ConversationHolder conversation, ICdmFormElement parentElement,
58
			String labelString, Collection entity, int mode, int style) {
59
		super(formFactory, conversation, parentElement, labelString, entity,
60
				mode, style);
61
	}
62

    
63
	/*
64
	 * (non-Javadoc)
65
	 * 
66
	 * @see
67
	 * org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt
68
	 * .events.SelectionEvent)
69
	 */
70
	/** {@inheritDoc} */
71
	@Override
72
	public void widgetSelected(SelectionEvent e) {
73
		Collection newSelection = CollectionSelectionDialog.select(getShell(),
74
				getConversationHolder(), getEntity());
75
		setSelectionInternal(newSelection);
76
	}
77

    
78
}
(4-4/24)