package eu.etaxonomy.taxeditor.ui.dialog.selection;
+import java.util.Collections;
+import java.util.Set;
import java.util.UUID;
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.cdm.model.term.TermType;
+import eu.etaxonomy.cdm.model.term.TermVocabulary;
import eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard;
import eu.etaxonomy.taxeditor.newWizard.NewFeatureVocabularyWizard;
import eu.etaxonomy.taxeditor.store.CdmStore;
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, Set<TermVocabulary> vocabulariesToBeFiltered,
+ TermType termType){
+ return select_internal(dialogTitle, shell, vocabulariesToBeFiltered, termType);
}
public static TermVocabulary select(String dialogTitle, Shell shell, TermVocabulary voc){
- return select_internal(dialogTitle, shell, voc, null);
+ return select_internal(dialogTitle, shell, voc!=null?Collections.singleton(voc):null, null);
}
public static TermVocabulary select(Shell shell, TermVocabulary voc){
- return select_internal("Choose Vocabulary", shell, voc, null);
+ return select_internal("Choose Vocabulary", shell, voc!=null?Collections.singleton(voc):null, null);
}
- private static TermVocabulary select_internal(String dialogTitle, Shell shell, TermVocabulary voc,
+ private static TermVocabulary select_internal(String dialogTitle, Shell shell, Set<TermVocabulary> vocabulariesToBeFiltered,
TermType termType){
TermVocabularySelectionDialog dialog = new TermVocabularySelectionDialog(shell,
dialogTitle!=null?dialogTitle:"Choose Vocabulary",
false,
TermVocabularySelectionDialog.class.getCanonicalName(),
- voc, termType);
+ vocabulariesToBeFiltered, termType);
return getSelectionFromDialog(dialog);
}
- protected TermVocabularySelectionDialog(Shell shell,
- String title, boolean multi,
- String settings, TermVocabulary cdmObject, TermType termType) {
- super(shell, title, multi, settings, cdmObject);
- this.termType = termType;
- }
+ protected TermVocabularySelectionDialog(Shell shell,
+ String title, boolean multi,
+ String settings, Set<TermVocabulary> vocabulariesToBeFiltered, TermType termType) {
+ super(shell, title, multi, settings, vocabulariesToBeFiltered);
+ this.termType = termType;
+ }
@Override
protected TermVocabulary getPersistentObject(UUID uuid) {
@Override
protected AbstractNewEntityWizard getNewEntityWizard(String parameter) {
- return new NewFeatureVocabularyWizard();
+ return new NewFeatureVocabularyWizard(termType);
}
}