List of usage examples for java.beans PropertyChangeListenerProxy getPropertyName
public String getPropertyName()
From source file:org.jtrfp.trcl.flow.IndirectProperty.java
private void connectAllTo(PROPERTY_TYPE tgt) { for (PropertyChangeListener l : targetPCS.getPropertyChangeListeners()) { if (l instanceof PropertyChangeListenerProxy) { final PropertyChangeListenerProxy proxy = (PropertyChangeListenerProxy) l; try { tgt.getClass()/*from w w w . j a va 2 s . c o m*/ .getMethod("addPropertyChangeListener", String.class, PropertyChangeListener.class) .invoke(tgt, proxy.getPropertyName(), proxy); } catch (Exception e) { e.printStackTrace(); } } else { try { tgt.getClass().getMethod("addPropertyChangeListener", PropertyChangeListener.class).invoke(tgt, l); } catch (Exception e) { e.printStackTrace(); } } } //end for(listener) }
From source file:org.jtrfp.trcl.flow.IndirectProperty.java
private void fireAllPropertiesChanged() { PROPERTY_TYPE target = this.target.get(); if (target == null) return;/* w w w . j a v a 2s . co m*/ HashSet<String> propertiesToFireChanged = new HashSet<String>(); PropertyChangeListener[] listeners = targetPCS.getPropertyChangeListeners(); for (PropertyChangeListener l : listeners) { if (l instanceof PropertyChangeListenerProxy) { final PropertyChangeListenerProxy prox = (PropertyChangeListenerProxy) l; propertiesToFireChanged.add(prox.getPropertyName()); } //end if(...) } //end for(listener) for (String propertyName : propertiesToFireChanged) { try { targetPCS.firePropertyChange(propertyName, null, PropertyUtils.getProperty(target, propertyName)); } catch (NoSuchMethodException e) { e.printStackTrace(); } catch (InvocationTargetException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } } //end for(propertyNames) }