use of de.alpharogroup.bundle.app.combobox.renderer.LocalesComboBoxRenderer 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;
}
use of de.alpharogroup.bundle.app.combobox.renderer.LocalesComboBoxRenderer in project bundle-app-ui by astrapi69.
the class ImportBundleApplicationStartPanel method onInitializeComponents.
@Override
protected void onInitializeComponents() {
super.onInitializeComponents();
fileChooser = new JFileChooser();
fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
lblWelcomeImportHeader = new javax.swing.JLabel();
lblBundleAppName = new javax.swing.JLabel();
txtBundleAppName = new javax.swing.JTextField();
final Model<String> bundleAppNameModel = model(from(getModelObject().getModelObject()).getBundleAppName());
txtBundleAppName.getDocument().addDocumentListener(new StringBindingListener(bundleAppNameModel));
txtBundleAppName.addActionListener(e -> onBundleAppName(e));
lblHeaderChooseBundleAppName = new javax.swing.JLabel();
btnChooseRootDir = new javax.swing.JButton();
btnChooseRootDir.addActionListener(actionEvent -> onChooseRootDir(actionEvent));
lblChooseRootDir = new javax.swing.JLabel();
lblDefaultLocale = new javax.swing.JLabel();
cmbDefaultLocale = new javax.swing.JComboBox<>(LocalesComboBoxModel.get());
cmbDefaultLocale.addItemListener(e -> onChangeDefaultLocale(e));
final Model<Locale> defaultLocaleModel = model(from(getModelObject().getModelObject()).getDefaultLocale());
cmbDefaultLocale.setRenderer(new LocalesComboBoxRenderer(defaultLocaleModel));
lblSelectedRootDir = new javax.swing.JLabel();
txtSelectedRootDir = new javax.swing.JTextField();
lblWelcomeImportHeader.setText("Import of an existing application with the bundle-manager ");
lblBundleAppName.setText("Application name");
lblHeaderChooseBundleAppName.setText("Give your imported bundle-application a name");
btnChooseRootDir.setText("Choose root directory");
lblChooseRootDir.setText("Choose the root directory of your project");
lblDefaultLocale.setText("Choose default locale");
lblSelectedRootDir.setText("Selected root directory of your project");
txtSelectedRootDir.setText("None");
}
Aggregations