Project

General

Profile

Download (1.49 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.forms;
12

    
13
import org.eclipse.swt.SWT;
14
import org.eclipse.swt.widgets.Label;
15

    
16
import eu.etaxonomy.cdm.common.CdmUtils;
17

    
18
/**
19
 * <p>LabelElement class.</p>
20
 *
21
 * @author n.hoffmann
22
 * @created Jun 1, 2010
23
 * @version 1.0
24
 */
25
public class LabelElement extends AbstractCdmFormElement {
26

    
27
	private Label label;
28

    
29
	/**
30
	 * <p>Constructor for LabelElement.</p>
31
	 *
32
	 * @param formFactory a {@link eu.etaxonomy.taxeditor.ui.forms.CdmFormFactory} object.
33
	 * @param formElement a {@link eu.etaxonomy.taxeditor.ui.forms.ICdmFormElement} object.
34
	 * @param text a {@link java.lang.String} object.
35
	 */
36
	public LabelElement(CdmFormFactory formFactory, ICdmFormElement formElement, String text) {
37
		super(formFactory, formElement);
38
		
39
		label = formFactory.createLabel(getLayoutComposite(), text, SWT.WRAP);
40
		label.setLayoutData(CdmFormFactory.FILL_HORIZONTALLY(2, 1));
41
		addControl(label);
42
	}
43
	
44
	
45
	/* (non-Javadoc)
46
	 * @see eu.etaxonomy.taxeditor.forms.ISelectable#setSelected(boolean)
47
	 */
48
	/** {@inheritDoc} */
49
	public void setSelected(boolean selected) {
50
		// no
51
	}
52

    
53

    
54
	/**
55
	 * <p>setText</p>
56
	 *
57
	 * @param text a {@link java.lang.String} object.
58
	 */
59
	public void setText(String text) {
60
		label.setText(CdmUtils.Nz(text));
61
	}
62
}
(23-23/35)