Revision b0d7867b
Added by Patrick Plitzner almost 9 years ago
- removed empty element from combo dropdown #4448
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/StateVocabularyCollectionElement.java | ||
---|---|---|
49 | 49 |
|
50 | 50 |
@Override |
51 | 51 |
public void createControls(ICdmFormElement element, int style) { |
52 |
comboStateVocabulary = formFactory.createVocabularyComboElement(TermType.State, "State vocabularies", null, element, style);
|
|
52 |
comboStateVocabulary = formFactory.createVocabularyComboElement(TermType.State, "State vocabulary", null, element, style);
|
|
53 | 53 |
} |
54 | 54 |
|
55 | 55 |
@Override |
... | ... | |
57 | 57 |
this.entity = entity; |
58 | 58 |
if(entity.getId()!=0){ |
59 | 59 |
comboStateVocabulary.setSelection(entity); |
60 |
comboStateVocabulary.removeEmptyElement(); |
|
60 | 61 |
} |
61 | 62 |
} |
62 | 63 |
|
... | ... | |
64 | 65 |
public void handleEvent(Object eventSource) { |
65 | 66 |
if(eventSource==comboStateVocabulary && comboStateVocabulary.getSelection()!=null){ |
66 | 67 |
if(getParentElement() instanceof StateVocabularyCollectionSection){ |
67 |
Feature feature = ((StateVocabularyCollectionSection) getParentElement()).getEntity(); |
|
68 |
StateVocabularyCollectionSection parentElement = (StateVocabularyCollectionSection) getParentElement(); |
|
69 |
Feature feature = parentElement.getEntity(); |
|
68 | 70 |
feature.removeSupportedCategoricalEnumeration(entity); |
69 | 71 |
TermVocabulary<State> vocabulary = comboStateVocabulary.getSelection(); |
70 | 72 |
feature.addSupportedCategoricalEnumeration(vocabulary); |
71 | 73 |
entity = vocabulary; |
74 |
//update the parent section to re-set the listeners to the persisted measurement unit |
|
75 |
parentElement.removeElementAndUpdate(null); |
|
72 | 76 |
} |
73 | 77 |
} |
74 | 78 |
} |
Also available in: Unified diff