import eu.etaxonomy.cdm.api.service.IFeatureTreeService;
import eu.etaxonomy.cdm.api.service.ITermService;
import eu.etaxonomy.cdm.model.common.Representation;
+import eu.etaxonomy.cdm.model.common.TermType;
import eu.etaxonomy.cdm.model.common.TermVocabulary;
import eu.etaxonomy.cdm.model.description.Character;
import eu.etaxonomy.cdm.model.description.FeatureNode;
@Override
public void widgetSelected(SelectionEvent e) {
- vocabulary = TermVocabularySelectionDialog.select("Select vocabulary for characters", btnChooseVoc.getShell(), null);
+ vocabulary = TermVocabularySelectionDialog.select("Select vocabulary for characters", btnChooseVoc.getShell(), vocabulary, TermType.Feature);
if(vocabulary!=null){
txtVocabulary.setText(vocabulary.getLabel());
}
import org.eclipse.swt.widgets.Shell;
import eu.etaxonomy.cdm.api.service.IVocabularyService;
+import eu.etaxonomy.cdm.model.common.TermType;
import eu.etaxonomy.cdm.model.common.TermVocabulary;
import eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard;
import eu.etaxonomy.taxeditor.newWizard.NewFeatureVocabularyWizard;
public class TermVocabularySelectionDialog extends
AbstractFilteredCdmResourceSelectionDialog<TermVocabulary> {
+ private TermType termType;
+
+ public static TermVocabulary select(String dialogTitle, Shell shell, TermVocabulary voc, TermType termType){
+ return select_internal(dialogTitle, shell, voc, termType);
+ }
+
public static TermVocabulary select(String dialogTitle, Shell shell, TermVocabulary voc){
- return select_internal(dialogTitle, shell, voc);
+ return select_internal(dialogTitle, shell, voc, null);
}
public static TermVocabulary select(Shell shell, TermVocabulary voc){
- return select_internal("Choose Vocabulary", shell, voc);
+ return select_internal("Choose Vocabulary", shell, voc, null);
}
- private static TermVocabulary select_internal(String dialogTitle, Shell shell, TermVocabulary voc){
+ private static TermVocabulary select_internal(String dialogTitle, Shell shell, TermVocabulary voc,
+ TermType termType){
TermVocabularySelectionDialog dialog = new TermVocabularySelectionDialog(shell,
dialogTitle!=null?dialogTitle:"Choose Vocabulary",
false,
TermVocabularySelectionDialog.class.getCanonicalName(),
- voc);
+ voc, termType);
return getSelectionFromDialog(dialog);
}
protected TermVocabularySelectionDialog(Shell shell,
String title, boolean multi,
- String settings, TermVocabulary cdmObject) {
+ String settings, TermVocabulary cdmObject, TermType termType) {
super(shell, title, multi, settings, cdmObject);
+ this.termType = termType;
}
@Override
@Override
protected void callService(String pattern) {
- model = CdmStore.getService(IVocabularyService.class).getUuidAndTitleCache(TermVocabulary.class, limitOfInitialElements, pattern);
+ model = CdmStore.getService(IVocabularyService.class).getUuidAndTitleCache(TermVocabulary.class, termType, limitOfInitialElements, pattern);
}
@Override