Search in sources :

Example 1 with BundleNamesService

use of de.alpharogroup.db.resource.bundles.service.api.BundleNamesService in project bundle-app-ui by astrapi69.

the class NewBundleNamePanel method onSave.

protected void onSave(final ActionEvent e) {
    BundleApplications bundleApplication = getModelObject().getBundleApplication();
    final BundleNamesService bundleNamesService = SpringApplicationContext.getInstance().getBundleNamesService();
    final String baseName = txtBasename.getText();
    final LanguageLocales selectedItem = (LanguageLocales) cmbLocale.getSelectedItem();
    if (selectedItem != null) {
        final Locale locale = LocaleResolver.resolveLocale(selectedItem.getLocale());
        bundleNamesService.getOrCreateNewBundleNames(bundleApplication, baseName, locale);
    } else {
        final LanguageLocales languageLocales = getModelObject().getBundleApplication().getDefaultLocale();
        final Locale locale = SpringApplicationContext.getInstance().getLanguageLocalesService().resolveLocale(languageLocales);
        bundleNamesService.getOrCreateNewBundleNames(bundleApplication, baseName, locale);
    }
}
Also used : Locale(java.util.Locale) LanguageLocales(de.alpharogroup.db.resource.bundles.entities.LanguageLocales) BundleApplications(de.alpharogroup.db.resource.bundles.entities.BundleApplications) BundleNamesService(de.alpharogroup.db.resource.bundles.service.api.BundleNamesService)

Aggregations

BundleApplications (de.alpharogroup.db.resource.bundles.entities.BundleApplications)1 LanguageLocales (de.alpharogroup.db.resource.bundles.entities.LanguageLocales)1 BundleNamesService (de.alpharogroup.db.resource.bundles.service.api.BundleNamesService)1 Locale (java.util.Locale)1