@Override public void addListener(InvalidationListener listener) { delegate.addListener(listener); }
@Override public void addListener(InvalidationListener listener) { if (listener instanceof UIThreadAware) { getDelegate().addListener(listener); } else { getDelegate().addListener(new UIThreadAwareInvalidationListener(listener)); } }
@Override public void addListener(ChangeListener<? super T> listener) { if (listener instanceof UIThreadAware) { getDelegate().addListener(listener); } else { getDelegate().addListener(new UIThreadAwareChangeListener<>(listener)); } }
/** * {@inheritDoc} */ public void setBindingMode(BindingMode newValue) { if (BindingMode.CONTINUOUS.equals(newValue)) { value.addListener(bindingModeListener); } else { value.removeListener(bindingModeListener); } }
public void afterChange(T newSource, P oldValue) { targetProperty = newSource != null ? targetPropertyGetter.getProperty(newSource) : null; P newValue = targetProperty != null ? targetProperty.getValue() : null; if (targetProperty != null) { targetProperty.addListener(targetChangeListener); targetProperty.addListener(targetInvalidationListener); if (newValue != oldValue) { targetInvalidationListener.invalidated(ChainedProperty.this); targetChangeListener.changed(ChainedProperty.this, oldValue, newValue); } } }
protected void bindFieldBidirectionalToNumberProperty(Property<? extends Number> property, Field field) { NumberBidirectionalBind binding = new NumberBidirectionalBind(property, field); setNumberValue(property, field); property.addListener(binding); field.addListener(binding); }
public <T> void bindBidirectionalModule(Topic<T> topic, Property<T> property) { MessageBidirectionalBinding<T, T> bind = MessageBidirectionalBinding.createSingleTypedBinding(messageContent -> submitMessageToModule(topic, messageContent), property); property.addListener(bind); reaMessagerToModule.registerTopicListener(topic, bind); }
protected void bindFieldBidirectionalToConditionalNumberProperty(Condition condition, Property<? extends Number> property, Field field) { ConditionalNumberBidirectionalBind binding = new ConditionalNumberBidirectionalBind(condition, property, field); setNumberValue(property, field); property.addListener(binding); field.addListener(binding); }
private void monitorChanges() { properties.addListener((ListChangeListener<Property>) change -> { while (change.next()) { if (change.wasAdded()) change.getAddedSubList().forEach(p -> p.addListener(dirtyListener)); if (change.wasRemoved()) change.getRemoved().forEach(p -> p.removeListener(dirtyListener)); } }); }
public <M, P> void bindBidirectionalGlobal(Topic<M> topic, Property<P> property, PropertyToMessageTypeConverter<M, P> converterToMessageType) { MessageBidirectionalBinding<M, P> bind = new MessageBidirectionalBinding<>(messageContent -> broadcastMessage(topic, messageContent), property, converterToMessageType); property.addListener(bind); internalMessager.registerTopicListener(topic, bind); reaMessagerToModule.registerTopicListener(topic, bind); }
@Override public void initialize() { if (statusProp.getValue() != null) { statusReady(); } statusProp.addListener((observable, oldValue, newValue) -> statusReady()); VBox.setVgrow(tweetContent, Priority.ALWAYS); }
public <T> void bindBidirectionalInternal(Topic<T> topic, Property<T> property, boolean pushValue) { MessageBidirectionalBinding<T, T> bind = MessageBidirectionalBinding.createSingleTypedBinding(messageContent -> submitMessageInternal(topic, messageContent), property); property.addListener(bind); internalMessager.registerTopicListener(topic, bind); if (pushValue) internalMessager.submitMessage(topic, property.getValue()); }
@Override public <T> Binding bidirectionalTo(final Property<T> property, BidirectionalConverter<T, S> converter) { final Binding unidirectionalBinding = to(property, converter); final ChangeListener<S> listener = (obs, oldVal, newVal) -> property.set(converter.convertBack(newVal)); javaFxProperty.addListener(listener); return () -> { javaFxProperty.removeListener(listener); unidirectionalBinding.unbind(); }; }
@Override public <T> Binding bidirectionalTo(final Property<T> property, BidirectionalConverter<T, Number> converter) { final Binding unidirectionalBinding = to(property, converter); final ChangeListener<Number> listener = (obs, oldVal, newVal) -> property.set(converter.convertBack(newVal)); javaFxProperty.addListener(listener); return () -> { javaFxProperty.removeListener(listener); unidirectionalBinding.unbind(); }; }
@Override public <T> Binding bidirectionalTo(final Property<T> property, BidirectionalConverter<T, Number> converter) { final Binding unidirectionalBinding = to(property, converter); final ChangeListener<Number> listener = (obs, oldVal, newVal) -> property.set(converter.convertBack(newVal)); javaFxProperty.addListener(listener); return () -> { javaFxProperty.removeListener(listener); unidirectionalBinding.unbind(); }; }
@Override public <T> Binding bidirectionalToNumeric(final Property<T> property, final BidirectionalConverter<T, S> converter) { final Binding unidirectionalBinding = to(property, converter); final ChangeListener<Number> listener = (obs, oldVal, newVal) -> property.set(converter.convertBack(convertNumber(newVal))); javaFxProperty.addListener(listener); return () -> { javaFxProperty.removeListener(listener); unidirectionalBinding.unbind(); }; } }
@Override public void initialize() { notificationPane.visibleProperty().bind(shouldDisplay); notificationPane.managedProperty().bind(shouldDisplay); notificationPane.setOnMouseClicked(e -> shouldDisplay.setValue(false)); notificationContent.textProperty().addListener((observable, oldValue, newValue) -> { notificationContent.visibleProperty().setValue(!newValue.isEmpty()); notificationContent.managedProperty().setValue(!newValue.isEmpty()); }); LOG.debug("Starting internal notification system. Listening on new notification requests."); internalNotificationSystem.notificationProperty().addListener((o, prev, cur) -> this.handleChange(cur)); }
public <M, P> void bindBidirectionalInternal(Topic<M> topic, Property<P> property, PropertyToMessageTypeConverter<M, P> converterToMessageType, boolean pushValue) { MessageBidirectionalBinding<M, P> bind = new MessageBidirectionalBinding<>(messageContent -> submitMessageInternal(topic, messageContent), property, converterToMessageType); property.addListener(bind); internalMessager.registerTopicListener(topic, bind); if (pushValue) internalMessager.submitMessage(topic, converterToMessageType.convert(property.getValue())); }
@Override public void initialize() { LOG.debug("New tweet stage ready."); enableTweetLengthCheck(); Buttons.setOnClick(sendButton, this::send); Buttons.setOnClick(pickMediaButton, this::openMediaAttachmentsFilePicker); final BooleanBinding mediasNotEmpty = mediasToUpload.emptyProperty().not(); mediaPreviewBox.visibleProperty().bind(mediasNotEmpty); mediaPreviewBox.managedProperty().bind(mediasNotEmpty); inReplyStatus.addListener((o, prev, cur) -> prefillMentionsForReply()); sendOnControlEnter(); }
@Override public void initialize() { setUpInteractionActions(); targetStatus.addListener((o, prev, cur) -> { updateRetweetVisual(cur.isRetweet() ? cur.getRetweetedStatus().isRetweeted() : cur.isRetweeted()); updateLikeVisual(cur.isFavorited()); }); }