Search in sources :

Example 11 with BundleApplications

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);
    }
}
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)

Example 12 with BundleApplications

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;
}
Also used : TableCellButtonEditor(de.alpharogroup.swing.table.editor.TableCellButtonEditor) BundleApplications(de.alpharogroup.db.resource.bundles.entities.BundleApplications) BaseModel(de.alpharogroup.model.BaseModel) MainFrame(de.alpharogroup.bundle.app.MainFrame) Triple(de.alpharogroup.collections.pairs.Triple) ArrayList(java.util.ArrayList) CollectionExtensions(de.alpharogroup.collections.CollectionExtensions) BasePanel(de.alpharogroup.swing.base.BasePanel) SpringApplicationContext(de.alpharogroup.bundle.app.spring.SpringApplicationContext) TableColumn(javax.swing.table.TableColumn) Model(de.alpharogroup.model.api.Model) BundleNames(de.alpharogroup.db.resource.bundles.entities.BundleNames) Set(java.util.Set) StringBundleNamesTableModel(de.alpharogroup.bundle.app.table.model.StringBundleNamesTableModel) Component(java.awt.Component) ActionEvent(java.awt.event.ActionEvent) NullCheckComparator(de.alpharogroup.comparators.NullCheckComparator) GenericJXTable(de.alpharogroup.swing.x.GenericJXTable) List(java.util.List) ReturnToDashboardAction(de.alpharogroup.bundle.app.actions.ReturnToDashboardAction) JCheckBox(javax.swing.JCheckBox) ApplicationDashboardBean(de.alpharogroup.bundle.app.panels.dashboard.ApplicationDashboardBean) JTable(javax.swing.JTable) TableCellButtonRenderer(de.alpharogroup.swing.renderer.TableCellButtonRenderer) Collections(java.util.Collections) BundleNames(de.alpharogroup.db.resource.bundles.entities.BundleNames) BundleApplications(de.alpharogroup.db.resource.bundles.entities.BundleApplications)

Example 13 with BundleApplications

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")));
}
Also used : MainDashboardPanel(de.alpharogroup.bundle.app.panels.dashboard.mainapp.MainDashboardPanel) BundleApplications(de.alpharogroup.db.resource.bundles.entities.BundleApplications) MainDashboardBean(de.alpharogroup.bundle.app.panels.dashboard.mainapp.MainDashboardBean)

Example 14 with BundleApplications

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);
}
Also used : BundleApplications(de.alpharogroup.db.resource.bundles.entities.BundleApplications)

Example 15 with 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")));
    }
}
Also used : MainDashboardPanel(de.alpharogroup.bundle.app.panels.dashboard.mainapp.MainDashboardPanel) ApplicationDashboardBean(de.alpharogroup.bundle.app.panels.dashboard.ApplicationDashboardBean) BundleApplications(de.alpharogroup.db.resource.bundles.entities.BundleApplications) MainDashboardBean(de.alpharogroup.bundle.app.panels.dashboard.mainapp.MainDashboardBean) ApplicationDashboardContentPanel(de.alpharogroup.bundle.app.panels.dashboard.ApplicationDashboardContentPanel)

Aggregations

BundleApplications (de.alpharogroup.db.resource.bundles.entities.BundleApplications)15 Locale (java.util.Locale)8 ApplicationDashboardBean (de.alpharogroup.bundle.app.panels.dashboard.ApplicationDashboardBean)4 LanguageLocales (de.alpharogroup.db.resource.bundles.entities.LanguageLocales)4 BundleApplicationsService (de.alpharogroup.db.resource.bundles.service.api.BundleApplicationsService)4 ResourcebundlesService (de.alpharogroup.db.resource.bundles.service.api.ResourcebundlesService)4 ApplicationDashboardContentPanel (de.alpharogroup.bundle.app.panels.dashboard.ApplicationDashboardContentPanel)3 MainDashboardBean (de.alpharogroup.bundle.app.panels.dashboard.mainapp.MainDashboardBean)3 MainDashboardPanel (de.alpharogroup.bundle.app.panels.dashboard.mainapp.MainDashboardPanel)3 Triple (de.alpharogroup.collections.pairs.Triple)3 BaseModel (de.alpharogroup.model.BaseModel)3 Model (de.alpharogroup.model.api.Model)3 TableCellButtonRenderer (de.alpharogroup.swing.renderer.TableCellButtonRenderer)3 TableCellButtonEditor (de.alpharogroup.swing.table.editor.TableCellButtonEditor)3 Component (java.awt.Component)3 JCheckBox (javax.swing.JCheckBox)3 JTable (javax.swing.JTable)3 TableColumn (javax.swing.table.TableColumn)3 MainFrame (de.alpharogroup.bundle.app.MainFrame)2 ReturnToDashboardAction (de.alpharogroup.bundle.app.actions.ReturnToDashboardAction)2