use of org.phoenicis.javafx.views.mainwindow.installations.dto.InstallationDTO in project POL-POM-5 by PlayOnLinux.
the class InstallationsUtils method mergeCategories.
private static InstallationCategoryDTO mergeCategories(InstallationCategoryDTO leftCategory, InstallationCategoryDTO rightCategory) {
final Map<String, InstallationDTO> leftInstallations = createSortedMap(leftCategory.getInstallations(), InstallationDTO::getId);
final Map<String, InstallationDTO> rightInstallations = createSortedMap(rightCategory.getInstallations(), InstallationDTO::getId);
final SortedMap<String, InstallationDTO> mergedInstallations = new TreeMap<>(rightInstallations);
for (Map.Entry<String, InstallationDTO> entry : leftInstallations.entrySet()) {
final InstallationDTO application = entry.getValue();
if (mergedInstallations.containsKey(entry.getKey())) {
LOGGER.error(String.format("Installation %s exists already!", entry.getKey()));
} else {
mergedInstallations.put(entry.getKey(), application);
}
}
final List<InstallationDTO> installations = mergedInstallations.values().stream().sorted(InstallationDTO.nameComparator()).collect(Collectors.toList());
return new InstallationCategoryDTO.Builder().withId(leftCategory.getId()).withName(leftCategory.getName()).withInstallations(installations).withIcon(leftCategory.getIcon()).build();
}
use of org.phoenicis.javafx.views.mainwindow.installations.dto.InstallationDTO in project POL-POM-5 by PhoenicisOrg.
the class InstallationsFeaturePanelSkin method createInstallationDetailsPanel.
private DetailsPanel createInstallationDetailsPanel(Installation action) {
final InstallationDTO installation = action.getInstallation();
final DetailsPanel detailsPanel = new DetailsPanel();
detailsPanel.setTitle(installation.getName());
detailsPanel.setContent(installation.getNode());
detailsPanel.setOnClose(getControl()::closeDetailsPanel);
detailsPanel.prefWidthProperty().bind(getControl().widthProperty().divide(3));
return detailsPanel;
}
use of org.phoenicis.javafx.views.mainwindow.installations.dto.InstallationDTO in project POL-POM-5 by PhoenicisOrg.
the class InstallationsUtils method mergeCategories.
private static InstallationCategoryDTO mergeCategories(InstallationCategoryDTO leftCategory, InstallationCategoryDTO rightCategory) {
final Map<String, InstallationDTO> leftInstallations = createSortedMap(leftCategory.getInstallations(), InstallationDTO::getId);
final Map<String, InstallationDTO> rightInstallations = createSortedMap(rightCategory.getInstallations(), InstallationDTO::getId);
final SortedMap<String, InstallationDTO> mergedInstallations = new TreeMap<>(rightInstallations);
for (Map.Entry<String, InstallationDTO> entry : leftInstallations.entrySet()) {
final InstallationDTO application = entry.getValue();
if (mergedInstallations.containsKey(entry.getKey())) {
LOGGER.error(String.format("Installation %s exists already!", entry.getKey()));
} else {
mergedInstallations.put(entry.getKey(), application);
}
}
final List<InstallationDTO> installations = mergedInstallations.values().stream().sorted(InstallationDTO.nameComparator()).collect(Collectors.toList());
return new InstallationCategoryDTO.Builder().withId(leftCategory.getId()).withName(leftCategory.getName()).withInstallations(installations).withIcon(leftCategory.getIcon()).build();
}
Aggregations