use of de.alpharogroup.db.resource.bundles.entities.BundleApplications 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);
}
}
use of de.alpharogroup.db.resource.bundles.entities.BundleApplications in project bundle-app-ui by astrapi69.
the class OverviewOfAllResourceBundlesPanel method getTableModelList.
private List<Triple<String, String, BundleNames>> getTableModelList() {
if (tableModelList == null) {
tableModelList = new ArrayList<>();
BundleApplications bundleApplication = getModelObject().getBundleApplication();
getModelObject().setBundleNames(SpringApplicationContext.getInstance().getBundleApplicationsService().find(bundleApplication));
final Set<BundleNames> set = getModelObject().getBundleNames();
if (CollectionExtensions.isNotEmpty(set)) {
for (final BundleNames bundleNames : set) {
tableModelList.add(Triple.<String, String, BundleNames>builder().left(bundleNames.getBaseName().getName()).middle(bundleNames.getLocale().getLocale()).right(bundleNames).build());
}
}
Collections.sort(tableModelList, NullCheckComparator.<Triple<String, String, BundleNames>>of((o1, o2) -> o1.getLeft().compareTo(o2.getLeft())));
}
return tableModelList;
}
use of de.alpharogroup.db.resource.bundles.entities.BundleApplications in project bundle-app-ui by astrapi69.
the class OverviewBundleAppsAction method actionPerformed.
/**
* {@inheritDoc}
*/
@Override
public void actionPerformed(final ActionEvent e) {
final List<BundleApplications> bundleApplications = SpringApplicationContext.getInstance().getBundleApplicationsService().findAll();
MainFrame.getInstance().getModelObject().setBundleApplications(bundleApplications);
MainFrame.getInstance().replaceInternalFrame("Overview bundle apps", new MainDashboardPanel(PropertyModel.<MainDashboardBean>of(MainFrame.getInstance(), "model.object")));
}
use of de.alpharogroup.db.resource.bundles.entities.BundleApplications in project bundle-app-ui by astrapi69.
the class MainFrame method setSelectedBundleApplication.
public void setSelectedBundleApplication(final BundleApplications bundleApplication) {
initApllicationDashboardBean();
final BundleApplications bundleApplications = SpringApplicationContext.getInstance().getBundleApplicationsService().get(bundleApplication.getId());
getModelObject().getSelectedBundleApplication().setBundleApplication(bundleApplications);
}
use of de.alpharogroup.db.resource.bundles.entities.BundleApplications in project bundle-app-ui by astrapi69.
the class ReturnToDashboardAction method now.
public void now() {
final Model<ApplicationDashboardBean> baModel = MainFrame.getInstance().getSelectedBundleApplicationPropertyModel();
if (baModel.getObject().getBundleApplication() != null) {
final ApplicationDashboardContentPanel component = new ApplicationDashboardContentPanel(baModel);
MainFrame.getInstance().replaceInternalFrame("Dashboard of " + baModel.getObject().getBundleApplication().getName() + " bundle app", component);
} else {
final List<BundleApplications> bundleApplications = SpringApplicationContext.getInstance().getBundleApplicationsService().findAll();
MainFrame.getInstance().getModelObject().setBundleApplications(bundleApplications);
MainFrame.getInstance().replaceInternalFrame("Overview bundle apps", new MainDashboardPanel(PropertyModel.<MainDashboardBean>of(MainFrame.getInstance(), "model.object")));
}
}
Aggregations