Revision 5f54eb62
Added by Katja Luther almost 4 years ago
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/matrix/SpecimenSelectionDialog.java | ||
---|---|---|
10 | 10 |
|
11 | 11 |
import java.util.ArrayList; |
12 | 12 |
import java.util.Collection; |
13 |
import java.util.HashSet; |
|
13 | 14 |
import java.util.Iterator; |
14 | 15 |
import java.util.List; |
16 |
import java.util.Set; |
|
15 | 17 |
import java.util.stream.Collectors; |
16 | 18 |
|
17 | 19 |
import org.apache.commons.lang.StringUtils; |
... | ... | |
92 | 94 |
while(iterator.hasNext() ){ |
93 | 95 |
titleString += ", "+ iterator.next(); |
94 | 96 |
} |
95 |
l_title.setText("Taxon Filter: " + titleString); |
|
97 |
l_title.setText("Taxon Filter: "); |
|
98 |
Label l_title_filter = new Label(composite, SWT.NULL); |
|
99 |
l_title_filter.setText(titleString); |
|
96 | 100 |
} |
97 | 101 |
Composite composite_1 = new Composite(composite, SWT.NONE); |
98 | 102 |
composite_1.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false, 2, 1)); |
... | ... | |
154 | 158 |
} |
155 | 159 |
}); |
156 | 160 |
|
157 |
Label lblNewLabel = new Label(composite, SWT.NONE); |
|
161 |
Composite composite_2 = new Composite(composite, SWT.NONE); |
|
162 |
composite_2.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false, 2, 1)); |
|
163 |
composite_2.setLayout(new GridLayout(2, false)); |
|
164 |
Label lblNewLabel = new Label(composite_2, SWT.NONE); |
|
158 | 165 |
lblNewLabel.setImage(ImageResources.getImage(ImageResources.WARNING_ICON)); |
159 | 166 |
|
160 |
Label lblNewLabel_1 = new Label(composite, SWT.NONE); |
|
167 |
Label lblNewLabel_1 = new Label(composite_2, SWT.NONE);
|
|
161 | 168 |
lblNewLabel_1.setText(": Specimen not associated with taxon"); |
162 | 169 |
|
163 | 170 |
ScrolledComposite scrolledComposite = new ScrolledComposite(composite, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL); |
... | ... | |
237 | 244 |
} |
238 | 245 |
|
239 | 246 |
private void applyFilter(){ |
240 |
List<SpecimenNodeWrapper> result = new ArrayList<>();
|
|
247 |
Set<SpecimenNodeWrapper> result = new HashSet<>();
|
|
241 | 248 |
Collection<SpecimenNodeWrapper> specimenCache = matrix.getSpecimenCache(); |
242 | 249 |
String text = txtTextFilter.getText(); |
243 | 250 |
|
244 | 251 |
//filter for treeIndexList is missing |
245 |
if(CdmUtils.isBlank(text)){ |
|
246 |
result = new ArrayList<>(specimenCache);
|
|
252 |
if(CdmUtils.isBlank(text) || text.equals(TEXT_FILTER_DEFAULT)){
|
|
253 |
result = new HashSet<>(specimenCache);
|
|
247 | 254 |
} |
248 | 255 |
else{ |
249 | 256 |
if(!txtTextFilter.getForeground().equals(AbstractUtility.getColor(Resources.SEARCH_VIEW_FOREGROUND)) |
Also available in: Unified diff
ref #8785: fix specimen selection for no filter and layout issue