Project

General

Profile

Download (1.89 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.common.Group;
17
import eu.etaxonomy.taxeditor.ui.dialog.selection.GroupSelectionDialog;
18
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
19
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
20

    
21
/**
22
 * @author n.hoffmann
23
 * @created Mar 10, 2011
24
 * @version 1.0
25
 */
26
public class GroupSelectionElement extends AbstractSelectionElement<Group> {
27

    
28
	public static final int DEFAULT = NOTHING;
29

    
30
	/**
31
	 * @param formFactory
32
	 * @param conversation
33
	 * @param parentElement
34
	 * @param labelString
35
	 * @param entity
36
	 * @param isEditable
37
	 * @param isSelectable
38
	 * @param isDeletable
39
	 * @param style
40
	 */
41
	public GroupSelectionElement(CdmFormFactory formFactory,
42
			ConversationHolder conversation, ICdmFormElement parentElement,
43
			String labelString, Group entity, int mode, int style) {
44
		super(formFactory, conversation, parentElement, labelString, entity,
45
				mode, style);
46
	}
47

    
48
	/*
49
	 * (non-Javadoc)
50
	 * 
51
	 * @see
52
	 * org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt
53
	 * .events.SelectionEvent)
54
	 */
55
	@Override
56
	public void widgetSelected(SelectionEvent e) {
57
		Group newSelection = GroupSelectionDialog.select(getShell(),
58
				getConversationHolder(), getEntity());
59
		setSelectionInternal(newSelection);
60
	}
61

    
62
	/*
63
	 * (non-Javadoc)
64
	 * 
65
	 * @see
66
	 * eu.etaxonomy.taxeditor.ui.selection.AbstractSelectionElement#getTitle()
67
	 */
68
	@Override
69
	protected String getTitle() {
70
		return (getEntity() != null) ? getEntity().getName() : "UNTITLED GROUP";
71
	}
72

    
73
}
(10-10/24)