Project

General

Profile

« Previous | Next » 

Revision f561b00c

Added by Niels Hoffmann about 13 years ago

Refactoring selection elements so they can be configured

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/selection/FeatureTreeSelectionElement.java
1 1
// $Id$
2 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
*/
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 10

  
11 11
package eu.etaxonomy.taxeditor.ui.selection;
12 12

  
13
import org.apache.log4j.Logger;
14 13
import org.eclipse.swt.events.SelectionEvent;
15 14

  
16 15
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
......
20 19
import eu.etaxonomy.taxeditor.ui.forms.ICdmFormElement;
21 20

  
22 21
/**
23
 * <p>FeatureTreeSelectionElement class.</p>
24
 *
22
 * <p>
23
 * FeatureTreeSelectionElement class.
24
 * </p>
25
 * 
25 26
 * @author n.hoffmann
26 27
 * @created Sep 17, 2010
27 28
 * @version 1.0
28 29
 */
29
public class FeatureTreeSelectionElement extends AbstractSelectionElement<FeatureTree> {
30

  
30
public class FeatureTreeSelectionElement extends
31
		AbstractSelectionElement<FeatureTree> {
31 32

  
32
	private static final Logger logger = Logger
33
			.getLogger(FeatureTreeSelectionElement.class);
33
	public static final int DEFAULT = DELETABLE;
34 34

  
35 35
	/**
36
	 * <p>Constructor for FeatureTreeSelectionElement.</p>
37
	 *
38
	 * @param formFactory a {@link eu.etaxonomy.taxeditor.ui.forms.CdmFormFactory} object.
39
	 * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
40
	 * @param parentElement a {@link eu.etaxonomy.taxeditor.ui.forms.ICdmFormElement} object.
41
	 * @param labelString a {@link java.lang.String} object.
42
	 * @param entity a {@link eu.etaxonomy.cdm.model.description.FeatureTree} object.
43
	 * @param style a int.
36
	 * <p>
37
	 * Constructor for FeatureTreeSelectionElement.
38
	 * </p>
39
	 * 
40
	 * @param formFactory
41
	 *            a {@link eu.etaxonomy.taxeditor.ui.forms.CdmFormFactory}
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.description.FeatureTree}
53
	 *            object.
54
	 * @param style
55
	 *            a int.
44 56
	 */
45 57
	public FeatureTreeSelectionElement(CdmFormFactory formFactory,
46 58
			ConversationHolder conversation, ICdmFormElement parentElement,
47
			String labelString, FeatureTree entity, int style) {
59
			String labelString, FeatureTree entity, int mode, int style) {
48 60
		super(formFactory, conversation, parentElement, labelString, entity,
49
				false, false, true, style);
61
				mode, style);
50 62
	}
51
	
52
	/* (non-Javadoc)
53
	 * @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent)
63

  
64
	/*
65
	 * (non-Javadoc)
66
	 * 
67
	 * @see
68
	 * org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt
69
	 * .events.SelectionEvent)
54 70
	 */
55 71
	/** {@inheritDoc} */
56 72
	@Override
57 73
	public void widgetSelected(SelectionEvent e) {
58
		FeatureTree newSelection = FeatureTreeSelectionDialog.select(getShell(), getConversationHolder(), entity);
74
		FeatureTree newSelection = FeatureTreeSelectionDialog.select(
75
				getShell(), getConversationHolder(), entity);
59 76
		setSelectionInternal(newSelection);
60 77
	}
61 78
}

Also available in: Unified diff