*/
package eu.etaxonomy.taxeditor.view.specimenSearch;
+import java.util.List;
+
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.DateTime;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.forms.widgets.TableWrapData;
import org.eclipse.ui.forms.widgets.TableWrapLayout;
+import eu.etaxonomy.cdm.model.location.Country;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+
/**
* @author pplitzner
* @date 03.09.2013
private final Text textAccessionNumber;
private final Text textLocality;
private final Text textHerbarium;
- private final Text textCountry;
+ private final Combo textCountry;
private final DateTime dateFrom;
private final DateTime dateTo;
private final Button btnShowDate;
tableWrapLayout.numColumns = 2;
setLayout(tableWrapLayout);
}
-
+ CdmFormFactory formFactory = new CdmFormFactory(parent.getDisplay());
Label lblTaxonName = new Label(this, SWT.NONE);
lblTaxonName.setText("Taxon Name");
Label lblCountry = new Label(this, SWT.NONE);
lblCountry.setText("Country");
- textCountry = new Text(this, SWT.NONE);
+ textCountry = new Combo(this, SWT.NONE);
textCountry.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
+ List<Country> items = CdmStore.getTermManager().getPreferredTerms(Country.class);
+ String[] itemsArray = new String[items.size()];
+ int i = 0;
+ for (Country country: items){
+ itemsArray[i]= country.getIso3166_A2() + " - " + country.getLabel();
+ i++;
+ }
+
+ textCountry.setItems(itemsArray);
public Text getTextHerbarium() {
return textHerbarium;
}
- public Text getTextCountry() {
+ public Combo getTextCountry() {
return textCountry;
}
public Text getTextLocality() {