All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.dlsc.gemsfx.skins.DurationPickerPopupView Maven / Gradle / Ivy

There is a newer version: 2.67.0
Show newest version
package com.dlsc.gemsfx.skins;

import com.dlsc.gemsfx.DurationPicker;
import javafx.scene.layout.HBox;

import java.util.Objects;

public class DurationPickerPopupView extends HBox {

    public DurationPickerPopupView(DurationPicker picker) {
        getStyleClass().add("duration-picker-popup-view");

        com.dlsc.pickerfx.DurationPicker durationPicker = new com.dlsc.pickerfx.DurationPicker() {
            @Override
            public String getUserAgentStylesheet() {
                return Objects.requireNonNull(DurationPicker.class.getResource("duration-picker.css")).toExternalForm();
            }
        };

        durationPicker.valueProperty().bindBidirectional(picker.durationProperty());
        durationPicker.maximumDurationProperty().bind(picker.maximumDurationProperty());
        durationPicker.minimumDurationProperty().bind(picker.minimumDurationProperty());
        durationPicker.fieldsProperty().bind(picker.fieldsProperty());
        getChildren().add(durationPicker);

        getStylesheets().add(getUserAgentStylesheet());
    }

    @Override
    public String getUserAgentStylesheet() {
        return Objects.requireNonNull(DurationPicker.class.getResource("duration-picker.css")).toExternalForm();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy