use of de.alpharogroup.bundle.app.combobox.model.LocalesComboBoxModel in project bundle-app-ui by astrapi69.
the class NewBundleApplicationPanel method newCmbDefaultLocale.
protected javax.swing.JComboBox<Locale> newCmbDefaultLocale(final Model<ApplicationDashboardBean> model) {
ApplicationDashboardBean bean = model.getObject();
BundleApplications bundleApplication = bean.getBundleApplication();
LocalesComboBoxModel cmbModel = LocalesComboBoxModel.get();
Locale dl = Locale.getDefault();
if (bundleApplication != null) {
LanguageLocales defaultLocale = bundleApplication.getDefaultLocale();
if (defaultLocale != null) {
dl = SpringApplicationContext.getInstance().getLanguageLocalesService().resolveLocale(defaultLocale);
}
}
cmbModel.setSelectedItem(dl);
final javax.swing.JComboBox<Locale> cmbDefaultLocale = new javax.swing.JComboBox<>(cmbModel);
cmbDefaultLocale.addItemListener(e -> onChangeDefaultLocale(e));
final Model<Locale> defaultLocaleModel = model(from(getModel()).getDefaultLocale());
cmbDefaultLocale.setRenderer(new LocalesComboBoxRenderer(defaultLocaleModel));
return cmbDefaultLocale;
}
Aggregations