use of de.alpharogroup.bundle.app.panels.dashboard.mainapp.MainDashboardPanel 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);
}
use of de.alpharogroup.bundle.app.panels.dashboard.mainapp.MainDashboardPanel 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")));
}
}
use of de.alpharogroup.bundle.app.panels.dashboard.mainapp.MainDashboardPanel 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.bundle.app.panels.dashboard.mainapp.MainDashboardPanel 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