import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.forms.widgets.FormToolkit;
-import org.eclipse.ui.forms.widgets.TableWrapData;
-import org.eclipse.ui.forms.widgets.TableWrapLayout;
import org.eclipse.wb.swt.ResourceManager;
/**
*/
public DerivateSearchComposite(Composite parent, int style) {
super(parent, style);
- {
- TableWrapLayout tableWrapLayout = new TableWrapLayout();
- tableWrapLayout.numColumns = 4;
- setLayout(tableWrapLayout);
- }
+ setLayout(new GridLayout(4, false));
lblTaxon = new Label(this, SWT.NONE);
- lblTaxon.setLayoutData(new TableWrapData(TableWrapData.LEFT, TableWrapData.MIDDLE, 1, 1));
lblTaxon.setText("Taxon");
textTaxonName = formToolkit.createText(this, "New Text", SWT.NONE);
- textTaxonName.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.MIDDLE, 1, 1));
+ textTaxonName.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
textTaxonName.setEnabled(false);
textTaxonName.setText("");
btnBrowseTaxa = formToolkit.createButton(this, "", SWT.NONE);
- btnBrowseTaxa.setLayoutData(new TableWrapData(TableWrapData.LEFT, TableWrapData.MIDDLE, 1, 1));
btnBrowseTaxa.setImage(ResourceManager.getPluginImage("eu.etaxonomy.taxeditor.store", "icons/open.gif"));
btnClearTaxon = formToolkit.createButton(this, "", SWT.NONE);
+ btnClearTaxon.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false, false, 1, 1));
btnClearTaxon.setImage(ResourceManager.getPluginImage("eu.etaxonomy.taxeditor.store", "icons/trash.gif"));
lblDerivateType = new Label(this, SWT.NULL);
- lblDerivateType.setLayoutData(new TableWrapData(TableWrapData.LEFT, TableWrapData.MIDDLE, 1, 1));
lblDerivateType.setText("Derivate Type");
comboDerivateType = new Combo(this, SWT.READ_ONLY);
- comboDerivateType.setLayoutData(new TableWrapData(TableWrapData.FILL, TableWrapData.MIDDLE, 1, 1));
+ comboDerivateType.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
formToolkit.paintBordersFor(comboDerivateType);
btnFilterUndeterminedSpecimen = new Button(this, SWT.CHECK);
- btnFilterUndeterminedSpecimen.setLayoutData(new TableWrapData(TableWrapData.LEFT, TableWrapData.MIDDLE, 1, 2));
+ btnFilterUndeterminedSpecimen.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1));
btnFilterUndeterminedSpecimen.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
btnFilterUndeterminedSpecimen.setText("Determined");
buttonSearch = new Button(this, SWT.NONE);
- buttonSearch.setLayoutData(new TableWrapData(TableWrapData.LEFT, TableWrapData.MIDDLE, 1, 1));
formToolkit.adapt(buttonSearch, true, true);
buttonSearch.setText("Search");
searchField = formToolkit.createText(this, "New Text", SWT.NONE);
- searchField.setLayoutData(new TableWrapData(TableWrapData.FILL, TableWrapData.MIDDLE, 1, 3));
+ searchField.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 3, 1));
searchField.setText("");
resultViewer = new TableViewer(this, SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI);
table = resultViewer.getTable();
- table.setLayoutData(new TableWrapData(TableWrapData.FILL, TableWrapData.FILL, 1, 4));
+ table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 4, 1));
}