private List<T> customPreferredTerms;
+ private boolean addEmptyElement;
+
public TermComboElement(CdmFormFactory formFactory,
- ICdmFormElement parentElement, TermType termType, String labelString, T selection,
+ ICdmFormElement parentElement, TermType termType, String labelString, T selection, boolean addEmptyElement,
int style) {
- this(formFactory, parentElement, null, termType, null, labelString, selection, style);
+ this(formFactory, parentElement, null, termType, null, labelString, selection, addEmptyElement, style);
}
public TermComboElement(CdmFormFactory formFactory,
- ICdmFormElement parentElement, TermVocabulary<?> termVocabulary, String labelString, T selection,
+ ICdmFormElement parentElement, TermVocabulary<?> termVocabulary, String labelString, T selection, boolean addEmptyElement,
int style) {
- this(formFactory, parentElement, null, null, termVocabulary, labelString, selection, style);
+ this(formFactory, parentElement, null, null, termVocabulary, labelString, selection, addEmptyElement, style);
}
public TermComboElement(CdmFormFactory formFactory,
- ICdmFormElement parentElement, Class<T> termClass, String labelString, T selection,
+ ICdmFormElement parentElement, Class<T> termClass, String labelString, T selection, boolean addEmptyElement,
int style) {
- this(formFactory, parentElement, termClass, null, null, labelString, selection, style);
+ this(formFactory, parentElement, termClass, null, null, labelString, selection, addEmptyElement, style);
}
private TermComboElement(CdmFormFactory formFactory,
- ICdmFormElement parentElement, Class<T> termClass, TermType termType, TermVocabulary<?> termVocabulary, String labelString, T selection,
+ ICdmFormElement parentElement, Class<T> termClass, TermType termType, TermVocabulary<?> termVocabulary, String labelString, T selection, boolean addEmptyElement,
int style) {
super(formFactory, parentElement);
else{
this.termClass = (Class<T>) DefinedTerm.class;
}
+ this.addEmptyElement = addEmptyElement;
if (labelString != null) {
label = formFactory.createLabel(getLayoutComposite(), labelString);
int i = 1;
int index = 0;
- // Add an empty element for when nothing was selected yet
- combo.add(EMPTY_ELEMENT_LABEL);
- terms.add(emptyElement);
+ if(addEmptyElement){
+ // Add an empty element for when nothing was selected yet
+ combo.add(EMPTY_ELEMENT_LABEL);
+ terms.add(emptyElement);
+ }
if (termComparator != null) {
Collections.sort(preferredTerms, termComparator);