Revision 62306db3
Added by Katja Luther over 5 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/FilterDialog.java | ||
---|---|---|
24 | 24 |
import org.eclipse.swt.widgets.Control; |
25 | 25 |
import org.eclipse.swt.widgets.Shell; |
26 | 26 |
|
27 |
import eu.etaxonomy.cdm.api.service.IVocabularyService; |
|
28 |
import eu.etaxonomy.cdm.model.common.TermType; |
|
29 | 27 |
import eu.etaxonomy.cdm.model.common.TermVocabulary; |
30 | 28 |
import eu.etaxonomy.taxeditor.preference.PreferencesUtil; |
31 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
|
32 | 29 |
|
33 | 30 |
/** |
34 | 31 |
* @author k.luther |
... | ... | |
48 | 45 |
/** |
49 | 46 |
* @param parentShell |
50 | 47 |
*/ |
51 |
protected FilterDialog(Shell parentShell, Object preferenceId, List<TermVocabulary> selectedVocabularies) { |
|
48 |
protected FilterDialog(Shell parentShell, Object preferenceId, List<TermVocabulary> selectedVocabularies, List<TermVocabulary> vocabularies) {
|
|
52 | 49 |
super(parentShell); |
53 |
vocabularies = CdmStore.getService(IVocabularyService.class).listByTermType(TermType.NamedArea, true, null, null, null, null);
|
|
50 |
this.vocabularies = vocabularies;
|
|
54 | 51 |
this.preferenceId = preferenceId; |
55 | 52 |
this.selectedVocabularies = selectedVocabularies; |
56 | 53 |
this.tempSelectedVocabularies = new ArrayList(); |
57 | 54 |
this.tempSelectedVocabularies.addAll(selectedVocabularies); |
58 |
|
|
59 |
|
|
55 |
|
|
56 |
|
|
60 | 57 |
} |
61 | 58 |
|
62 | 59 |
@Override |
... | ... | |
114 | 111 |
|
115 | 112 |
@Override |
116 | 113 |
protected void okPressed(){ |
117 |
|
|
114 |
|
|
118 | 115 |
for (TermVocabulary voc: vocabularies){ |
119 | 116 |
if (tempSelectedVocabularies.contains(voc)){ |
120 | 117 |
PreferencesUtil.getPreferenceStore().setValue(getPrefKey(voc), false); |
... | ... | |
126 | 123 |
} |
127 | 124 |
super.okPressed(); |
128 | 125 |
} |
129 |
|
|
126 |
|
|
130 | 127 |
private String getPrefKey(TermVocabulary vocabulary){ |
131 | 128 |
return "hide_"+NamedAreaSelectionDialog.class.getCanonicalName()+vocabulary.getUuid()+preferenceId; |
132 | 129 |
} |
Also available in: Unified diff
ref #7793: fix named area and commonNameArea selection filter