3 * Copyright (C) 2014 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
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.
10 package eu
.etaxonomy
.taxeditor
.ui
.mvc
.element
;
12 import org
.eclipse
.swt
.SWT
;
13 import org
.eclipse
.swt
.events
.DisposeEvent
;
14 import org
.eclipse
.swt
.events
.DisposeListener
;
15 import org
.eclipse
.swt
.widgets
.Composite
;
16 import org
.eclipse
.swt
.widgets
.Display
;
17 import org
.eclipse
.swt
.widgets
.Text
;
18 import org
.eclipse
.ui
.forms
.widgets
.FormToolkit
;
19 import org
.eclipse
.ui
.forms
.widgets
.TableWrapData
;
20 import org
.eclipse
.ui
.forms
.widgets
.TableWrapLayout
;
22 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmFormFactory
;
23 import eu
.etaxonomy
.taxeditor
.ui
.element
.ICdmFormElement
;
24 import eu
.etaxonomy
.taxeditor
.ui
.mvc
.AbstractCdmComposite
;
31 public class TextReadOnly
extends AbstractCdmComposite
<TextReadOnlyController
> {
33 private final FormToolkit toolkit
= new FormToolkit(Display
.getCurrent());
34 private final Text text
;
37 * Create the composite.
41 public TextReadOnly(Composite parent
, int style
) {
43 addDisposeListener(new DisposeListener() {
45 public void widgetDisposed(DisposeEvent e
) {
49 toolkit
.paintBordersFor(this);
51 setLayout(new TableWrapLayout());
54 text
= new Text(this, SWT
.BORDER
| SWT
.MULTI
);
55 text
.setEnabled(false);
56 text
.setLayoutData(new TableWrapData(TableWrapData
.FILL_GRAB
, TableWrapData
.TOP
, 1, 1));
61 * @see eu.etaxonomy.taxeditor.ui.mvc.AbstractCdmComposite#initInternalController(eu.etaxonomy.taxeditor.ui.element.CdmFormFactory, eu.etaxonomy.taxeditor.ui.element.ICdmFormElement)
64 protected void initInternalController(CdmFormFactory formFactory
, ICdmFormElement parentElement
) {
65 controller
= new TextReadOnlyController(this, formFactory
, parentElement
, null, SWT
.NONE
);
68 public Text
getText() {