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

org.panteleyev.fx.combobox.ComboBoxImpl Maven / Gradle / Ivy

The newest version!
/*
 Copyright © 2020 Petr Panteleyev 
 SPDX-License-Identifier: BSD-2-Clause
 */
package org.panteleyev.fx.combobox;

import javafx.collections.ObservableList;
import javafx.scene.control.ComboBox;

/**
 * This class implements ComboBox that renders default string for null value.
 *
 * @param  type of the element
 */
class ComboBoxImpl extends ComboBox {
    private final String defaultString;

    public ComboBoxImpl(ObservableList list, String defaultString) {
        super(list);
        this.defaultString = defaultString;
    }

    public String getDefaultString() {
        return defaultString;
    }

    public void renderDefaultValue() {
        getButtonCell().setText(getDefaultString());
    }
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy