private DateCell createDayCell() { DateCell dayCell = null; // call cell factory if set by the user if (datePicker.getDayCellFactory() != null) { dayCell = datePicker.getDayCellFactory().call(datePicker); } // else create the defaul day cell if (dayCell == null) { dayCell = new DateCell(); } return dayCell; }
private void addChildrenListener(RecursiveTreeObject<T> value) { final ObservableList<T> children = childrenFactory.call(value); originalItems = FXCollections.observableArrayList(); itemsMap = new HashMap<>();
private void refreshSliderValueBinding() { sliderValue.textProperty().unbind(); if (((JFXSlider) getSkinnable()).getValueFactory() != null) { sliderValue.textProperty() .bind(((JFXSlider) getSkinnable()).getValueFactory().call((JFXSlider) getSkinnable())); } else { sliderValue.textProperty().bind(Bindings.createStringBinding(() -> { if (getSkinnable().getLabelFormatter() != null) { return getSkinnable().getLabelFormatter().toString(getSkinnable().getValue()); } else { return String.valueOf(Math.round(getSkinnable().getValue())); } }, getSkinnable().valueProperty())); } }
callback.call(null); translateTo = 0; translateTimer.setOnFinished(() -> {
long valid = 0; for (int i = 0; i < callBacks.size(); i++) { if (!callBacks.get(i).call(null)) { valid++;
@Override public TableCell<Person, Boolean> call(TableColumn<Person, Boolean> column) { TableCell<Person, Boolean> cell = cellFactory.call(column); return cell; } });
/** * Call handler function when callback returns true. * * @param callback condition to evaluate * @param handler handler method to call not taking any parameter * * @return the {@link EventHandler} using the condition and the function to call */ default <E extends Event> EventHandler<E> handleIf(final Callback<E, Boolean> callback, final Runnable handler) { return event -> { if (callback.call(event)) { handler.run(); } }; }
/** * Attempts to return a value for the given Node. This is done by checking * the map of value extractors, contained within this class. This * map contains value extractors for common UI controls, but more extractors * can be added by calling {@link #addObservableValueExtractor(Predicate, Callback)}. * * @param n The node from whom a value will hopefully be extracted. * @return The value of the given node. */ public static Object getValue(Node n) { for( NodeValueExtractor nve: valueExtractors ) { if ( nve.applicability.test(n)) return nve.extraction.call(n); } return null; } }
@Nonnull @Override @SuppressWarnings("unchecked") public <E, T> TableCell<E, T> createTableCell(@Nonnull TableColumn<E, T> tableColumn) { return (TableCell<E, T>) TextFieldTableCell.forTableColumn().call((TableColumn<Object, String>) tableColumn); } };
/**{@inheritDoc}*/ @Override protected boolean isMatch(T suggestion, ISuggestionRequest request) { String userTextLower = request.getUserText().toLowerCase(); String suggestionStr = stringConverter.call(suggestion).toLowerCase(); return suggestionStr.contains(userTextLower); } }
/** * Call handler function when callback returns true. * * @param callback condition to evaluate * @param handler handler method to call taking the {@link Event} as parameter * * @return the {@link EventHandler} using the condition and the function to call */ default <E extends Event> EventHandler<E> handleIf(final Callback<E, Boolean> callback, final EventHandler<E> handler) { return event -> { if (callback.call(event)) { handler.handle(event); } }; }
/** * Handle the triggered event. */ @Override public void handle(final E event) { if (callback == null || callback.call(event)) { model().sendWave(waveType, waveData); } } });
@Override public ListCell<T> call(ListView<T> listView) { ListCell<T> cell = cellFactory == null ? new DefaultListCell<T>() : cellFactory.call(listView); cell.setContextMenu(contextMenu); return cell; } };
@Override public ListCell<T> call(ListView<T> listView) { ListCell<T> cell = cellFactory == null ? new DefaultListCell<T>() : cellFactory.call(listView); cell.setContextMenu(contextMenu); return cell; } };
@Override public ListCell<T> call(ListView<T> listView) { ListCell<T> cell = cellFactory == null ? new DefaultListCell<T>() : cellFactory.call(listView); cell.setContextMenu(contextMenu); return cell; } };
private Button createCrumb( final Callback<TreeItem<T>, Button> factory, final TreeItem<T> selectedCrumb) { Button crumb = factory.call(selectedCrumb); crumb.getStyleClass().add("crumb"); //$NON-NLS-1$ // We want all buttons to have the same height // so we bind their preferred height to the enclosing container // crumb.prefHeightProperty().bind(getSkinnable().heightProperty()); // listen to the action event of each bread crumb crumb.setOnAction(ae -> onBreadCrumbAction(selectedCrumb)); return crumb; }
private DateCell createDayCell() { DateCell dayCell = null; // call cell factory if set by the user if (datePicker.getDayCellFactory() != null) { dayCell = datePicker.getDayCellFactory().call(datePicker); } // else create the defaul day cell if (dayCell == null) { dayCell = new DateCell(); } return dayCell; }