Search in sources :

Example 1 with Quattro

use of de.alpharogroup.collections.pairs.Quattro in project bundle-app-ui by astrapi69.

the class OverviewResourceBundleAddEntryPanel method reloadTableModelList.

private void reloadTableModelList() {
    tableModelList = new ArrayList<>();
    final ResourcebundlesService resourcebundlesService = SpringApplicationContext.getInstance().getResourcebundlesService();
    BundleApplications bundleApplication = getModelObject().getBundleApplication();
    final String baseName = getModelObject().getSelectedBundleName().getBaseName().getName();
    final Locale locale = LocaleResolver.resolveLocale(getModelObject().getSelectedBundleName().getLocale().getLocale());
    final List<Resourcebundles> list = resourcebundlesService.findResourceBundles(bundleApplication, baseName, locale);
    for (final Resourcebundles resourcebundle : list) {
        tableModelList.add(Quattro.<String, String, Resourcebundles, Resourcebundles>builder().topLeft(resourcebundle.getKey().getName()).topRight(resourcebundle.getValue()).bottomLeft(resourcebundle).bottomRight(resourcebundle).build());
    }
    Collections.sort(tableModelList, NullCheckComparator.<Quattro<String, String, Resourcebundles, Resourcebundles>>of((o1, o2) -> o1.getTopLeft().compareTo(o2.getTopLeft())));
}
Also used : Locale(java.util.Locale) PropertiesKeysService(de.alpharogroup.db.resource.bundles.service.api.PropertiesKeysService) 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) ArrayList(java.util.ArrayList) PropertiesExtensions(de.alpharogroup.collections.properties.PropertiesExtensions) LocaleResolver(de.alpharogroup.resourcebundle.locale.LocaleResolver) Locale(java.util.Locale) StringResourcebundlesTableModel(de.alpharogroup.bundle.app.table.model.StringResourcebundlesTableModel) BasePanel(de.alpharogroup.swing.base.BasePanel) JFileChooser(javax.swing.JFileChooser) SpringApplicationContext(de.alpharogroup.bundle.app.spring.SpringApplicationContext) Properties(java.util.Properties) Resourcebundles(de.alpharogroup.db.resource.bundles.entities.Resourcebundles) ResourcebundlesService(de.alpharogroup.db.resource.bundles.service.api.ResourcebundlesService) TableColumn(javax.swing.table.TableColumn) Model(de.alpharogroup.model.api.Model) FileOutputStream(java.io.FileOutputStream) ApplicationDashboardContentPanel(de.alpharogroup.bundle.app.panels.dashboard.ApplicationDashboardContentPanel) IOException(java.io.IOException) JOptionPane(javax.swing.JOptionPane) Component(java.awt.Component) ActionEvent(java.awt.event.ActionEvent) File(java.io.File) NullCheckComparator(de.alpharogroup.comparators.NullCheckComparator) ResourceBundlesDomainObjectFactory(de.alpharogroup.db.resource.bundles.factories.ResourceBundlesDomainObjectFactory) GenericJXTable(de.alpharogroup.swing.x.GenericJXTable) List(java.util.List) Slf4j(lombok.extern.slf4j.Slf4j) ReturnToDashboardAction(de.alpharogroup.bundle.app.actions.ReturnToDashboardAction) JCheckBox(javax.swing.JCheckBox) ApplicationDashboardBean(de.alpharogroup.bundle.app.panels.dashboard.ApplicationDashboardBean) JTable(javax.swing.JTable) PropertiesKeys(de.alpharogroup.db.resource.bundles.entities.PropertiesKeys) TableCellButtonRenderer(de.alpharogroup.swing.renderer.TableCellButtonRenderer) Collections(java.util.Collections) Quattro(de.alpharogroup.collections.pairs.Quattro) ResourcebundlesService(de.alpharogroup.db.resource.bundles.service.api.ResourcebundlesService) BundleApplications(de.alpharogroup.db.resource.bundles.entities.BundleApplications) Resourcebundles(de.alpharogroup.db.resource.bundles.entities.Resourcebundles)

Aggregations

MainFrame (de.alpharogroup.bundle.app.MainFrame)1 ReturnToDashboardAction (de.alpharogroup.bundle.app.actions.ReturnToDashboardAction)1 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 StringResourcebundlesTableModel (de.alpharogroup.bundle.app.table.model.StringResourcebundlesTableModel)1 Quattro (de.alpharogroup.collections.pairs.Quattro)1 PropertiesExtensions (de.alpharogroup.collections.properties.PropertiesExtensions)1 NullCheckComparator (de.alpharogroup.comparators.NullCheckComparator)1 BundleApplications (de.alpharogroup.db.resource.bundles.entities.BundleApplications)1 PropertiesKeys (de.alpharogroup.db.resource.bundles.entities.PropertiesKeys)1 Resourcebundles (de.alpharogroup.db.resource.bundles.entities.Resourcebundles)1 ResourceBundlesDomainObjectFactory (de.alpharogroup.db.resource.bundles.factories.ResourceBundlesDomainObjectFactory)1 PropertiesKeysService (de.alpharogroup.db.resource.bundles.service.api.PropertiesKeysService)1 ResourcebundlesService (de.alpharogroup.db.resource.bundles.service.api.ResourcebundlesService)1 BaseModel (de.alpharogroup.model.BaseModel)1 Model (de.alpharogroup.model.api.Model)1 LocaleResolver (de.alpharogroup.resourcebundle.locale.LocaleResolver)1 BasePanel (de.alpharogroup.swing.base.BasePanel)1 TableCellButtonRenderer (de.alpharogroup.swing.renderer.TableCellButtonRenderer)1