Revision 41f187f1
Added by Patrick Plitzner over 7 years ago
src/main/java/eu/etaxonomy/cdm/vaadin/view/dbstatus/DistributionSettingsConfigWindow.java | ||
---|---|---|
24 | 24 |
import com.vaadin.ui.ComboBox; |
25 | 25 |
import com.vaadin.ui.HorizontalLayout; |
26 | 26 |
import com.vaadin.ui.ListSelect; |
27 |
import com.vaadin.ui.Notification; |
|
28 | 27 |
import com.vaadin.ui.Table.ColumnHeaderMode; |
29 | 28 |
import com.vaadin.ui.TreeTable; |
30 | 29 |
import com.vaadin.ui.VerticalLayout; |
... | ... | |
104 | 103 |
|
105 | 104 |
okButton.addClickListener(this); |
106 | 105 |
cancelButton.addClickListener(this); |
106 |
updateButtons(); |
|
107 | 107 |
} |
108 | 108 |
|
109 | 109 |
protected AbstractLayout buildMainLayout() { |
... | ... | |
209 | 209 |
NamedAreaContainer container = new NamedAreaContainer(vocabulary); |
210 | 210 |
namedAreaList.setContainerDataSource(container); |
211 | 211 |
} |
212 |
updateButtons(); |
|
213 |
} |
|
214 |
|
|
215 |
@Override |
|
216 |
protected boolean isValid() { |
|
217 |
return classificationBox.getValue()!=null && distAreaBox.getValue()!=null; |
|
212 | 218 |
} |
213 | 219 |
|
214 | 220 |
@Override |
... | ... | |
226 | 232 |
} |
227 | 233 |
term = (TermVocabulary<NamedArea>) distAreaBox.getValue(); |
228 | 234 |
Set<NamedArea> selectedAreas = (Set<NamedArea>) namedAreaList.getValue(); |
229 |
if(taxonNode==null){ |
|
230 |
Notification.show("Please choose a classification and/or taxon", Notification.Type.HUMANIZED_MESSAGE); |
|
231 |
return; |
|
232 |
} |
|
233 |
if(term==null){ |
|
234 |
Notification.show("Please choose a distribution area", Notification.Type.HUMANIZED_MESSAGE); |
|
235 |
return; |
|
236 |
} |
|
237 | 235 |
DistributionEditorUtil.openDistributionView(taxonNode, term, selectedAreas); |
238 | 236 |
window.close(); |
239 | 237 |
} |
Also available in: Unified diff
ref #5458 Validation for settings dialogs