拆分模块

This commit is contained in:
2025-09-03 20:56:44 +08:00
parent 08cc2c29a5
commit a2f5e4864b
939 changed files with 14227 additions and 9607 deletions

View File

@@ -0,0 +1,40 @@
package com.ecep.contract.util;
import org.controlsfx.control.ToggleSwitch;
import javafx.beans.property.Property;
import javafx.util.StringConverter;
import javafx.util.converter.BooleanStringConverter;
public class BooleanConfig extends AbstractConfigBounder<Boolean> {
public BooleanConfig(String key) {
super(key);
}
@Override
public ToggleSwitch getControl() {
return (ToggleSwitch) super.getControl();
}
@Override
public StringConverter<Boolean> getConverter() {
StringConverter<Boolean> converter = super.getConverter();
if (converter == null) {
converter = new BooleanStringConverter();
setConverter(converter);
}
return converter;
}
@Override
protected Property<Boolean> createProperty(Boolean value) {
// fixbug when value is null
value = value == null ? false : value;
return super.createProperty(value);
}
@Override
void bindBidirectional(Property<Boolean> property) {
getControl().selectedProperty().bindBidirectional(property);
}
}