private void configureButtonsActivation() { BooleanBinding noItemSelected = list.getSelectionModel().selectedItemProperty().isNull(); IntegerExpression selectedItemIndex = list.getSelectionModel().selectedIndexProperty(); BooleanBinding selectedItemIsUsed = selectedItemIndex.isEqualTo(itemInUseIndex); BooleanBinding selectedItemIsFirst = list.getSelectionModel().selectedIndexProperty().isEqualTo(0); IntegerExpression lastIndex = Bindings.createIntegerBinding(() -> list.getItems().size() - 1, list.itemsProperty()); BooleanBinding selectedItemIsLast = list.getSelectionModel().selectedIndexProperty().isEqualTo(lastIndex); addButton.disableProperty().bind(isNewItemTextValid().not()); duplicateButton.disableProperty().bind(noItemSelected); removeButton.disableProperty().bind(noItemSelected.or(selectedItemIsUsed)); moveUpButton.disableProperty().bind(noItemSelected.or(selectedItemIsFirst)); moveDownButton.disableProperty().bind(noItemSelected.or(selectedItemIsLast)); }
@Test public void testIntegerExpression(){ final IntegerExpression actual = IntegerExpression.integerExpression(new SimpleIntegerProperty(12)); assertThat(actual).hasValue(12); assertThat(actual).hasSameValue(actual); }
public static BooleanBinding lastItemIsSelected(TableView<?> tableView) { IntegerExpression lastIndex = Bindings.createIntegerBinding(() -> tableView.getItems().size() - 1, tableView.itemsProperty()); return tableView.getSelectionModel().selectedIndexProperty().isEqualTo(lastIndex); }
public static IntegerExpression collectionSize(ObservableList list) { SimpleIntegerProperty ret = new SimpleIntegerProperty(list.size()); list.addListener((ListChangeListener) change -> ret.set(list.size())); return ret; }
public IntegerExpression getObservableStringCount() { return stringCount; }
public IntegerExpression getObservableObjectCount() { return objectCount; }
public IntegerExpression getObservableNumberCount() { return numberCount; }
public IntegerExpression getObservableTaskIdCount() { return taskIdCount; }
public IntegerExpression getObservableNidCount() { return nidCount; }