use of javafx.beans.Observable in project POL-POM-5 by PlayOnLinux.
the class ContainersFeaturePanelSkin method createContainerInformationDetailsPanel.
private DetailsPanel createContainerInformationDetailsPanel(ContainerInformation action) {
final ContainerDTO container = action.getContainer();
final ContainerInformationPanel containerInformationPanel = new ContainerInformationPanel();
containerInformationPanel.setContainer(container);
containerInformationPanel.enginesManagerProperty().bind(getControl().enginesManagerProperty());
containerInformationPanel.verbsManagerProperty().bind(getControl().verbsManagerProperty());
containerInformationPanel.engineToolsManagerProperty().bind(getControl().engineToolsManagerProperty());
containerInformationPanel.setOnDeleteContainer(getControl()::deleteContainer);
containerInformationPanel.setOnChangeEngineVersion(getControl()::changeEngineVersion);
containerInformationPanel.setOnOpenFileBrowser(getControl()::openFileBrowser);
getControl().getEngineSettings().addListener((Observable invalidation) -> updateEngineSettings(containerInformationPanel));
getControl().getVerbs().addListener((Observable invalidation) -> updateVerbs(containerInformationPanel));
getControl().getEngineTools().addListener((Observable invalidation) -> updateEngineTools(containerInformationPanel));
updateEngineSettings(containerInformationPanel);
updateVerbs(containerInformationPanel);
updateEngineTools(containerInformationPanel);
final DetailsPanel containerDetailsPanel = new DetailsPanel();
containerDetailsPanel.setTitle(container.getName());
containerDetailsPanel.setContent(containerInformationPanel);
containerDetailsPanel.setOnClose(getControl()::closeDetailsPanel);
containerDetailsPanel.prefWidthProperty().bind(getControl().widthProperty().divide(3));
return containerDetailsPanel;
}
use of javafx.beans.Observable in project POL-POM-5 by PlayOnLinux.
the class KeyAttributeListSkin method initialise.
@Override
public void initialise() {
final TableView<KeyAttributeList.KeyAttributePair> table = createTable();
final Button addButton = new Button(tr("Add"));
addButton.setOnAction(event -> {
getControl().getKeyAttributes().add(new KeyAttributeList.KeyAttributePair("key", "new value"));
Optional.ofNullable(getControl().getOnChange()).ifPresent(consumer -> consumer.accept(getControl().getAttributeMap()));
});
final Button removeButton = new Button(tr("Remove"));
removeButton.setOnAction(event -> {
final List<KeyAttributeList.KeyAttributePair> selectedItems = table.getSelectionModel().getSelectedItems();
getControl().getKeyAttributes().removeAll(selectedItems);
Optional.ofNullable(getControl().getOnChange()).ifPresent(consumer -> consumer.accept(getControl().getAttributeMap()));
});
final HBox buttonContainer = new HBox(addButton, removeButton);
buttonContainer.setAlignment(Pos.CENTER_RIGHT);
getControl().onChangeProperty().addListener((Observable invalidation) -> updateChildren(table, buttonContainer));
updateChildren(table, buttonContainer);
}
use of javafx.beans.Observable in project POL-POM-5 by PlayOnLinux.
the class SidebarGroupSkin method initialise.
/**
* {@inheritDoc}
*/
@Override
public void initialise() {
final Label title = createTitleLabel();
// ensure that the title label is only shown when it contains a nonempty string
title.textProperty().addListener((Observable invalidation) -> updateTitleLabelVisibility(title));
// ensure that the title label is correctly shown during initialisation
updateTitleLabelVisibility(title);
VBox container = new VBox();
container.getStyleClass().add("sidebarInside");
Bindings.bindContent(container.getChildren(), components);
getChildren().addAll(container);
}
use of javafx.beans.Observable in project POL-POM-5 by PlayOnLinux.
the class EngineInformationPanelSkin method initialise.
/**
* {@inheritDoc}
*/
@Override
public void initialise() {
final GridPane informationContentPane = new GridPane();
informationContentPane.getStyleClass().add("grid");
engineUserData.addListener((Observable invalidation) -> updateUserData(informationContentPane));
updateUserData(informationContentPane);
final HBox buttonBox = createEngineButtons();
final Region informationContentSpacer = new Region();
informationContentSpacer.getStyleClass().add("engineSpacer");
final Region buttonBoxSpacer = new Region();
buttonBoxSpacer.getStyleClass().add("engineSpacer");
final VBox container = new VBox(informationContentPane, informationContentSpacer, buttonBox, buttonBoxSpacer);
getChildren().add(container);
}
use of javafx.beans.Observable in project POL-POM-5 by PlayOnLinux.
the class IconsListElementSkin method createMiniature.
/**
* Creates a region with the miniature of the list element
*
* @return A region with the miniature of the list element
*/
private Region createMiniature() {
final Region miniature = new Region();
miniature.getStyleClass().add("iconListMiniatureImage");
miniature.styleProperty().bind(Bindings.createStringBinding(() -> String.format("-fx-background-image: url(\"%s\");", getControl().getMiniatureUri().toString()), getControl().miniatureUriProperty()));
final Tooltip tooltip = new Tooltip();
tooltip.textProperty().bind(getControl().titleProperty());
Tooltip.install(miniature, tooltip);
// set a gray filter for this element if it is not enabled
getControl().enabledProperty().addListener((Observable invalidation) -> updateEnabled(miniature));
// adopt the enable status during initialisation
updateEnabled(miniature);
return miniature;
}
Aggregations