use of javafx.beans.binding.BooleanBinding in project cryptomator by cryptomator.
the class InitializeController method initialize.
@Override
public void initialize() {
BooleanBinding passwordIsEmpty = passwordField.textProperty().isEmpty();
BooleanBinding passwordsDiffer = passwordField.textProperty().isNotEqualTo(retypePasswordField.textProperty());
okButton.disableProperty().bind(passwordIsEmpty.or(passwordsDiffer));
passwordStrength.bind(EasyBind.map(passwordField.textProperty(), strengthRater::computeRate));
passwordStrengthLevel0.backgroundProperty().bind(EasyBind.combine(passwordStrength, new SimpleIntegerProperty(0), strengthRater::getBackgroundWithStrengthColor));
passwordStrengthLevel1.backgroundProperty().bind(EasyBind.combine(passwordStrength, new SimpleIntegerProperty(1), strengthRater::getBackgroundWithStrengthColor));
passwordStrengthLevel2.backgroundProperty().bind(EasyBind.combine(passwordStrength, new SimpleIntegerProperty(2), strengthRater::getBackgroundWithStrengthColor));
passwordStrengthLevel3.backgroundProperty().bind(EasyBind.combine(passwordStrength, new SimpleIntegerProperty(3), strengthRater::getBackgroundWithStrengthColor));
passwordStrengthLevel4.backgroundProperty().bind(EasyBind.combine(passwordStrength, new SimpleIntegerProperty(4), strengthRater::getBackgroundWithStrengthColor));
passwordStrengthLabel.textProperty().bind(EasyBind.map(passwordStrength, strengthRater::getStrengthDescription));
}
use of javafx.beans.binding.BooleanBinding in project VocabHunter by VocabHunter.
the class WordStateHandler method prepareEditButtons.
public void prepareEditButtons() {
SimpleBooleanProperty editableProperty = sessionModel.editableProperty();
BooleanBinding resettableProperty = editableProperty.and(notEqual(WordState.UNSEEN, wordStateProperty));
buttonUnseen.visibleProperty().bind(resettableProperty);
buttonKnown.visibleProperty().bind(editableProperty);
buttonUnknown.visibleProperty().bind(editableProperty);
buttonUnseen.setOnAction(e -> processResponse(WordState.UNSEEN, false));
buttonKnown.setOnAction(e -> processResponse(WordState.KNOWN, true));
buttonUnknown.setOnAction(e -> processResponse(WordState.UNKNOWN, true));
}
use of javafx.beans.binding.BooleanBinding in project Gargoyle by callakrsos.
the class CheckoutController method initialize.
@FXML
public void initialize() {
// 기본경로 처리
txtCheckoutLocation.textProperty().set(getBaseDir());
txtCheckoutLocation.disabledProperty().addListener((oba, old, newv) -> btnBrowse.setDisable(newv));
// btnFinish 활성화/비활성화 처리를 담당한다.
BooleanBinding empty1 = txtProjectName.textProperty().isEmpty();
BooleanBinding empty2 = txtCheckoutLocation.textProperty().isEmpty();
btnFinishDisableBinding = empty1.or(empty2);
btnFinishDisableBinding.addListener((oba, old, newv) -> btnFinish.setDisable(newv));
txtProjectName.textProperty().bind(fileName);
/*
* checkout이 정상적으로 처리완료되거나 cancel버튼을 클릭한경우
* 행위를 기술한다.
*
* 디폴트값은 stage를 닫는다.
*/
onCloseAction.set(defaultCloseAction);
}
use of javafx.beans.binding.BooleanBinding in project cryptomator by cryptomator.
the class ChangePasswordController method initialize.
@Override
public void initialize() {
BooleanBinding oldPasswordIsEmpty = oldPasswordField.textProperty().isEmpty();
BooleanBinding newPasswordIsEmpty = newPasswordField.textProperty().isEmpty();
BooleanBinding passwordsDiffer = newPasswordField.textProperty().isNotEqualTo(retypePasswordField.textProperty());
changePasswordButton.disableProperty().bind(oldPasswordIsEmpty.or(newPasswordIsEmpty.or(passwordsDiffer)));
passwordStrength.bind(EasyBind.map(newPasswordField.textProperty(), strengthRater::computeRate));
passwordStrengthLevel0.backgroundProperty().bind(EasyBind.combine(passwordStrength, new SimpleIntegerProperty(0), strengthRater::getBackgroundWithStrengthColor));
passwordStrengthLevel1.backgroundProperty().bind(EasyBind.combine(passwordStrength, new SimpleIntegerProperty(1), strengthRater::getBackgroundWithStrengthColor));
passwordStrengthLevel2.backgroundProperty().bind(EasyBind.combine(passwordStrength, new SimpleIntegerProperty(2), strengthRater::getBackgroundWithStrengthColor));
passwordStrengthLevel3.backgroundProperty().bind(EasyBind.combine(passwordStrength, new SimpleIntegerProperty(3), strengthRater::getBackgroundWithStrengthColor));
passwordStrengthLevel4.backgroundProperty().bind(EasyBind.combine(passwordStrength, new SimpleIntegerProperty(4), strengthRater::getBackgroundWithStrengthColor));
passwordStrengthLabel.textProperty().bind(EasyBind.map(passwordStrength, strengthRater::getStrengthDescription));
}
Aggregations