3 * Copyright (C) 2013 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
.view
.derivateSearch
;
12 import org
.eclipse
.jface
.viewers
.TableViewer
;
13 import org
.eclipse
.swt
.SWT
;
14 import org
.eclipse
.swt
.layout
.GridData
;
15 import org
.eclipse
.swt
.layout
.GridLayout
;
16 import org
.eclipse
.swt
.widgets
.Combo
;
17 import org
.eclipse
.swt
.widgets
.Composite
;
18 import org
.eclipse
.swt
.widgets
.Display
;
19 import org
.eclipse
.swt
.widgets
.Label
;
20 import org
.eclipse
.swt
.widgets
.Table
;
21 import org
.eclipse
.swt
.widgets
.Text
;
22 import org
.eclipse
.ui
.forms
.widgets
.FormToolkit
;
25 * The widgets of the {@link DerivateSearchView}<br>
28 public class DerivateSearchComposite
extends Composite
{
29 private final FormToolkit formToolkit
= new FormToolkit(Display
.getDefault());
30 private final Text searchField
;
31 private final Table table
;
32 private final TableViewer resultViewer
;
33 private final Combo comboDerivateType
;
36 * Create the composite.
40 public DerivateSearchComposite(Composite parent
, int style
) {
42 setLayout(new GridLayout(2, false));
44 Label lblDerivateType
= new Label(this, SWT
.NULL
);
45 lblDerivateType
.setLayoutData(new GridData(SWT
.RIGHT
, SWT
.CENTER
, false, false, 1, 1));
46 lblDerivateType
.setText("Derivate Filter");
48 comboDerivateType
= new Combo(this, SWT
.NONE
);
49 comboDerivateType
.setLayoutData(new GridData(SWT
.FILL
, SWT
.CENTER
, true, false, 1, 1));
50 formToolkit
.paintBordersFor(comboDerivateType
);
52 Label lblNameFilter
= new Label(this, SWT
.NULL
);
53 lblNameFilter
.setLayoutData(new GridData(SWT
.RIGHT
, SWT
.CENTER
, false, false, 1, 1));
54 lblNameFilter
.setText("Name Filter");
56 searchField
= formToolkit
.createText(this, "New Text", SWT
.NONE
);
57 searchField
.setText("");
58 searchField
.setLayoutData(new GridData(SWT
.FILL
, SWT
.CENTER
, true, false, 1, 1));
60 resultViewer
= new TableViewer(this, SWT
.BORDER
| SWT
.FULL_SELECTION
);
61 table
= resultViewer
.getTable();
62 table
.setLayoutData(new GridData(SWT
.FILL
, SWT
.FILL
, true, true, 2, 1));
67 protected void checkSubclass() {
68 // Disable the check that prevents subclassing of SWT components
70 public Text
getSearchField() {
73 public TableViewer
getResultViewer() {
76 public Combo
getComboDerivateType() {
77 return comboDerivateType
;