use of org.phoenicis.javafx.components.installation.control.InstallationsFeaturePanel in project POL-POM-5 by PlayOnLinux.
the class MainWindow method createInstallationsTab.
private Tab createInstallationsTab(InstallationsFeaturePanel installationsFeaturePanel) {
final Tab installationsTab = new Tab(tr("Installations"), installationsFeaturePanel);
installationsTab.setClosable(false);
final ConcatenatedList<InstallationDTO> installations = ConcatenatedList.create(new MappedList<>(installationsFeaturePanel.getInstallationCategories(), InstallationCategoryDTO::getInstallations));
// a binding containing the number of currently active installations
final IntegerBinding openInstallations = Bindings.createIntegerBinding(installations::size, installations);
final TabIndicator indicator = new TabIndicator();
indicator.textProperty().bind(StringBindings.map(openInstallations, numberOfInstallations -> {
if (numberOfInstallations.intValue() < 10) {
return String.valueOf(numberOfInstallations);
} else {
return "+";
}
}));
// only show the tab indicator if at least one active installation exists
installationsTab.graphicProperty().bind(Bindings.when(Bindings.notEqual(openInstallations, 0)).then(indicator).otherwise(new SimpleObjectProperty<>()));
return installationsTab;
}
use of org.phoenicis.javafx.components.installation.control.InstallationsFeaturePanel in project POL-POM-5 by PhoenicisOrg.
the class MainWindow method createInstallationsTab.
private Tab createInstallationsTab(InstallationsFeaturePanel installationsFeaturePanel) {
final Tab installationsTab = new Tab(tr("Installations"), installationsFeaturePanel);
installationsTab.setClosable(false);
final ConcatenatedList<InstallationDTO> installations = ConcatenatedList.create(new MappedList<>(installationsFeaturePanel.getInstallationCategories(), InstallationCategoryDTO::getInstallations));
// a binding containing the number of currently active installations
final IntegerBinding openInstallations = Bindings.createIntegerBinding(installations::size, installations);
final TabIndicator indicator = new TabIndicator();
indicator.textProperty().bind(StringBindings.map(openInstallations, numberOfInstallations -> {
if (numberOfInstallations.intValue() < 10) {
return String.valueOf(numberOfInstallations);
} else {
return "+";
}
}));
// only show the tab indicator if at least one active installation exists
installationsTab.graphicProperty().bind(Bindings.when(Bindings.notEqual(openInstallations, 0)).then(indicator).otherwise(new SimpleObjectProperty<>()));
return installationsTab;
}
use of org.phoenicis.javafx.components.installation.control.InstallationsFeaturePanel in project POL-POM-5 by PhoenicisOrg.
the class ViewsConfiguration method viewInstallations.
@Bean
public InstallationsFeaturePanel viewInstallations() {
final InstallationsFeaturePanel installationsFeaturePanel = new InstallationsFeaturePanel();
installationsFeaturePanel.setJavaFxSettingsManager(javaFxSettingsConfiguration.javaFxSettingsManager());
// TODO: remove the InstallationsFilter class
final InstallationsFilter installationsFilter = new InstallationsFilter();
installationsFeaturePanel.setFilter(installationsFilter);
installationsFeaturePanel.setInitialized(true);
return installationsFeaturePanel;
}
use of org.phoenicis.javafx.components.installation.control.InstallationsFeaturePanel in project POL-POM-5 by PlayOnLinux.
the class ViewsConfiguration method viewInstallations.
@Bean
public InstallationsFeaturePanel viewInstallations() {
final InstallationsFeaturePanel installationsFeaturePanel = new InstallationsFeaturePanel();
installationsFeaturePanel.setJavaFxSettingsManager(javaFxSettingsConfiguration.javaFxSettingsManager());
// TODO: remove the InstallationsFilter class
final InstallationsFilter installationsFilter = new InstallationsFilter();
installationsFeaturePanel.setFilter(installationsFilter);
installationsFeaturePanel.setInitialized(true);
return installationsFeaturePanel;
}
Aggregations