4 package eu
.etaxonomy
.taxeditor
.forms
;
6 import org
.eclipse
.swt
.events
.ModifyEvent
;
7 import org
.eclipse
.swt
.events
.ModifyListener
;
8 import org
.eclipse
.swt
.widgets
.Composite
;
10 import eu
.etaxonomy
.cdm
.model
.common
.Annotation
;
16 public class AnnotationComposite
extends MultilineTextWithLabel
implements ModifyListener
{
18 private Annotation annotation
;
26 protected AnnotationComposite(Composite parent
, Annotation annotation
, int style
) {
27 super(parent
, "Annotation", null, 100, style
);
29 this.setAnnotation(annotation
);
31 text
.addModifyListener(this);
35 * @param annotation the annotation to set
37 public void setAnnotation(Annotation annotation
) {
38 this.annotation
= annotation
;
39 setText(annotation
.getText());
43 * @return the annotation
45 public Annotation
getAnnotation() {
50 * @see org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events.ModifyEvent)
52 public void modifyText(ModifyEvent e
) {
53 annotation
.setText(getText());