/** * Test that we need to do our own equals() work to manually unwrap an arbitrary number of * proxies. */ public void testRemoveWithProxies() { Object bean = new Object(); PropertyChangeSupport support = new PropertyChangeSupport(bean); EventLog all = new EventLog(); support.addPropertyChangeListener(all); assertEquals(1, support.getPropertyChangeListeners().length); EventLog proxiedA = new EventLog(); support.addPropertyChangeListener(new PropertyChangeListenerProxy("a", proxiedA)); assertEquals(2, support.getPropertyChangeListeners().length); EventLog addA = new EventLog(); support.addPropertyChangeListener("a", addA); assertEquals(3, support.getPropertyChangeListeners().length); EventLog addAProxiedB = new EventLog(); support.addPropertyChangeListener("a", new PropertyChangeListenerProxy("b", addAProxiedB)); assertEquals(4, support.getPropertyChangeListeners().length); EventLog proxiedAB = new EventLog(); PropertyChangeListenerProxy proxyAB = new PropertyChangeListenerProxy("a", new PropertyChangeListenerProxy("b", proxiedAB)); support.addPropertyChangeListener(proxyAB); assertEquals(5, support.getPropertyChangeListeners().length); EventLog proxiedAAC = new EventLog(); support.addPropertyChangeListener( new PropertyChangeListenerProxy( "a", new PropertyChangeListenerProxy( "a", new PropertyChangeListenerProxy("c", proxiedAAC)))); assertEquals(6, support.getPropertyChangeListeners().length); support.removePropertyChangeListener(all); assertEquals(5, support.getPropertyChangeListeners().length); support.removePropertyChangeListener("a", proxiedA); assertEquals(4, support.getPropertyChangeListeners().length); support.removePropertyChangeListener(new PropertyChangeListenerProxy("a", addA)); assertEquals(3, support.getPropertyChangeListeners().length); support.removePropertyChangeListener("a", new PropertyChangeListenerProxy("b", addAProxiedB)); assertEquals(2, support.getPropertyChangeListeners().length); support.removePropertyChangeListener(proxyAB); assertEquals(1, support.getPropertyChangeListeners().length); support.removePropertyChangeListener(proxiedAAC); support.removePropertyChangeListener(new PropertyChangeListenerProxy("a", proxiedAAC)); support.removePropertyChangeListener("a", new PropertyChangeListenerProxy("c", proxiedAAC)); support.removePropertyChangeListener( "a", new PropertyChangeListenerProxy("c", new PropertyChangeListenerProxy("a", proxiedAAC))); assertEquals(1, support.getPropertyChangeListeners().length); support.removePropertyChangeListener( "a", new PropertyChangeListenerProxy("a", new PropertyChangeListenerProxy("c", proxiedAAC))); assertEquals(0, support.getPropertyChangeListeners().length); }
public void removePropertyChangeListener(PropertyChangeListener listener) { listeners.removePropertyChangeListener(listener); Property[] subProperties = getSubProperties(); if (subProperties != null) for (int i = 0; i < subProperties.length; ++i) subProperties[i].removePropertyChangeListener(listener); }
/** * Removes a PropertyChangeListener from the listener list for a specific property. This method * should be used to remove PropertyChangeListeners that were registered for a specific bound * property. * * <p>If listener is null, no exception is thrown and no action is performed. * * @param propertyName a valid property name * @param listener the PropertyChangeListener to be removed * @see #addPropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener) * @see #getPropertyChangeListeners(java.lang.String) * @see #removePropertyChangeListener(java.beans.PropertyChangeListener) */ public synchronized void removePropertyChangeListener( String propertyName, PropertyChangeListener listener) { if (listener == null || changeSupport == null) { return; } changeSupport.removePropertyChangeListener(propertyName, listener); }
@Override public void dispose() { final PropertyChangeListener[] changeListeners = changeSupport.getPropertyChangeListeners(); for (PropertyChangeListener changeListener : changeListeners) { changeSupport.removePropertyChangeListener(changeListener); } }
/** * Removes the PropertyChangeListener from the internal list. If the PropertyChangeListener is not * on the list, nothing is done. * * @see #addPropertyChangeListener * @param listener The PropertyChangeListener. */ public void removePropertyChangeListener(PropertyChangeListener listener) { if (listener == null) throw new NullPointerException("listener"); if (changes_ != null) changes_.removePropertyChangeListener(listener); // @CRS // must call the parents change listener since it is // in a different package. super.removePropertyChangeListener(listener); }
/** * Remove a PropertyChangeListener for a specific property. If <code>listener</code> was added * more than once to the same event source for the specified property, it will be notified one * less time after being removed. If <code>propertyName</code> is null, no exception is thrown and * no action is taken. If <code>listener</code> is null, or was never added for the specified * property, no exception is thrown and no action is taken. * * @param propertyName The name of the property that was listened on. * @param listener The PropertyChangeListener to be removed */ public synchronized void removePropertyChangeListener( String propertyName, PropertyChangeListener listener) { if (listener == null || propertyName == null) { return; } if (children == null) { return; } PropertyChangeSupport child = (PropertyChangeSupport) children.get(propertyName); if (child == null) { return; } child.removePropertyChangeListener(listener); }
/** * Remove a PropertyChangeListener from the listener list. This removes a PropertyChangeListener * that was registered for all properties. If <code>listener</code> was added more than once to * the same event source, it will be notified one less time after being removed. If <code>listener * </code> is null, or was never added, no exception is thrown and no action is taken. * * @param listener The PropertyChangeListener to be removed */ public synchronized void removePropertyChangeListener(PropertyChangeListener listener) { if (listener == null) { return; } if (listener instanceof PropertyChangeListenerProxy) { PropertyChangeListenerProxy proxy = (PropertyChangeListenerProxy) listener; // Call two argument remove method. removePropertyChangeListener( proxy.getPropertyName(), (PropertyChangeListener) proxy.getListener()); } else { if (listeners == null) { return; } listeners.remove(listener); } }
/* (non-Javadoc) * @see org.eclipse.ui.part.WorkbenchPart#dispose() */ @Override public void dispose() { view.removeViewChangeListener(viewChangeListener); if (subsetHistory != null) { PropertyChangeSupport propertyChangeSupport = (PropertyChangeSupport) subsetHistory.getAdapter(PropertyChangeSupport.class); if (propertyChangeSupport != null) { propertyChangeSupport.removePropertyChangeListener(propertyChangeListener); } } if (UIActivator.getDefault() != null) { IPreferenceStore preferences = UIActivator.getDefault().getPreferenceStore(); preferences.removePropertyChangeListener(preferenceChangeListener); } super.dispose(); }
/** * Remove property change listener. * * @param l property change listener */ public void removePropertyChangeListener(PropertyChangeListener l) { support_.removePropertyChangeListener(l); }
public void removePropertyChangeListener(PropertyChangeListener listener) { System.out.println("THRESSHOLD removeListener:" + listener.getClass()); _support.removePropertyChangeListener(listener); }
public void removePropertyChangeListener(PropertyChangeListener listener) { propertyChangeSupport.removePropertyChangeListener(listener); }
/** * Remove a property change listener * * @param pcl a <code>PropertyChangeListener</code> value */ public void removePropertyChangeListener(PropertyChangeListener pcl) { m_pcSupport.removePropertyChangeListener(pcl); }
/** Removes the specified change listener. */ public static void removeChangeListener(PropertyChangeListener l) { if (m_pcsTypesMgr != null) m_pcsTypesMgr.removePropertyChangeListener(l); }
@Override public void removePropertyChangeListener(PropertyChangeListener l) { pcs.removePropertyChangeListener(l); }
@Override public void removePropertyChangeListener(@Nullable PropertyChangeListener listener) { pcs.removePropertyChangeListener(listener); }
@Override public void removePropertyChangeListener(java.beans.PropertyChangeListener listener) { property.removePropertyChangeListener(listener); }
public void removePropertyChangeListener(PropertyChangeListener propertyChangeListener) { support.removePropertyChangeListener(propertyChangeListener); }
public void removePropertyChangeListener(PropertyChangeListener l) { myChangeSupport.removePropertyChangeListener(l); }
@Override public void removePropertyChangeListener( String propertyName, java.beans.PropertyChangeListener listener) { property.removePropertyChangeListener(propertyName, listener); }
/** * Remove specific property change listener * * @param name property name * @param l property change listener */ public void removePropertyChangeListener(String name, PropertyChangeListener l) { support_.removePropertyChangeListener(name, l); }
@Override public void removePropertyChangeListener( @Nullable String propertyName, @Nullable PropertyChangeListener listener) { pcs.removePropertyChangeListener(propertyName, listener); }
/** * Removes a PropertyChangeListener from this instance. * * @param listener The PropertyChangeListener to be removed. */ public void removePropertyChangeListener(PropertyChangeListener listener) { if (propertyListeners != null) { propertyListeners.removePropertyChangeListener(listener); } }
public void removePropertyChangeListener(PropertyChangeListener listener) { pcs.removePropertyChangeListener(listener); }
/** * Removes a PropertyChangeListener for a named property from this instance. * * @param name The name of the property. * @param listener The PropertyChangeListener to be removed. */ public void removePropertyChangeListener(String name, PropertyChangeListener listener) { if (propertyListeners != null) { propertyListeners.removePropertyChangeListener(name, listener); } }
public void removePropertyChangeListener(PropertyChangeListener pcl) { pcs.removePropertyChangeListener(pcl); }
@Override public void removePropertyChangeListener(PropertyChangeListener listener) { super.removePropertyChangeListener(listener); initPropSupport(); propSupport.removePropertyChangeListener(listener); }
public void removePropertyChangeListener(PropertyChangeListener l) { changes.removePropertyChangeListener(l); }
/** * Removes a PropertyChangeListener from the listener list. This removes a PropertyChangeListener * that was registered for all properties. * * @param listener The PropertyChangeListener to be removed */ public void removePropertyChangeListener(PropertyChangeListener listener) { if (accessibleChangeSupport != null) { accessibleChangeSupport.removePropertyChangeListener(listener); } }
public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener) { propertyChangeSupport.removePropertyChangeListener(propertyName, listener); }
/** * Remove a property change listener from this component. * * @param listener The listener to remove */ @Override public void removePropertyChangeListener(PropertyChangeListener listener) { support.removePropertyChangeListener(listener); }