Search in sources :

Example 1 with ApplicationDashboardBean

use of de.alpharogroup.bundle.app.panels.dashboard.ApplicationDashboardBean in project bundle-app-ui by astrapi69.

the class OverviewResourceBundleAddEntryPanel method onDelete.

protected void onDelete(ActionEvent e) {
    int dialogResult = JOptionPane.showConfirmDialog(null, "This will delete this resource bundle and is not recoverable?(cannot be undone)", "Warning", JOptionPane.YES_NO_OPTION);
    if (dialogResult == JOptionPane.YES_OPTION) {
        SpringApplicationContext.getInstance().getResourcebundlesService().delete(getModelObject().getSelectedBundleName());
        final Model<ApplicationDashboardBean> baModel = MainFrame.getInstance().getSelectedBundleApplicationPropertyModel();
        final ApplicationDashboardContentPanel component = new ApplicationDashboardContentPanel(baModel);
        MainFrame.getInstance().replaceInternalFrame("Dashboard of " + baModel.getObject().getBundleApplication().getName() + " bundle app", component);
    }
}
Also used : ApplicationDashboardBean(de.alpharogroup.bundle.app.panels.dashboard.ApplicationDashboardBean) ApplicationDashboardContentPanel(de.alpharogroup.bundle.app.panels.dashboard.ApplicationDashboardContentPanel)

Example 2 with ApplicationDashboardBean

use of de.alpharogroup.bundle.app.panels.dashboard.ApplicationDashboardBean 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;
}
Also used : Locale(java.util.Locale) LocalesComboBoxModel(de.alpharogroup.bundle.app.combobox.model.LocalesComboBoxModel) LanguageLocales(de.alpharogroup.db.resource.bundles.entities.LanguageLocales) LocalesComboBoxRenderer(de.alpharogroup.bundle.app.combobox.renderer.LocalesComboBoxRenderer) ApplicationDashboardBean(de.alpharogroup.bundle.app.panels.dashboard.ApplicationDashboardBean) BundleApplications(de.alpharogroup.db.resource.bundles.entities.BundleApplications)

Example 3 with ApplicationDashboardBean

use of de.alpharogroup.bundle.app.panels.dashboard.ApplicationDashboardBean 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

ApplicationDashboardBean (de.alpharogroup.bundle.app.panels.dashboard.ApplicationDashboardBean)3 ApplicationDashboardContentPanel (de.alpharogroup.bundle.app.panels.dashboard.ApplicationDashboardContentPanel)2 BundleApplications (de.alpharogroup.db.resource.bundles.entities.BundleApplications)2 LocalesComboBoxModel (de.alpharogroup.bundle.app.combobox.model.LocalesComboBoxModel)1 LocalesComboBoxRenderer (de.alpharogroup.bundle.app.combobox.renderer.LocalesComboBoxRenderer)1 MainDashboardBean (de.alpharogroup.bundle.app.panels.dashboard.mainapp.MainDashboardBean)1 MainDashboardPanel (de.alpharogroup.bundle.app.panels.dashboard.mainapp.MainDashboardPanel)1 LanguageLocales (de.alpharogroup.db.resource.bundles.entities.LanguageLocales)1 Locale (java.util.Locale)1