use of org.phoenicis.engines.dto.EngineVersionDTO in project POL-POM-5 by PlayOnLinux.
the class WinePrefixContainerInformationTab method populate.
private void populate() {
final VBox informationPane = new VBox();
final Text title = new TextWithStyle(tr("Information"), TITLE_CSS_CLASS);
informationPane.getStyleClass().add(CONFIGURATION_PANE_CSS_CLASS);
informationPane.getChildren().add(title);
final GridPane informationContentPane = new GridPane();
informationContentPane.getStyleClass().add("grid");
informationContentPane.add(new TextWithStyle(tr("Name:"), CAPTION_TITLE_CSS_CLASS), 0, 0);
Label name = new Label(container.getName());
name.setWrapText(true);
informationContentPane.add(name, 1, 0);
informationContentPane.add(new TextWithStyle(tr("Path:"), CAPTION_TITLE_CSS_CLASS), 0, 1);
Label path = new Label(container.getPath());
path.setWrapText(true);
informationContentPane.add(path, 1, 1);
informationContentPane.add(new TextWithStyle(tr("Wine version:"), CAPTION_TITLE_CSS_CLASS), 0, 2);
Label version = new Label(container.getVersion());
version.setWrapText(true);
informationContentPane.add(version, 1, 2);
informationContentPane.add(new TextWithStyle(tr("Wine architecture:"), CAPTION_TITLE_CSS_CLASS), 0, 3);
Label architecture = new Label(container.getArchitecture());
architecture.setWrapText(true);
informationContentPane.add(architecture, 1, 3);
informationContentPane.add(new TextWithStyle(tr("Wine distribution:"), CAPTION_TITLE_CSS_CLASS), 0, 4);
Label distribution = new Label(container.getDistribution());
distribution.setWrapText(true);
informationContentPane.add(distribution, 1, 4);
Region spacer = new Region();
spacer.setPrefHeight(20);
VBox.setVgrow(spacer, Priority.NEVER);
ComboBox<EngineVersionDTO> changeEngineComboBox = new ComboBox<EngineVersionDTO>(FXCollections.observableList(engineVersions));
changeEngineComboBox.setConverter(new StringConverter<EngineVersionDTO>() {
@Override
public String toString(EngineVersionDTO object) {
return object.getVersion();
}
@Override
public EngineVersionDTO fromString(String string) {
return engineVersions.stream().filter(engineVersion -> engineVersion.getVersion().equals(string)).findFirst().get();
}
});
changeEngineComboBox.getSelectionModel().select(engineVersions.stream().filter(engineVersion -> engineVersion.getVersion().equals(container.getVersion())).findFirst().get());
Button deleteButton = new Button(tr("Delete container"));
deleteButton.setOnMouseClicked(event -> this.onDeletePrefix.accept(container));
informationPane.getChildren().addAll(informationContentPane, spacer, changeEngineComboBox, deleteButton);
this.setContent(informationPane);
}
use of org.phoenicis.engines.dto.EngineVersionDTO in project POL-POM-5 by PlayOnLinux.
the class EngineSubCategoryPanelSkin method createListWidget.
/**
* Creates a new {@link CombinedListWidget} object containing all {@link EngineVersionDTO} objects in the given
* {@link ObservableList filteredEngineVersions}
*
* @param filteredEngineVersions An {@link ObservableList} containing all to be shown {@link EngineVersionDTO}
* objects
* @return A new {@link CombinedListWidget} object containing all {@link EngineVersionDTO} objects in the given
* {@link ObservableList filteredEngineVersions}
*/
private CombinedListWidget<EngineVersionDTO> createListWidget(ObservableList<EngineVersionDTO> filteredEngineVersions) {
final ObservableList<ListWidgetElement<EngineVersionDTO>> listWidgetEntries = new MappedList<>(filteredEngineVersions, engineVersion -> ListWidgetElement.create(engineVersion, Files.exists(Paths.get(getControl().getEnginesPath(), getControl().getEngineCategory().getName().toLowerCase(), getControl().getEngineSubCategory().getName(), engineVersion.getVersion()))));
final CombinedListWidget<EngineVersionDTO> listWidget = new CombinedListWidget<>(listWidgetEntries);
listWidget.selectedListWidgetProperty().bind(getControl().selectedListWidgetProperty());
listWidget.selectedElementProperty().addListener((observable, oldValue, newValue) -> {
if (newValue != null) {
final EngineVersionDTO engineItem = newValue.getItem();
Map<String, String> userData = new HashMap<>();
userData.put("Mono", engineItem.getMonoFile());
userData.put("Gecko", engineItem.getGeckoFile());
EngineDTO engineDTO = new EngineDTO.Builder().withCategory(getControl().getEngineCategory().getName()).withSubCategory(getControl().getEngineSubCategory().getName()).withVersion(engineItem.getVersion()).withUserData(userData).build();
Optional.ofNullable(getControl().getOnEngineSelect()).ifPresent(onEngineSelect -> onEngineSelect.accept(engineDTO, getControl().getEngine()));
}
});
return listWidget;
}
use of org.phoenicis.engines.dto.EngineVersionDTO in project POL-POM-5 by PlayOnLinux.
the class EngineSubCategoryPanelSkin method createFilteredEngineVersions.
/**
* Creates a {@link FilteredList} object of the engine versions by applying the {@link EnginesFilter} known to the
* control
*
* @return A filtered list of the engine versions
*/
private ObservableList<EngineVersionDTO> createFilteredEngineVersions() {
final EnginesFilter filter = getControl().getFilter();
final EngineCategoryDTO engineCategory = getControl().getEngineCategory();
final EngineSubCategoryDTO engineSubCategory = getControl().getEngineSubCategory();
final FilteredList<EngineVersionDTO> filteredEngineVersions = FXCollections.observableArrayList(engineSubCategory.getPackages()).sorted(EngineSubCategoryDTO.comparator().reversed()).filtered(filter.createFilter(engineCategory, engineSubCategory));
filteredEngineVersions.predicateProperty().bind(Bindings.createObjectBinding(() -> filter.createFilter(engineCategory, engineSubCategory), filter.searchTermProperty(), filter.selectedEngineCategoryProperty(), filter.showInstalledProperty(), filter.showNotInstalledProperty()));
return filteredEngineVersions;
}
Aggregations