@Override public void initialize(URL location, ResourceBundle resources) { BooleanBinding noSelection = fileListView.getSelectionModel().selectedItemProperty().isNull(); removeFileButton.disableProperty().bind(noSelection); moveItemUpButton.disableProperty().bind(noSelection.or(fileListView.getSelectionModel().selectedIndexProperty().isEqualTo(0))); // we can't just map the val because we need an ObservableNumberValue IntegerBinding lastIndexBinding = Bindings.createIntegerBinding(() -> fileListView.getItems().size() - 1, Val.wrap(fileListView.itemsProperty()).flatMap(LiveList::sizeOf)); moveItemDownButton.disableProperty().bind(noSelection.or(fileListView.getSelectionModel().selectedIndexProperty().isEqualTo(lastIndexBinding))); fileListView.setCellFactory(DesignerUtil.simpleListCellFactory(File::getName, File::getAbsolutePath)); selectFilesButton.setOnAction(e -> onSelectFileClicked()); removeFileButton.setOnAction(e -> onRemoveFileClicked()); moveItemUpButton.setOnAction(e -> moveUp()); moveItemDownButton.setOnAction(e -> moveDown()); }
@Override public void initialize() { super.initialize(); listView.itemsProperty().bind(new ReadOnlyListWrapper<>(timelineBase.loadedTweets())); }
public void setPal(final User pal) { LOG.debug("Messages for [{}] loaded!", pal.getScreenName()); this.currentPal.setValue(pal); listView.itemsProperty().bind(new ReadOnlyListWrapper<>(directMessages.directMessages().get(pal))); }
@Override public void initialize() { super.initialize(); LOG.debug("Loading credits..."); listView.itemsProperty().bind(new ReadOnlyListWrapper<>(creditsService.creditedWorks())); bindButtonToOpenHrefEnvProperty(licenseButton, "credits.license"); bindButtonToOpenHrefEnvProperty(sourceCodeButton, "credits.sourceCode"); bindButtonToOpenHrefEnvProperty(knownIssuesButton, "credits.knownIssues"); displayApplicationAuthor(); }
private void updateButtons() { moveToTarget.getStyleClass().add("move-to-target-button"); moveToTargetAll.getStyleClass().add("move-to-target-all-button"); moveToSource.getStyleClass().add("move-to-source-button"); moveToSourceAll.getStyleClass().add("move-to-source-all-button"); moveToTarget.setMaxWidth(Double.MAX_VALUE); moveToTargetAll.setMaxWidth(Double.MAX_VALUE); moveToSource.setMaxWidth(Double.MAX_VALUE); moveToSourceAll.setMaxWidth(Double.MAX_VALUE); getSourceListView().itemsProperty().addListener( it -> bindMoveAllButtonsToDataModel()); getTargetListView().itemsProperty().addListener( it -> bindMoveAllButtonsToDataModel()); getSourceListView().selectionModelProperty().addListener( it -> bindMoveButtonsToSelectionModel()); getTargetListView().selectionModelProperty().addListener( it -> bindMoveButtonsToSelectionModel()); bindMoveButtonsToSelectionModel(); bindMoveAllButtonsToDataModel(); moveToTarget.setOnAction(evt -> moveToTarget()); moveToTargetAll.setOnAction(evt -> moveToTargetAll()); moveToSource.setOnAction(evt -> moveToSource()); moveToSourceAll.setOnAction(evt -> moveToSourceAll()); }