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
|
import eu.etaxonomy.taxeditor.singlesource.ui.forms.CdmFormFactoryFacade;
|
18
|
|
19
|
/**
|
20
|
* <p>LabelElement class.</p>
|
21
|
*
|
22
|
* @author n.hoffmann
|
23
|
* @created Jun 1, 2010
|
24
|
* @version 1.0
|
25
|
*/
|
26
|
public class LabelElement extends AbstractCdmFormElement {
|
27
|
|
28
|
private Label label;
|
29
|
|
30
|
/**
|
31
|
* <p>Constructor for LabelElement.</p>
|
32
|
*
|
33
|
* @param formFactory a {@link eu.etaxonomy.taxeditor.singlesource.ui.forms.CdmFormFactoryFacade} object.
|
34
|
* @param formElement a {@link eu.etaxonomy.taxeditor.ui.forms.ICdmFormElement} object.
|
35
|
* @param text a {@link java.lang.String} object.
|
36
|
*/
|
37
|
public LabelElement(CdmFormFactoryFacade formFactory, ICdmFormElement formElement, String text) {
|
38
|
super(formFactory, formElement);
|
39
|
|
40
|
label = formFactory.createLabel(getLayoutComposite(), text, SWT.WRAP);
|
41
|
label.setLayoutData(CdmFormFactoryFacade.FILL_HORIZONTALLY(2, 1));
|
42
|
addControl(label);
|
43
|
}
|
44
|
|
45
|
|
46
|
/* (non-Javadoc)
|
47
|
* @see eu.etaxonomy.taxeditor.forms.ISelectable#setSelected(boolean)
|
48
|
*/
|
49
|
/** {@inheritDoc} */
|
50
|
public void setSelected(boolean selected) {
|
51
|
// no
|
52
|
}
|
53
|
|
54
|
|
55
|
/**
|
56
|
* <p>setText</p>
|
57
|
*
|
58
|
* @param text a {@link java.lang.String} object.
|
59
|
*/
|
60
|
public void setText(String text) {
|
61
|
label.setText(CdmUtils.Nz(text));
|
62
|
}
|
63
|
}
|