private void setScaleDataSource(Property<Double> scale) { // Listens the new data source if possible if (scale != null && Property.ValueChangeNotifier.class .isAssignableFrom(scale.getClass())) { ((Property.ValueChangeNotifier) scale).addValueChangeListener(this); } }
if (p instanceof Property.ValueChangeNotifier) { ((Property.ValueChangeNotifier) p) .addValueChangeListener( getCaptionChangeListener()); captionChangeNotifiers.add(p); if (p instanceof Property.ValueChangeNotifier) { ((Property.ValueChangeNotifier) p) .addValueChangeListener(getCaptionChangeListener()); captionChangeNotifiers.add(p); if (p instanceof Property.ValueChangeNotifier) { ((Property.ValueChangeNotifier) p) .addValueChangeListener(getCaptionChangeListener()); captionChangeNotifiers.add(p);
/** * Registers a new value change listener for this Property. * * @param listener the new Listener to be registered * @return this (for method chaining) */ public default S withValueChangeListener( Property.ValueChangeListener listener) { ((ValueChangeNotifier) this).addValueChangeListener(listener); return (S) this; }
@Override public void addValueChangeListener(ValueChangeListener listener) { if (itemProperty instanceof ValueChangeNotifier) { ((ValueChangeNotifier) itemProperty).addValueChangeListener(listener); } }
/** * Attaches listeners to the container so container events can be processed */ private void listenToContainerEvents() { if (container instanceof ItemSetChangeNotifier) { ((ItemSetChangeNotifier) container).addItemSetChangeListener(this); } if (container instanceof ValueChangeNotifier) { ((ValueChangeNotifier) container).addValueChangeListener(this); } }
private void internalAddColumns(Collection<Column> addedColumns) { for (final Column column : addedColumns) { final Property<?> property = item .getItemProperty(column.getPropertyId()); if (property instanceof ValueChangeNotifier) { ((ValueChangeNotifier) property) .addValueChangeListener(this); } } }
public TransactionalPropertyWrapper(Property<T> wrappedProperty) { this.wrappedProperty = wrappedProperty; if (wrappedProperty instanceof ValueChangeNotifier) { ((ValueChangeNotifier) wrappedProperty) .addValueChangeListener(listener); } }