Java 类javafx.beans.binding.BooleanExpression 实例源码

项目:Gargoyle    文件:AddNewSVNRepositoryController.java   
@FXML
public void initialize() {

    // lblUrl.textProperty().isNotEmpty() &&
    // txtUserId.textProperty().isNotEmpty() &&
    // lblUserPass.textProperty().isNotEmpty()

    BooleanExpression checkFieldsBinding = BooleanExpression.booleanExpression(lblUrl.textProperty().isNotEmpty())
            .and(txtUserId.textProperty().isNotEmpty()).and(lblUserPass.textProperty().isNotEmpty());

    // .booleanExpression(txtUserId.textProperty().isNotEmpty()).booleanExpression(lblUserPass.textProperty().isNotEmpty());
    isNotEmptyFields.bind(checkFieldsBinding);
    isNotEmptyFields.addListener(checkIsNotEmptyFieldChangeListener);

    chkEmptyUserAndPass.selectedProperty().addListener((oba, oldval, newval) -> {
        btnFinish.setDisable(!newval);
    });
}
项目:myWMS    文件:MyWMSEditor.java   
@SuppressWarnings("unchecked")
@Override
public void bind(EditorHelper e, String id, BasicEntityEditor node) {
    ObservableValue value = e.getValueProperty(id);
    Class type = e.getValueClass(id);

    if (BasicEntity.class.isAssignableFrom(type)) {
        node.configure(getContext(), type);
    }

    ObservableBooleanValue editable = e.getEditableProperty(id, value);
    ObservableBooleanValue visible = e.getVisibleProperty(id, value);

    StringConverter converter = e.getConverter(id, value);          
    if (converter != null) node.setConverter(converter);

    bindBidirectionalValue(node, node.valueProperty(), value);
    if (editable != null) node.disableProperty().bind(BooleanExpression.booleanExpression(editable).not());
    if (visible != null) node.visibleProperty().bind(visible);
    e.onBind(id, value, node);
}
项目:WhoWhatWhere    文件:GUIController.java   
/**Sets the text-color and background-color for valid and invalid text, and if {@code parentTab} isn't null, sets all <i>other</i> tabs to be disabled when the {@code fields} are invalid 
 * @param parentTab - the tab containing these {@code fields}
 * @param fields - the {@code NumberTextField}s to apply this on
 */
public void setNumberTextFieldsValidationUI(Tab parentTab, NumberTextField... fields)
{
    BooleanExpression andOfAllFields = new SimpleBooleanProperty(true);

    setNumberTextFieldValidationUI(fields);

    if (parentTab != null)
    {
        for (NumberTextField field: fields)
            andOfAllFields = andOfAllFields.and(field.getValidProperty());

        for (Tab tab : tabPane.getTabs())
            if (!tab.equals(parentTab))
            {
                BooleanExpression existingExpression = tabToBindExpression.get(tab);

                if (existingExpression != null)
                    andOfAllFields = andOfAllFields.and(existingExpression);

                tabToBindExpression.put(tab, andOfAllFields);
                tab.disableProperty().bind(andOfAllFields.not());                   
            }
    }
}
项目:ISAAC    文件:CommonMenus.java   
private static MenuItem createNewMenuItem(
        CommonMenuItem itemType, 
        CommonMenuBuilder builder, 
        BooleanSupplier canHandle, 
        BooleanExpression makeVisible,
        Runnable onHandlable) {
    return createNewMenuItem(itemType, builder, canHandle, makeVisible, onHandlable, null);
}
项目:ISAAC    文件:CommonMenus.java   
private static MenuItem createNewMenuItem(
        CommonMenuItem itemType, 
        CommonMenuBuilder builder, 
        BooleanSupplier canHandle, 
        BooleanExpression makeVisible,
        Runnable onHandlable,
        Runnable onNotHandleable) {

    if (builder.isCommonMenuItemExcluded(itemType))
    {
        return null;
    }
    MenuItem menuItem = new MenuItem(itemType.getText());
    menuItem.setGraphic(itemType.getImage().createImageView());
    menuItem.setOnAction(new EventHandler<ActionEvent>() {
        @Override
        public void handle(ActionEvent event)
        {
            if (canHandle.getAsBoolean())
            {
                onHandlable.run();
            } else {
                if (onNotHandleable != null) {
                    onNotHandleable.run();
                } else {
                    AppContext.getCommonDialogs().showInformationDialog("Invalid data selected for menu item \"" + itemType.getText() + "\"", "Can't invoke " + itemType.getText() + " for invalid data");
                }
            }
        }
    });

    menuItem.visibleProperty().bind(builder.getInvisibleWhenfalse() == null ? makeVisible : builder.getInvisibleWhenfalse().not().and(makeVisible));
    return menuItem;
}
项目:assertj-javafx    文件:BooleanTest.java   
@Test
public void testBooleanExpression(){
    final BooleanExpression actual = BooleanExpression.booleanExpression(new SimpleBooleanProperty(true));

    assertThat(actual).isTrue();

    assertThat(actual).hasSameValue(actual);
}
项目:ISAAC    文件:OperationNode.java   
protected BooleanExpression isReadyForExecution()
{
    return isOperationReady_; 
}
项目:ISAAC    文件:RoleRetire.java   
/**
 * @see gov.va.isaac.gui.listview.operations.Operation#isValid()
 */
@Override
public BooleanExpression isValid()
{
    return allValid_;
}
项目:ISAAC    文件:RoleAdd.java   
/**
 * @see gov.va.isaac.gui.listview.operations.Operation#isValid()
 */
@Override
public BooleanExpression isValid()
{
    return allValid_;
}
项目:ISAAC    文件:RefsetAddMember.java   
/**
 * @see gov.va.isaac.gui.listview.operations.Operation#isValid()
 */
@Override
public BooleanExpression isValid()
{
    return allValid_;
}
项目:ISAAC    文件:RoleReplaceValue.java   
/**
 * @see gov.va.isaac.gui.listview.operations.Operation#isValid()
 */
@Override
public BooleanExpression isValid()
{
    return allValid_;
}
项目:ISAAC    文件:LogicRetireUnionSet.java   
/**
 * @see gov.va.isaac.gui.listview.operations.Operation#isValid()
 */
@Override
public BooleanExpression isValid()
{
    return new SimpleBooleanProperty(true);
}
项目:ISAAC    文件:XmlExportOperation.java   
/**
 * @see gov.va.isaac.gui.listview.operations.Operation#isValid()
 */
@Override
public BooleanExpression isValid()
{
    return allFieldsValid;
}
项目:ISAAC    文件:UscrsExportOperation.java   
/**
 * @see gov.va.isaac.gui.listview.operations.Operation#isValid()
 */
@Override
public BooleanExpression isValid()
{
    return allFieldsValid;
}
项目:ISAAC    文件:EconceptExportOperation.java   
/**
 * @see gov.va.isaac.gui.listview.operations.Operation#isValid()
 */
@Override
public BooleanExpression isValid()
{
    return allFieldsValid;
}
项目:ISAAC    文件:RefsetMoveMember.java   
/**
 * @see gov.va.isaac.gui.listview.operations.Operation#isValid()
 */
@Override
public BooleanExpression isValid()
{
    return allValid_;
}
项目:ISAAC    文件:FindAndReplace.java   
/**
 * @see gov.va.isaac.gui.listview.operations.Operation#isValid()
 */
@Override
public BooleanExpression isValid()
{
    return frc_.allFieldsValid();
}
项目:ISAAC    文件:RefsetRetireMember.java   
/**
 * @see gov.va.isaac.gui.listview.operations.Operation#isValid()
 */
@Override
public BooleanExpression isValid()
{
    return allValid_;
}
项目:ISAAC    文件:LogicNegateRelationshipValue.java   
/**
 * @see gov.va.isaac.gui.listview.operations.Operation#isValid()
 */
@Override
public BooleanExpression isValid()
{
    return new SimpleBooleanProperty(true);
}
项目:ISAAC    文件:ParentRetire.java   
/**
 * @see gov.va.isaac.gui.listview.operations.Operation#isValid()
 */
@Override
public BooleanExpression isValid()
{
    return allValid_;
}
项目:ISAAC    文件:ParentReplace.java   
/**
 * @see gov.va.isaac.gui.listview.operations.Operation#isValid()
 */
@Override
public BooleanExpression isValid()
{
    return operationIsReady_;
}
项目:ISAAC    文件:SampleOperation.java   
/**
 * @see gov.va.isaac.gui.listview.operations.Operation#isValid()
 */
@Override
public BooleanExpression isValid()
{
    return new SimpleBooleanProperty(true);
}
项目:ISAAC    文件:LogicCreateUnionSet.java   
/**
 * @see gov.va.isaac.gui.listview.operations.Operation#isValid()
 */
@Override
public BooleanExpression isValid()
{
    return new SimpleBooleanProperty(true);
}
项目:ISAAC    文件:ParentAddNew.java   
/**
 * @see gov.va.isaac.gui.listview.operations.Operation#isValid()
 */
@Override
public BooleanExpression isValid()
{
    return newParent_.isValid();
}
项目:ISAAC    文件:RefsetReplaceValue.java   
/**
 * @see gov.va.isaac.gui.listview.operations.Operation#isValid()
 */
@Override
public BooleanExpression isValid()
{
    return allValid_;
}
项目:ISAAC    文件:LogicRetireDisjointSet.java   
/**
 * @see gov.va.isaac.gui.listview.operations.Operation#isValid()
 */
@Override
public BooleanExpression isValid()
{
    return new SimpleBooleanProperty(true);
}
项目:ISAAC    文件:LogicAddDisjointSet.java   
/**
 * @see gov.va.isaac.gui.listview.operations.Operation#isValid()
 */
@Override
public BooleanExpression isValid()
{
    return new SimpleBooleanProperty(true);
}
项目:jutility-javafx    文件:CellRangeGridPane.java   
/**
 * Creates a new instance of the {@code CellRangeGridPane} class with the
 * provided range restriction and initial value.
 *
 * @param validRange
 *            the range restriction.
 * @param initialValue
 *            the initial value.
 */
public CellRangeGridPane(final CellRange validRange,
        final CellRange initialValue) {

    super();

    this.setPadding(new Insets(5));

    this.setHgap(10);
    this.setVgap(10);

    this.invalid = new SimpleBooleanProperty();

    if (initialValue != null) {

        this.from = new CellLocationGridPane(validRange,
                initialValue.getBeginning());
        this.to = new CellLocationGridPane(validRange,
                initialValue.getEnd());
    }
    else {

        this.from = new CellLocationGridPane(validRange);
        this.to = new CellLocationGridPane(validRange);
    }
    this.invalid
            .bind(BooleanExpression.booleanExpression(
                    this.from.invalidProperty()).or(
                    BooleanExpression.booleanExpression(this.to
                            .invalidProperty())));


    final GridPane rangeBox = new GridPane();
    rangeBox.setHgap(10);

    final Label fromLabel = new Label("From:");
    GridPane.setMargin(fromLabel, new Insets(10));
    fromLabel
            .setStyle("-fx-font-family: sans-serif; -fx-font-style: italic;");
    final Label toLabel = new Label("To:");
    toLabel.setStyle("-fx-font-family: sans-serif; -fx-font-style: italic;");
    GridPane.setMargin(toLabel, new Insets(10));


    fromLabel.setLabelFor(this.from);
    toLabel.setLabelFor(this.to);


    rangeBox.add(fromLabel, 0, 0);
    rangeBox.add(this.from, 1, 0, 1, 2);


    rangeBox.add(toLabel, 0, 3);
    rangeBox.add(this.to, 1, 3, 1, 2);

    String rangeLabelText = "Range";

    if (validRange != null) {

        rangeLabelText += " (valid within " + validRange + ")";
    }
    rangeLabelText += ":";

    final Label rangeLabel = new Label(rangeLabelText);
    rangeLabel
            .setStyle("-fx-font-family: sans-serif; -fx-font-weight: bold;");
    rangeLabel.setLabelFor(rangeBox);


    this.add(rangeLabel, 0, 0);
    this.add(rangeBox, 0, 1);
}
项目:ISAAC    文件:Operation.java   
/**
 * Implementers should return a BooleanExpression which evaluates to true when all necessary values
 * for task execution have been provided.
 */
public abstract BooleanExpression isValid();