2 * Copyright (C) 2019 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
9 package eu
.etaxonomy
.taxeditor
.view
.search
.facet
.occurrence
;
11 import org
.eclipse
.jface
.layout
.GridDataFactory
;
12 import org
.eclipse
.jface
.resource
.JFaceResources
;
13 import org
.eclipse
.swt
.SWT
;
14 import org
.eclipse
.swt
.events
.ControlAdapter
;
15 import org
.eclipse
.swt
.events
.ControlEvent
;
16 import org
.eclipse
.swt
.layout
.GridData
;
17 import org
.eclipse
.swt
.layout
.GridLayout
;
18 import org
.eclipse
.swt
.widgets
.Composite
;
19 import org
.eclipse
.swt
.widgets
.Label
;
21 import eu
.etaxonomy
.cdm
.api
.service
.dto
.DerivedUnitDTO
;
22 import eu
.etaxonomy
.taxeditor
.view
.search
.facet
.CheckBoxSearchResultComposite
;
29 public class OccurrenceSearchResultComposite
extends CheckBoxSearchResultComposite
<DerivedUnitDTO
, OccurrenceSearchResult
> {
33 public OccurrenceSearchResultComposite(OccurrenceSearchResult result
, Composite parent
, int style
) {
34 super(result
, parent
, style
);
38 public Composite
createContent(Composite parent
) {
39 Composite content
= new Composite(this, SWT
.NONE
);
40 content
.setLayoutData(new GridData(SWT
.FILL
, SWT
.FILL
, false, false, 1, 1));
41 GridLayout layout
= new GridLayout(1, false);
42 content
.setLayout(layout
);
43 label
= new Label(content
, SWT
.WRAP
);
44 label
.setLayoutData(new GridData(SWT
.FILL
, SWT
.FILL
, false, false, 1, 1));
45 label
.setText(result
.getContent().getLabel());
46 label
.setFont(JFaceResources
.getFontRegistry().getBold(JFaceResources
.DEFAULT_FONT
));
47 GridDataFactory
.fillDefaults().applyTo(label
);
49 Label lblDescription
= new Label(content
, SWT
.WRAP
);
50 GridData layoutData
= new GridData();
51 lblDescription
.setLayoutData(layoutData
);
52 parent
.addControlListener(new ControlAdapter() {
54 public void controlResized(ControlEvent e
) {
55 layoutData
.widthHint
= parent
.getClientArea().width
- (6*layout
.marginWidth
);
59 String representation_L10n_text
= result
.getContent().getCitation();
60 if(representation_L10n_text
!=null){
61 lblDescription
.setText(representation_L10n_text
);