Project

General

Profile

Revision 6b29c7a0

ID6b29c7a00852c7b43dc81a8c84f71709bfb9f2c4
Parent ba924c16
Child 85bd68d3

Added by Patrick Plitzner over 1 year ago

ref #7998 Add termType to vocabulary selection dialog

View differences:

eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/character/CharacterEditor.java
58 58
import eu.etaxonomy.cdm.api.service.IFeatureTreeService;
59 59
import eu.etaxonomy.cdm.api.service.ITermService;
60 60
import eu.etaxonomy.cdm.model.common.Representation;
61
import eu.etaxonomy.cdm.model.common.TermType;
61 62
import eu.etaxonomy.cdm.model.common.TermVocabulary;
62 63
import eu.etaxonomy.cdm.model.description.Character;
63 64
import eu.etaxonomy.cdm.model.description.FeatureNode;
......
147 148

  
148 149
            @Override
149 150
            public void widgetSelected(SelectionEvent e) {
150
                vocabulary = TermVocabularySelectionDialog.select("Select vocabulary for characters", btnChooseVoc.getShell(), null);
151
                vocabulary = TermVocabularySelectionDialog.select("Select vocabulary for characters", btnChooseVoc.getShell(), vocabulary, TermType.Feature);
151 152
                if(vocabulary!=null){
152 153
                    txtVocabulary.setText(vocabulary.getLabel());
153 154
                }
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

Add picture from clipboard (Maximum size: 40 MB)