我有像这样实现的本地选择的语言环境:
NativeSelect selectLang = new NativeSelect();
for (Locale locale : localeProvider.getSupportedLocales()) {
selectLang.setItemCaption(locale, localeProvider.getLabel(locale));
selectLang.addItem(locale);
}
selectLang.setValue(user.getLocale());
selectLang.setNullSelectionAllowed(false);
selectLang.addItemSetChangeListener(new ItemSetChangeListener() {
private static final long serialVersionUID = 4797561043434404341L;
@Override
public void containerItemSetChange(ItemSetChangeEvent event) {
// Locale loc = (Locale)event.getContainer().getValue();
// UI.getCurrent().setLocale(loc);
}
});
我想使用 event.getContainer().getValue(),但是方法 getValue() 没有为 Container 类型定义。我怎样才能获得事件的价值?