use of org.phoenicis.javafx.settings.JavaFxSettingsManager in project POL-POM-5 by PlayOnLinux.
the class InstallationsFeaturePanelSkin method createSidebar.
/**
* {@inheritDoc}
*/
@Override
public ObjectExpression<SidebarBase<?, ?, ?>> createSidebar() {
final SortedList<InstallationCategoryDTO> sortedCategories = getControl().getInstallationCategories().sorted(Comparator.comparing(InstallationCategoryDTO::getName));
final InstallationSidebar sidebar = new InstallationSidebar(getControl().getFilter(), sortedCategories, this.selectedListWidget);
// set the default selection
sidebar.setSelectedListWidget(Optional.ofNullable(getControl().getJavaFxSettingsManager()).map(JavaFxSettingsManager::getInstallationsListType).orElse(ListWidgetType.ICONS_LIST));
// save changes to the list widget selection to the hard drive
sidebar.selectedListWidgetProperty().addListener((observable, oldValue, newValue) -> {
final JavaFxSettingsManager javaFxSettingsManager = getControl().getJavaFxSettingsManager();
if (newValue != null) {
javaFxSettingsManager.setInstallationsListType(newValue);
javaFxSettingsManager.save();
}
});
return new SimpleObjectProperty<>(sidebar);
}
use of org.phoenicis.javafx.settings.JavaFxSettingsManager in project POL-POM-5 by PlayOnLinux.
the class ContainersFeaturePanelSkin method createSidebar.
/**
* {@inheritDoc}
*/
@Override
public ObjectExpression<SidebarBase<?, ?, ?>> createSidebar() {
/*
* initialize the container categories by sorting them
*/
final SortedList<ContainerCategoryDTO> sortedCategories = getControl().getCategories().sorted(Comparator.comparing(ContainerCategoryDTO::getName));
final ContainerSidebar sidebar = new ContainerSidebar(getControl().getFilter(), sortedCategories, this.selectedListWidget);
// set the default selection
sidebar.setSelectedListWidget(Optional.ofNullable(getControl().getJavaFxSettingsManager()).map(JavaFxSettingsManager::getContainersListType).orElse(ListWidgetType.ICONS_LIST));
// save changes to the list widget selection to the hard drive
sidebar.selectedListWidgetProperty().addListener((observable, oldValue, newValue) -> {
final JavaFxSettingsManager javaFxSettingsManager = getControl().getJavaFxSettingsManager();
if (newValue != null) {
javaFxSettingsManager.setContainersListType(newValue);
javaFxSettingsManager.save();
}
});
return new SimpleObjectProperty<>(sidebar);
}
use of org.phoenicis.javafx.settings.JavaFxSettingsManager in project POL-POM-5 by PlayOnLinux.
the class LibraryFeaturePanelSkin method createSidebar.
/**
* {@inheritDoc}
*/
@Override
public ObjectExpression<SidebarBase<?, ?, ?>> createSidebar() {
final SortedList<ShortcutCategoryDTO> sortedCategories = getControl().getCategories().sorted(Comparator.comparing(ShortcutCategoryDTO::getName));
final LibrarySidebar sidebar = new LibrarySidebar(getControl().getFilter(), sortedCategories, this.selectedListWidget);
sidebar.applicationNameProperty().bind(getControl().applicationNameProperty());
sidebar.javaFxSettingsManagerProperty().bind(getControl().javaFxSettingsManagerProperty());
sidebar.setOnCreateShortcut(() -> {
// deselect the currently selected shortcut
getControl().setSelectedShortcut(null);
// open the shortcut creation details panel
getControl().setOpenedDetailsPanel(new ShortcutCreation());
});
sidebar.setOnOpenConsole(getControl()::openConsole);
// set the default selection
sidebar.setSelectedListWidget(Optional.ofNullable(getControl().getJavaFxSettingsManager()).map(JavaFxSettingsManager::getLibraryListType).orElse(ListWidgetType.ICONS_LIST));
// save changes to the list widget selection to the hard drive
sidebar.selectedListWidgetProperty().addListener((observable, oldValue, newValue) -> {
final JavaFxSettingsManager javaFxSettingsManager = getControl().getJavaFxSettingsManager();
if (newValue != null) {
javaFxSettingsManager.setLibraryListType(newValue);
javaFxSettingsManager.save();
}
});
return new SimpleObjectProperty<>(sidebar);
}
use of org.phoenicis.javafx.settings.JavaFxSettingsManager in project POL-POM-5 by PlayOnLinux.
the class ApplicationsFeaturePanelSkin method createSidebar.
/**
* {@inheritDoc}
*/
@Override
public ObjectExpression<SidebarBase<?, ?, ?>> createSidebar() {
/*
* initialize the category lists by:
* 1. filtering by installer categories
* 2. sorting the remaining categories by their name
*/
final SortedList<CategoryDTO> sortedCategories = getControl().getCategories().filtered(category -> category.getType() == CategoryDTO.CategoryType.INSTALLERS).sorted(Comparator.comparing(CategoryDTO::getName));
final ApplicationSidebar sidebar = new ApplicationSidebar(sortedCategories, this.selectedListWidget);
sidebar.operatingSystemProperty().bind(getControl().operatingSystemProperty());
sidebar.fuzzySearchRatioProperty().bind(getControl().fuzzySearchRatioProperty());
getControl().searchTermProperty().bind(sidebar.searchTermProperty());
getControl().filterCategoryProperty().bind(sidebar.selectedItemProperty());
getControl().containCommercialApplicationsProperty().bind(sidebar.containCommercialApplicationsProperty());
getControl().containRequiresPatchApplicationsProperty().bind(sidebar.containRequiresPatchApplicationsProperty());
getControl().containTestingApplicationsProperty().bind(sidebar.containTestingApplicationsProperty());
getControl().containAllOSCompatibleApplicationsProperty().bind(sidebar.containAllOSCompatibleApplicationsProperty());
// set the default selection
sidebar.setSelectedListWidget(Optional.ofNullable(getControl().getJavaFxSettingsManager()).map(JavaFxSettingsManager::getAppsListType).orElse(ListWidgetType.ICONS_LIST));
// save changes to the list widget selection to the hard drive
sidebar.selectedListWidgetProperty().addListener((observable, oldValue, newValue) -> {
final JavaFxSettingsManager javaFxSettingsManager = getControl().getJavaFxSettingsManager();
if (newValue != null) {
javaFxSettingsManager.setAppsListType(newValue);
javaFxSettingsManager.save();
}
});
return new SimpleObjectProperty<>(sidebar);
}
Aggregations