import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.Text;
import eu.etaxonomy.cdm.api.service.IOccurrenceService;
import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
import eu.etaxonomy.cdm.filter.TaxonNodeFilter;
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
import eu.etaxonomy.cdm.model.taxon.Taxon;
+import eu.etaxonomy.taxeditor.editor.l10n.Messages;
import eu.etaxonomy.taxeditor.model.ImageResources;
import eu.etaxonomy.taxeditor.store.CdmStore;
+import eu.etaxonomy.taxeditor.ui.combo.taxon.TaxonNodeCombo;
/**
* Dialog to choose specimens for the character matrix.<br>
private Collection<SpecimenOrObservationBase> selectedSpecimens = new ArrayList<>();
private CharacterMatrix matrix;
+ private Text txtTextFilter;
+
+ private TaxonNodeCombo comboTaxon;
protected SpecimenSelectionDialog(Shell parentShell, CharacterMatrix matrix) {
super(parentShell);
@Override
protected Control createDialogArea(Composite parent) {
Composite composite = (Composite) super.createDialogArea(parent);
- composite.setLayout(new GridLayout());
+ GridLayout gl_composite = new GridLayout();
+ composite.setLayout(gl_composite);
+
+ Composite composite_1 = new Composite(composite, SWT.NONE);
+ composite_1.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false, 1, 1));
+ composite_1.setLayout(new GridLayout(3, false));
+
+ txtTextFilter = new Text(composite_1, SWT.BORDER);
+ txtTextFilter.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
+
+ comboTaxon = new TaxonNodeCombo(composite_1, SWT.NONE);
+ comboTaxon.setInput(matrix.getWorkingSet().getTaxonSubtreeFilter());
- Button btnRefreshButton = new Button(composite, SWT.NONE);
- btnRefreshButton.setToolTipText("Refresh");
+ Button btnRefreshButton = new Button(composite_1, SWT.NONE);
btnRefreshButton.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
+ btnRefreshButton.setToolTipText(Messages.SpecimenSelectionDialog_REFRESH);
btnRefreshButton.setImage(ImageResources.getImage(ImageResources.REFRESH));
btnRefreshButton.addSelectionListener(new SelectionAdapter() {
@Override
TaxonNodeFilter filter = TaxonNodeFilter.NewRankInstance(matrix.getWorkingSet().getMinRank(), matrix.getWorkingSet().getMaxRank());
matrix.getWorkingSet().getGeoFilter().forEach(area -> filter.orArea(area.getUuid()));
matrix.getWorkingSet().getTaxonSubtreeFilter().forEach(node -> filter.orSubtree(node));
+ filter.setIncludeUnpublished(true);
ITaxonNodeService taxonNodeService = CdmStore.getService(ITaxonNodeService.class);
List<UUID> filteredNodes = taxonNodeService.uuidList(filter);
@Override
protected void configureShell(Shell newShell) {
super.configureShell(newShell);
- newShell.setText("Select specimens");
+ newShell.setText(Messages.SpecimenSelectionDialog_SELECT_SPECIMENS);
newShell.setMinimumSize(500, 400);
}