Person(String firstName, String lastName, int age) { this.firstName = new SimpleStringProperty(firstName); this.lastName = new SimpleStringProperty(lastName); this.age = new SimpleIntegerProperty(age); }
private ChangeListener<String> setupSearchField(final JFXTreeTableView<TreeTableViewController.Person> tableView) { return (o, oldVal, newVal) -> tableView.setPredicate(personProp -> { final Person person = personProp.getValue(); return person.firstName.get().contains(newVal) || person.lastName.get().contains(newVal) || Integer.toString(person.age.get()).contains(newVal); }); }
private void setupEditableTableView() { setupCellValueFactory(firstNameEditableColumn, Person::firstNameProperty); setupCellValueFactory(lastNameEditableColumn, Person::lastNameProperty); setupCellValueFactory(ageEditableColumn, p -> p.age.asObject()); .getTreeItem(t.getTreeTablePosition() .getRow()) .getValue().age.set(t.getNewValue()); });
this.customValue = new SimpleIntegerProperty().asObject(); this.min = min; this.max = max;
public CANProperty(IntegerValue canValue, SimpleIntegerProperty property) { init((CT) canValue, (Property<T>) property); SimpleIntegerProperty avgProperty = new SimpleIntegerProperty(); this.setAvg((Property<T>)avgProperty ); avgProperty.addListener(new ChangeListener<Number>() { SimpleIntegerProperty maxProperty = new SimpleIntegerProperty(); this.setMax((Property<T>) maxProperty); maxProperty.addListener(new ChangeListener<Number>() {
public void setSubdivisionLevel(int subdivisionLevel) { subdivisionLevelProperty().set(subdivisionLevel); } public int getSubdivisionLevel() { return subdivisionLevelProperty == null ? 0 : subdivisionLevelProperty.get(); }
private void updateCount(int count) { if (Platform.isFxApplicationThread()) { int val = newElementsCount.get(); if (val < 0) { newElementsCount.set(count); } else { newElementsCount.set(val + count); } } else { Platform.runLater(() -> { int val = newElementsCount.get(); if (val < 0) { newElementsCount.set(count); } else { newElementsCount.set(val + count); } }); } } }
elementsCountProperty().addListener((ChangeListener<Number>) (observable, oldValue, newValue) -> { if (newValue.intValue() > 0) { itemsCount.textProperty().set("");
this.customValue = new SimpleIntegerProperty().asObject(); this.min = min; this.max = max;
public void hide() { if (dialogStage != null) { dispatchEvent(new HideDialogEvent(dialogStage)); Platform.runLater(() -> { SimpleIntegerProperty toto = new SimpleIntegerProperty(50); toto.addListener((ChangeListener<Number>) (observable, oldValue, newValue) -> { dialogStage.setWidth(dialogStage.getWidth() * (1 / newValue.doubleValue())); dialogStage.setHeight(dialogStage.getHeight() * (1 / newValue.doubleValue())); }); EasingInterpolator interpolator = new EasingInterpolator(EasingMode.SWING_FROM); final Timeline timeline = new Timeline(); KeyFrame kf = new KeyFrame(new Duration(200), new KeyValue(toto, 1, interpolator)); timeline.getKeyFrames().addAll(kf); timeline.setOnFinished(e -> dialogStage.hide()); timeline.play(); }); } }
@Override public void set(int newValue) { ((Script)getBean()).setProperty(getName(), newValue); super.set(newValue); }
elementsCountProperty().addListener((ChangeListener<Number>) (observable, oldValue, newValue) -> { if (newValue.intValue() > 0) { totalElementsCountLabel.textProperty().set("");
/** * Creates a new {@link IntegerField} with the given default value. * * @param defaultValue * The initial value and persistent value of the field. * * @return Returns a new {@link IntegerField}. */ public static IntegerField ofIntegerType(int defaultValue) { return new IntegerField(new SimpleIntegerProperty(defaultValue), new SimpleIntegerProperty(defaultValue)); }
public int getQueueSize() { return queueSize.get(); }
/** * @{inheritedDoc} */ @Override public void setData(MultipleResult multipleResult) { final int elementsCount = multipleResult.totaElements(); this.elementsCount.set(elementsCount); currentData = multipleResult; final boolean isFirst = multipleResult.getCurrentPageIndex() <= 0; if (pagination != null) { pagination.getDisplay().setVisible(true); } if (pagination != null && pagination.isLoadMorePagination() && !isFirst) { // items.clear(); } else { items.clear(); } items.addAll(multipleResult.getData()); }
@Override public void buildFrom(IEmaginController controller, VLViewComponentXML configuration) { this.configuration = configuration; this.controller = (AbstractViewController) controller; NodeHelper.loadFXML(getFxmlLocation(), this); filterTextField.managedProperty().bind(filterTextField.visibleProperty()); filterTextField.setVisible(false); filterTextField.setPromptText("Find in table"); if (configuration != null) { NodeHelper.setTitle(title, configuration, (AbstractViewController) controller, true); NodeHelper.styleClassSetAll(title, configuration, "titleStyleClass", "ep-edit-structure-title-label"); NodeHelper.styleClassAddAll(tableHeaderRootPane, configuration, "styleClass"); title.visibleProperty().bind(Bindings.isNotEmpty(title.textProperty())); elementsCountProperty().addListener((ChangeListener<Number>) (observable, oldValue, newValue) -> { if (newValue.intValue() > 0) { itemsCount.textProperty().set(""); } else { itemsCount.textProperty().set(String.format(dynMessageFormat, newValue.intValue())); } }); ((FullTableStructureController) controller).processedElementProperty().addListener((ChangeListener<Object>) (observable, oldValue, newValue) -> { final AbstractTableStructure ts = (AbstractTableStructure) ((FullTableStructureController) controller).processedElementProperty().get(); doLayout(ts); buildFiltering(ts); }); } }
@Nonnull public IntegerProperty valueIntegerProperty() { if (value == null) { value = new SimpleIntegerProperty(this, "value"); } return value; } }
public int getThreadCount() { return threadCount.get(); }
/** * @{inheritedDoc} */ @Override public void setData(MultipleResult multipleResult) { final int elementsCount = multipleResult.totaElements(); this.elementsCount.set(elementsCount); currentData = multipleResult; final boolean isFirst = multipleResult.getCurrentPageIndex() <= 0; if (pagination != null) { pagination.getDisplay().setVisible(true); } if (pagination != null && pagination.isLoadMorePagination() && !isFirst) { // clear items! } else { items.clear(); } items.addAll(multipleResult.getData()); tableView.pseudoClassStateChanged(PseudoClass.getPseudoClass("nocontent"), false); }
@Nonnull protected IntegerProperty writableBaseValueIntegerProperty() { if (baseValue == null) { baseValue = new SimpleIntegerProperty(this, "baseValue"); } return baseValue; }