Revision 6c56ee87
Added by Katja Luther over 6 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/RepresentationElement.java | ||
---|---|---|
44 | 44 |
protected TextWithLabelElement element_text; |
45 | 45 |
|
46 | 46 |
protected Button button; |
47 |
//protected Button deleteButton; |
|
47 | 48 |
|
48 | 49 |
protected Representation selectedRepresentation; |
49 | 50 |
protected TermBase term; |
... | ... | |
139 | 140 |
combo_language.addSelectionListener(this); |
140 | 141 |
|
141 | 142 |
addControl(formFactory.createLabel(getLayoutComposite(), "")); |
142 |
|
|
143 |
|
|
144 |
} |
|
143 |
} |
|
145 | 144 |
|
146 | 145 |
public List<Language> getLanguages() { |
147 | 146 |
|
... | ... | |
203 | 202 |
public void setTerm( |
204 | 203 |
TermBase term, boolean update) { |
205 | 204 |
this.term = term; |
205 |
if (term.getRepresentations().isEmpty()){ |
|
206 |
//if the term has no representation at all, create a default one. |
|
207 |
Representation rep = Representation.NewInstance("", "", "", PreferencesUtil.getGlobalLanguage()); |
|
208 |
term.addRepresentation(rep); |
|
209 |
} |
|
206 | 210 |
|
207 | 211 |
if (selectedRepresentation != null) { |
208 | 212 |
combo_language.setTerms(getLanguages()); |
Also available in: Unified diff
#5908: add a default representation to a term with no representation