3 * Copyright (C) 2009 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * See LICENSE.TXT at the top of this package for the full license terms.
10 package eu
.etaxonomy
.taxeditor
.editor
.definedterm
.input
;
12 import java
.util
.Arrays
;
13 import java
.util
.HashSet
;
14 import java
.util
.List
;
17 import eu
.etaxonomy
.cdm
.api
.service
.IVocabularyService
;
18 import eu
.etaxonomy
.cdm
.model
.common
.DefinedTerm
;
19 import eu
.etaxonomy
.cdm
.model
.common
.DefinedTermBase
;
20 import eu
.etaxonomy
.cdm
.model
.common
.TermType
;
21 import eu
.etaxonomy
.cdm
.model
.common
.TermVocabulary
;
22 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
31 public class TermEditorInput
extends AbstractDefinedTermEditorInput
<DefinedTerm
> {
33 private TermType termType
;
34 private Set
<TermVocabulary
<DefinedTermBase
>> vocabularies
;
35 private List
<String
> termClasses
= Arrays
.asList(new String
[]{
36 DefinedTerm
.class.getName()
39 public TermEditorInput(TermType termType
) {
40 this.termType
= termType
;
41 vocabularies
= new HashSet
<TermVocabulary
<DefinedTermBase
>>();
42 initialiseVocabularies();
45 * @see org.eclipse.ui.IEditorInput#getName()
48 public String
getName() {
49 return termType
.getMessage();
53 * @see eu.etaxonomy.taxeditor.editor.definedterm.input.AbstractDefinedTermEditorInput#getTermClasses()
56 public List
<String
> getTermClasses() {
60 public TermType
getTermType() {
64 public void initialiseVocabularies() {
65 if(vocabularies
!= null) {
68 List
<TermVocabulary
<DefinedTermBase
>> vocs
= CdmStore
.getService(IVocabularyService
.class).findByTermType(termType
);
69 vocabularies
.addAll(vocs
);
72 public Set
<TermVocabulary
<DefinedTermBase
>> getVocabularies() {