Search in sources :

Example 1 with MainDashboardBean

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

the class MainFrame method onInitializeComponents.

@Override
protected void onInitializeComponents() {
    super.onInitializeComponents();
    // create the tool bar
    toolbar = new JToolBar();
    setJMenuBar(menubar);
    setToolBar(toolbar);
    desktopPane = SingletonDesktopPane.getInstance();
    currentLookAndFeels = LookAndFeels.SYSTEM;
    getContentPane().add(desktopPane);
    try {
        final String iconPath = Messages.getString("global.icon.app.path");
        final BufferedImage appIcon = ImageIO.read(ClassExtensions.getResourceAsStream(iconPath));
        setIconImage(appIcon);
    } catch (final IOException e) {
        log.error("Icon file could not be readed.", e);
    }
    final ApplicationContext applicationContext = SpringApplicationContext.getInstance().getApplicationContext();
    final BundleApplicationsService bundleApplicationsService = (BundleApplicationsService) applicationContext.getBean("bundleApplicationsService");
    final Model<MainDashboardBean> model = BaseModel.<MainDashboardBean>of(MainDashboardBean.builder().bundleApplications(bundleApplicationsService.findAll()).build());
    setModel(model);
    final MainDashboardPanel mainDashboardPanel = new MainDashboardPanel(PropertyModel.<MainDashboardBean>of(this, "model.object"));
    replaceInternalFrame("Main dashboard", mainDashboardPanel);
}
Also used : BundleApplicationsService(de.alpharogroup.db.resource.bundles.service.api.BundleApplicationsService) SpringApplicationContext(de.alpharogroup.bundle.app.spring.SpringApplicationContext) ApplicationContext(org.springframework.context.ApplicationContext) MainDashboardPanel(de.alpharogroup.bundle.app.panels.dashboard.mainapp.MainDashboardPanel) MainDashboardBean(de.alpharogroup.bundle.app.panels.dashboard.mainapp.MainDashboardBean) JToolBar(javax.swing.JToolBar) IOException(java.io.IOException) BufferedImage(java.awt.image.BufferedImage)

Example 2 with MainDashboardBean

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

the class OverviewOfAllBundleApplicationsPanel method onDelete.

protected void onDelete(final BundleApplications selectedBundleApplication) {
    int dialogResult = JOptionPane.showConfirmDialog(null, "This will delete this bundle application and is not recoverable?(cannot be undone)", "Warning", JOptionPane.YES_NO_OPTION);
    if (dialogResult == JOptionPane.YES_OPTION) {
        SpringApplicationContext.getInstance().getBundleApplicationsService().delete(selectedBundleApplication);
        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 3 with MainDashboardBean

use of de.alpharogroup.bundle.app.panels.dashboard.mainapp.MainDashboardBean 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 4 with MainDashboardBean

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

MainDashboardBean (de.alpharogroup.bundle.app.panels.dashboard.mainapp.MainDashboardBean)4 MainDashboardPanel (de.alpharogroup.bundle.app.panels.dashboard.mainapp.MainDashboardPanel)4 BundleApplications (de.alpharogroup.db.resource.bundles.entities.BundleApplications)3 ApplicationDashboardBean (de.alpharogroup.bundle.app.panels.dashboard.ApplicationDashboardBean)1 ApplicationDashboardContentPanel (de.alpharogroup.bundle.app.panels.dashboard.ApplicationDashboardContentPanel)1 SpringApplicationContext (de.alpharogroup.bundle.app.spring.SpringApplicationContext)1 BundleApplicationsService (de.alpharogroup.db.resource.bundles.service.api.BundleApplicationsService)1 BufferedImage (java.awt.image.BufferedImage)1 IOException (java.io.IOException)1 JToolBar (javax.swing.JToolBar)1 ApplicationContext (org.springframework.context.ApplicationContext)1