use of org.phoenicis.javafx.components.common.panelstates.None in project POL-POM-5 by PhoenicisOrg.
the class InstallationsFeaturePanel method closeDetailsPanel.
/**
* {@inheritDoc}
*/
@Override
public void closeDetailsPanel() {
// deselect the currently selected installation
setSelectedInstallation(null);
// close the details panel
setOpenedDetailsPanel(new None());
}
use of org.phoenicis.javafx.components.common.panelstates.None in project POL-POM-5 by PhoenicisOrg.
the class InstallationsFeaturePanelSkin method createContent.
/**
* {@inheritDoc}
*/
@Override
public ObjectExpression<Node> createContent() {
final FilteredList<InstallationDTO> filteredInstallations = ConcatenatedList.create(new MappedList<>(getControl().getInstallationCategories().sorted(Comparator.comparing(InstallationCategoryDTO::getName)), InstallationCategoryDTO::getInstallations)).filtered(getControl().getFilter()::filter);
filteredInstallations.predicateProperty().bind(Bindings.createObjectBinding(() -> getControl().getFilter()::filter, getControl().getFilter().searchTermProperty(), getControl().getFilter().selectedInstallationCategoryProperty()));
final SortedList<InstallationDTO> sortedInstallations = filteredInstallations.sorted(Comparator.comparing(InstallationDTO::getName));
final ObservableList<ListWidgetElement<InstallationDTO>> listWidgetEntries = new MappedList<>(sortedInstallations, ListWidgetElement::create);
final CombinedListWidget<InstallationDTO> combinedListWidget = new CombinedListWidget<>(listWidgetEntries, this.selectedListWidget);
// bind direction: controller property -> skin property
getControl().selectedInstallationProperty().addListener((observable, oldValue, newValue) -> {
if (newValue != null) {
combinedListWidget.select(newValue);
} else {
combinedListWidget.deselect();
}
});
// bind direction: skin property -> controller properties
combinedListWidget.selectedElementProperty().addListener((observable, oldValue, newValue) -> {
if (newValue != null) {
final InstallationDTO selectedItem = newValue.getItem();
getControl().setSelectedInstallation(selectedItem);
getControl().setOpenedDetailsPanel(new Installation(selectedItem));
} else {
getControl().setSelectedInstallation(null);
getControl().setOpenedDetailsPanel(new None());
}
});
return new SimpleObjectProperty<>(combinedListWidget);
}
use of org.phoenicis.javafx.components.common.panelstates.None in project POL-POM-5 by PhoenicisOrg.
the class ContainersFeaturePanel method closeDetailsPanel.
/**
* {@inheritDoc}
*/
@Override
public void closeDetailsPanel() {
// deselect the currently selected container
setSelectedContainer(null);
// close the details panel
setOpenedDetailsPanel(new None());
}
use of org.phoenicis.javafx.components.common.panelstates.None in project POL-POM-5 by PlayOnLinux.
the class InstallationsFeaturePanel method closeDetailsPanel.
/**
* {@inheritDoc}
*/
@Override
public void closeDetailsPanel() {
// deselect the currently selected installation
setSelectedInstallation(null);
// close the details panel
setOpenedDetailsPanel(new None());
}
use of org.phoenicis.javafx.components.common.panelstates.None in project POL-POM-5 by PlayOnLinux.
the class InstallationsFeaturePanelSkin method createContent.
/**
* {@inheritDoc}
*/
@Override
public ObjectExpression<Node> createContent() {
final FilteredList<InstallationDTO> filteredInstallations = ConcatenatedList.create(new MappedList<>(getControl().getInstallationCategories().sorted(Comparator.comparing(InstallationCategoryDTO::getName)), InstallationCategoryDTO::getInstallations)).filtered(getControl().getFilter()::filter);
filteredInstallations.predicateProperty().bind(Bindings.createObjectBinding(() -> getControl().getFilter()::filter, getControl().getFilter().searchTermProperty(), getControl().getFilter().selectedInstallationCategoryProperty()));
final SortedList<InstallationDTO> sortedInstallations = filteredInstallations.sorted(Comparator.comparing(InstallationDTO::getName));
final ObservableList<ListWidgetElement<InstallationDTO>> listWidgetEntries = new MappedList<>(sortedInstallations, ListWidgetElement::create);
final CombinedListWidget<InstallationDTO> combinedListWidget = new CombinedListWidget<>(listWidgetEntries, this.selectedListWidget);
// bind direction: controller property -> skin property
getControl().selectedInstallationProperty().addListener((observable, oldValue, newValue) -> {
if (newValue != null) {
combinedListWidget.select(newValue);
} else {
combinedListWidget.deselect();
}
});
// bind direction: skin property -> controller properties
combinedListWidget.selectedElementProperty().addListener((observable, oldValue, newValue) -> {
if (newValue != null) {
final InstallationDTO selectedItem = newValue.getItem();
getControl().setSelectedInstallation(selectedItem);
getControl().setOpenedDetailsPanel(new Installation(selectedItem));
} else {
getControl().setSelectedInstallation(null);
getControl().setOpenedDetailsPanel(new None());
}
});
return new SimpleObjectProperty<>(combinedListWidget);
}
Aggregations