Project

General

Profile

« Previous | Next » 

Revision 7b130084

Added by Patrick Plitzner about 5 years ago

ref #7998 Extend selection dialog to allow multiple filter elements

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/TermVocabularySelectionDialog.java
9 9

  
10 10
package eu.etaxonomy.taxeditor.ui.dialog.selection;
11 11

  
12
import java.util.Collections;
13
import java.util.Set;
12 14
import java.util.UUID;
13 15

  
14 16
import org.eclipse.swt.widgets.Shell;
......
31 33

  
32 34
    private TermType termType;
33 35

  
34
    public static TermVocabulary select(String dialogTitle, Shell shell, TermVocabulary voc, TermType termType){
35
        return select_internal(dialogTitle, shell, voc, termType);
36
    public static TermVocabulary select(String dialogTitle, Shell shell, Set<TermVocabulary> vocabulariesToBeFiltered,
37
            TermType termType){
38
        return select_internal(dialogTitle, shell, vocabulariesToBeFiltered, termType);
36 39
    }
37 40

  
38 41
    public static TermVocabulary select(String dialogTitle, Shell shell, TermVocabulary voc){
39
        return select_internal(dialogTitle, shell, voc, null);
42
        return select_internal(dialogTitle, shell, Collections.singleton(voc), null);
40 43
    }
41 44

  
42 45
    public static TermVocabulary select(Shell shell, TermVocabulary voc){
43
        return select_internal("Choose Vocabulary", shell, voc, null);
46
        return select_internal("Choose Vocabulary", shell, Collections.singleton(voc), null);
44 47
    }
45 48

  
46
    private static TermVocabulary select_internal(String dialogTitle, Shell shell, TermVocabulary voc,
49
    private static TermVocabulary select_internal(String dialogTitle, Shell shell, Set<TermVocabulary> vocabulariesToBeFiltered,
47 50
            TermType termType){
48 51
		TermVocabularySelectionDialog dialog = new TermVocabularySelectionDialog(shell,
49 52
				dialogTitle!=null?dialogTitle:"Choose Vocabulary",
50 53
				false,
51 54
				TermVocabularySelectionDialog.class.getCanonicalName(),
52
				voc, termType);
55
				vocabulariesToBeFiltered, termType);
53 56
		return getSelectionFromDialog(dialog);
54 57
	}
55 58

  
56
	protected TermVocabularySelectionDialog(Shell shell,
57
			 String title, boolean multi,
58
			String settings, TermVocabulary cdmObject, TermType termType) {
59
		super(shell, title, multi, settings, cdmObject);
60
		this.termType = termType;
61
	}
59
    protected TermVocabularySelectionDialog(Shell shell,
60
            String title, boolean multi,
61
            String settings, Set<TermVocabulary> vocabulariesToBeFiltered, TermType termType) {
62
        super(shell, title, multi, settings, vocabulariesToBeFiltered);
63
        this.termType = termType;
64
    }
62 65

  
63 66
	@Override
64 67
	protected TermVocabulary getPersistentObject(UUID uuid) {

Also available in: Unified diff