Project

General

Profile

« Previous | Next » 

Revision 6b29c7a0

Added by Patrick Plitzner about 5 years ago

ref #7998 Add termType to vocabulary selection dialog

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/TermVocabularySelectionDialog.java
14 14
import org.eclipse.swt.widgets.Shell;
15 15

  
16 16
import eu.etaxonomy.cdm.api.service.IVocabularyService;
17
import eu.etaxonomy.cdm.model.common.TermType;
17 18
import eu.etaxonomy.cdm.model.common.TermVocabulary;
18 19
import eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard;
19 20
import eu.etaxonomy.taxeditor.newWizard.NewFeatureVocabularyWizard;
......
28 29
public class TermVocabularySelectionDialog extends
29 30
		AbstractFilteredCdmResourceSelectionDialog<TermVocabulary> {
30 31

  
32
    private TermType termType;
33

  
34
    public static TermVocabulary select(String dialogTitle, Shell shell, TermVocabulary voc, TermType termType){
35
        return select_internal(dialogTitle, shell, voc, termType);
36
    }
37

  
31 38
    public static TermVocabulary select(String dialogTitle, Shell shell, TermVocabulary voc){
32
        return select_internal(dialogTitle, shell, voc);
39
        return select_internal(dialogTitle, shell, voc, null);
33 40
    }
34 41

  
35 42
    public static TermVocabulary select(Shell shell, TermVocabulary voc){
36
        return select_internal("Choose Vocabulary", shell, voc);
43
        return select_internal("Choose Vocabulary", shell, voc, null);
37 44
    }
38 45

  
39
	private static TermVocabulary select_internal(String dialogTitle, Shell shell, TermVocabulary voc){
46
    private static TermVocabulary select_internal(String dialogTitle, Shell shell, TermVocabulary voc,
47
            TermType termType){
40 48
		TermVocabularySelectionDialog dialog = new TermVocabularySelectionDialog(shell,
41 49
				dialogTitle!=null?dialogTitle:"Choose Vocabulary",
42 50
				false,
43 51
				TermVocabularySelectionDialog.class.getCanonicalName(),
44
				voc);
52
				voc, termType);
45 53
		return getSelectionFromDialog(dialog);
46 54
	}
47 55

  
48 56
	protected TermVocabularySelectionDialog(Shell shell,
49 57
			 String title, boolean multi,
50
			String settings, TermVocabulary cdmObject) {
58
			String settings, TermVocabulary cdmObject, TermType termType) {
51 59
		super(shell, title, multi, settings, cdmObject);
60
		this.termType = termType;
52 61
	}
53 62

  
54 63
	@Override
......
58 67

  
59 68
	@Override
60 69
	protected void callService(String pattern) {
61
        model = CdmStore.getService(IVocabularyService.class).getUuidAndTitleCache(TermVocabulary.class, limitOfInitialElements, pattern);
70
        model = CdmStore.getService(IVocabularyService.class).getUuidAndTitleCache(TermVocabulary.class, termType, limitOfInitialElements, pattern);
62 71
	}
63 72

  
64 73
	@Override

Also available in: Unified diff