de.factoryfx.javafx.data.util.CheckComboBoxHelper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of javafxDataEditing Show documentation
Show all versions of javafxDataEditing Show documentation
factoryfx dependency injection framework
The newest version!
package de.factoryfx.javafx.data.util;
import java.util.function.Consumer;
import javafx.beans.value.ChangeListener;
import javafx.scene.control.ComboBox;
import javafx.scene.control.Skin;
import org.controlsfx.control.CheckComboBox;
import impl.org.controlsfx.skin.CheckComboBoxSkin;
public class CheckComboBoxHelper {
//workaround: http://stackoverflow.com/questions/25177523/how-to-listen-to-open-close-events-of-a-checkcombobox
public static void addOpenCloseListener(CheckComboBox comboBox, Consumer> listener){
comboBox.skinProperty().addListener((ChangeListener) (skinObs, oldVal, newVal) -> {
if (oldVal == null && newVal != null) {
CheckComboBoxSkin skin = (CheckComboBoxSkin) newVal;
ComboBox combo = (ComboBox) skin.getChildren().get(0);
combo.showingProperty().addListener((obs, hidden, showing) -> listener.accept(comboBox));
}
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy