public void bind() { this.componentValueChangeSubscription = component.addValueChangeListener(this::componentValueChanged); this.sourceValueChangeSubscription = source.addValueChangeListener(this::sourceValueChanged); this.sourceStateChangeSubscription = source.addStateChangeListener(this::valueSourceStateChanged); if (source instanceof EntityValueSource) { this.sourceInstanceChangeSubscription = ((EntityValueSource<Entity, V>) source).addInstanceChangeListener(this::sourceInstanceChanged); } }
protected void bindValueSourceEvents() { if (valueSource == null) { return; } if (valueSource instanceof BeanLocatorAware) { ((BeanLocatorAware) valueSource).setBeanLocator(beanLocator); } valueChangeSubscription = valueSource.addValueChangeListener(event -> updateComponent()); if (valueSource instanceof EntityValueSource) { instanceChangeSubscription = ((EntityValueSource<Entity, FileDescriptor>) valueSource) .addInstanceChangeListener(event -> updateComponent()); } }