import org.apache.commons.lang.StringUtils;
import org.eclipse.jface.layout.GridDataFactory;
-import org.eclipse.jface.layout.GridLayoutFactory;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
@Override
public void createControl(Composite parent) {
final Composite composite = new Composite(parent, SWT.NULL);
- //composite = addTab(Messages.DatabasePreferencesPage_Define_Default_NomenclaturalCode);
+
GridLayout gridLayout = new GridLayout();
+ gridLayout.numColumns=2;
+ //gridLayout.makeColumnsEqualWidth=true;
composite.setLayout(gridLayout);
-// if (isPreferencePage){
-// ListComponent list = new ListComponent(composite, composite.getStyle());
-// }
+
+
+ GridData gridData = new GridData();
+ gridData.horizontalAlignment = GridData.FILL;
+ gridData.grabExcessHorizontalSpace=true;
+ gridData.horizontalSpan = 2;
Button checkBoxMediaSpecimen = new Button(composite, SWT.CHECK);
+
checkBoxMediaSpecimen.setSelection(abcdImportConfigurator.isAddMediaAsMediaSpecimen());
checkBoxMediaSpecimen.setText("Import media as media specimen");
checkBoxMediaSpecimen
abcdImportConfigurator.setAddMediaAsMediaSpecimen(!abcdImportConfigurator.isAddMediaAsMediaSpecimen());
}
});
+ checkBoxMediaSpecimen.setLayoutData(gridData);
+ GridDataFactory.fillDefaults();
Button checkBoxIgnoreExisting = new Button(composite, SWT.CHECK);
+ gridData = new GridData();
+ gridData.horizontalAlignment = GridData.FILL;
+ gridData.grabExcessHorizontalSpace=true;
+ gridData.horizontalSpan = 2;
+
checkBoxIgnoreExisting.setSelection(abcdImportConfigurator.isIgnoreImportOfExistingSpecimen());
checkBoxIgnoreExisting.setText("Do not import existing specimens");
checkBoxIgnoreExisting
}
});
+ checkBoxIgnoreExisting.setLayoutData(gridData);
+ GridDataFactory.fillDefaults();
+
Button checkBoxIgnoreAuthorship = new Button(composite, SWT.CHECK);
+ gridData = new GridData();
+ gridData.horizontalAlignment = GridData.FILL_HORIZONTAL;
+ gridData.horizontalSpan = 2;
+ checkBoxIgnoreAuthorship.setLayoutData(gridData);
+ GridDataFactory.fillDefaults();
checkBoxIgnoreAuthorship.setSelection(abcdImportConfigurator.isIgnoreAuthorship());
checkBoxIgnoreAuthorship.setText("Ignore Authorship for name matching");
checkBoxIgnoreAuthorship
}
});
- Composite unitIdComposite = new Composite(composite, SWT.NULL);
- GridLayout gridLayoutUnitId = new GridLayout();
- gridLayoutUnitId.numColumns=2;
- unitIdComposite.setLayout(gridLayoutUnitId);
- Label unitIdLabel = new Label(unitIdComposite, SWT.NONE);
+ Label unitIdLabel = new Label(composite, SWT.NONE);
unitIdLabel.setText(Messages.AbcdImportPreference_map_unit_nr_catalog_number);
- GridDataFactory.fillDefaults().applyTo(unitIdLabel);
- checkBoxMapUnitId = new Combo(unitIdComposite, SWT.BORDER| SWT.READ_ONLY);
- GridDataFactory.fillDefaults().applyTo(checkBoxMapUnitId);
+
+ GridData gridDataUnitId = new GridData();
+ gridDataUnitId.horizontalAlignment=SWT.BEGINNING;
+ unitIdLabel.setLayoutData(gridDataUnitId);
+ GridDataFactory.fillDefaults();
+
+ checkBoxMapUnitId = new Combo(composite, SWT.BORDER| SWT.READ_ONLY);
+ gridDataUnitId = new GridData();
+ gridDataUnitId.horizontalAlignment=SWT.BEGINNING;
+ checkBoxMapUnitId.setLayoutData(gridDataUnitId);
+ GridDataFactory.fillDefaults();
+
checkBoxMapUnitId.add(ACCESSION_NUMBER);
checkBoxMapUnitId.add(BARCODE);
checkBoxMapUnitId.add(CATALOGUE_NUMBER);
checkBoxMapUnitId.select(2);
}
- GridLayoutFactory.fillDefaults();
- Button checkBoxRemoveCountry = new Button(composite, SWT.CHECK);
+
+ Button checkBoxRemoveCountry = new Button(composite, SWT.CHECK);
+ gridData = new GridData();
+ gridData.horizontalAlignment = GridData.FILL_HORIZONTAL;
+ gridData.horizontalSpan = 2;
+ checkBoxRemoveCountry.setLayoutData(gridData);
+ GridDataFactory.fillDefaults();
checkBoxRemoveCountry.setSelection(abcdImportConfigurator.isRemoveCountryFromLocalityText());
checkBoxRemoveCountry.setText("Remove country from locality text");
checkBoxRemoveCountry
});
Button checkBoxMoveToDefaultClassification = new Button(composite, SWT.CHECK);
+ gridData = new GridData();
+ gridData.horizontalAlignment = GridData.FILL_HORIZONTAL;
+ gridData.horizontalSpan = 2;
+ checkBoxMoveToDefaultClassification.setLayoutData(gridData);
+ GridDataFactory.fillDefaults();
checkBoxMoveToDefaultClassification.setSelection(abcdImportConfigurator.isMoveNewTaxaToDefaultClassification());
checkBoxMoveToDefaultClassification.setText("Create new classification for new taxa");
checkBoxMoveToDefaultClassification
});
Button checkBoxImportSiblings = new Button(composite, SWT.CHECK);
+ gridData = new GridData();
+ gridData.horizontalAlignment = GridData.FILL_HORIZONTAL;
+ gridData.horizontalSpan = 2;
+ checkBoxImportSiblings.setLayoutData(gridData);
+ GridDataFactory.fillDefaults();
checkBoxImportSiblings.setSelection(abcdImportConfigurator.isGetSiblings());
checkBoxImportSiblings.setText("Import all children of cultures or tissue samples");
checkBoxImportSiblings
});
Button checkBoxAddIndividualsAssociations = new Button(composite, SWT.CHECK);
+ gridData = new GridData();
+ gridData.horizontalAlignment = GridData.FILL_HORIZONTAL;
+ gridData.horizontalSpan = 2;
+ checkBoxAddIndividualsAssociations.setLayoutData(gridData);
+ GridDataFactory.fillDefaults();
checkBoxAddIndividualsAssociations.setSelection(abcdImportConfigurator.isAddIndividualsAssociationsSuchAsSpecimenAndObservations());
checkBoxAddIndividualsAssociations.setText("Create an Individual Association for each Specimen");
checkBoxAddIndividualsAssociations
});
Button checkBoxReuseDescriptiveGroups = new Button(composite, SWT.CHECK);
+ gridData = new GridData();
+ gridData.horizontalAlignment = GridData.FILL_HORIZONTAL;
+ gridData.horizontalSpan = 2;
+ checkBoxReuseDescriptiveGroups.setLayoutData(gridData);
+ GridDataFactory.fillDefaults();
checkBoxReuseDescriptiveGroups.setSelection(abcdImportConfigurator.isReuseExistingDescriptiveGroups());
checkBoxReuseDescriptiveGroups.setText("Reuse existing descriptive group");
checkBoxReuseDescriptiveGroups
});
Button checkBoxReuseExistingTaxa = new Button(composite, SWT.CHECK);
+ gridData = new GridData();
+ gridData.horizontalAlignment = GridData.FILL_HORIZONTAL;
+ gridData.horizontalSpan = 2;
+ checkBoxReuseExistingTaxa.setLayoutData(gridData);
+ GridDataFactory.fillDefaults();
checkBoxReuseExistingTaxa.setSelection(abcdImportConfigurator.isReuseExistingTaxaWhenPossible());
checkBoxReuseExistingTaxa.setText("Reuse existing taxa when possible");
checkBoxReuseExistingTaxa
if (!isFileImport){
- Composite dnaComposite = new Composite(composite, SWT.NULL);
- GridLayout gridLayoutDna = new GridLayout();
- gridLayoutDna.numColumns=2;
- dnaComposite.setLayout(gridLayoutDna);
- Label labelRef = new Label(dnaComposite, SWT.NONE);
+
+ Label labelRef = new Label(composite, SWT.NONE);
+ gridDataUnitId = new GridData();
+ gridDataUnitId.horizontalAlignment=SWT.BEGINNING;
+ labelRef.setLayoutData(gridDataUnitId);
labelRef.setText("Biocase provider for associated DNA");
- new Label(dnaComposite, SWT.NONE);
- textDNAProviderString = new Combo(dnaComposite, SWT.BORDER);
+ GridDataFactory.fillDefaults().applyTo(labelRef);
+
+ textDNAProviderString = new Combo(composite, SWT.BORDER);
+ textDNAProviderString.setLayoutData(gridDataUnitId);
GridDataFactory.fillDefaults().applyTo(textDNAProviderString);
textDNAProviderString.add("Do not search for DNA");
}else{
abcdImportConfigurator.setDnaSoure(null);
}
-// GridData gridData = new GridData();
-// gridData = new GridData(GridData.BEGINNING, GridData.CENTER, true, false);
-// gridData.horizontalIndent = 5;
-// classificationSelection.setLayoutData(gridData);
- Composite codeComposite = new Composite(composite, SWT.NULL);
-
- codeComposite.setLayout(gridLayoutUnitId);
- Label labelCode = new Label(codeComposite, SWT.NONE);
+
+
+ Label labelCode = new Label(composite, SWT.NONE);
labelCode.setText("Nomenclatural Code");
+ gridData = new GridData();
+ gridData.horizontalAlignment=SWT.BEGINNING;
+
+ labelCode.setLayoutData(gridData);
GridDataFactory.fillDefaults().applyTo(labelCode);
- nomenclaturalCodeSelectionCombo = new Combo(codeComposite, SWT.BORDER| SWT.READ_ONLY);
- GridDataFactory.fillDefaults().applyTo(nomenclaturalCodeSelectionCombo);
+ nomenclaturalCodeSelectionCombo = new Combo(composite, SWT.BORDER| SWT.READ_ONLY);
+ gridData = new GridData();
+ gridData.horizontalAlignment=SWT.BEGINNING;
+ nomenclaturalCodeSelectionCombo.setLayoutData(gridData);
+ GridDataFactory.fillDefaults();
for(NomenclaturalCode code: NomenclaturalCode.values()){
nomenclaturalCodeSelectionCombo.add(code.getKey());
}
-
-
- // TODO remember last selection
nomenclaturalCodeSelectionCombo.addSelectionListener(this);
int index = 0;
if (abcdImportConfigurator.getNomenclaturalCode() != null){