Revision 218b286e
Added by Andreas Kohlbecker over 4 years ago
src/main/java/eu/etaxonomy/vaadin/component/NameRelationField.java | ||
---|---|---|
51 | 51 |
|
52 | 52 |
private CssLayout toolBar= new CssLayout(); |
53 | 53 |
|
54 |
private Button removeButton = ButtonFactory.REMOVE_ITEM.createButton();
|
|
54 |
private Button removeButton = ButtonFactory.REMOVE_ALL_ITEMS.createButton();
|
|
55 | 55 |
|
56 |
private Button newButton = ButtonFactory.ADD_ITEM.createButton();
|
|
56 |
private Button newButton = ButtonFactory.CREATE_NEW.createButton();
|
|
57 | 57 |
|
58 | 58 |
private BeanFieldGroup<NameRelationshipDTO> fieldGroup = new BeanFieldGroup<>(NameRelationshipDTO.class); |
59 | 59 |
|
... | ... | |
87 | 87 |
setPrimaryStyleName(PRIMARY_STYLE); |
88 | 88 |
|
89 | 89 |
if(nameFieldCaption == null){ |
90 |
this.nameFieldCaption = "Related name";
|
|
90 |
nameFieldCaption = "Related name"; |
|
91 | 91 |
} |
92 |
this.nameFieldCaption = nameFieldCaption; |
|
92 | 93 |
|
93 | 94 |
relatedNameComboBox = new ToOneRelatedEntityCombobox<TaxonName>(this.nameFieldCaption, TaxonName.class); |
94 | 95 |
citatonComboBox = new ToOneRelatedEntityCombobox<Reference>("Reference", Reference.class); |
... | ... | |
218 | 219 |
|
219 | 220 |
private void updateToolBarButtonStates(){ |
220 | 221 |
boolean hasValue = getValue() != null; |
221 |
removeButton.setEnabled(hasValue);
|
|
222 |
newButton.setEnabled(!hasValue);
|
|
222 |
removeButton.setVisible(hasValue);
|
|
223 |
newButton.setVisible(!hasValue);
|
|
223 | 224 |
} |
224 | 225 |
|
225 | 226 |
/** |
Also available in: Unified diff
fix #8014 improving lables related to validation and replaced basionyms, fixing labeling issue in NameRelationField and harmonizing add/remove button