コード例 #1
0
  /**
   * 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);
  }
コード例 #2
0
 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);
 }
コード例 #3
0
 /**
  * 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);
 }
コード例 #4
0
 @Override
 public void dispose() {
   final PropertyChangeListener[] changeListeners = changeSupport.getPropertyChangeListeners();
   for (PropertyChangeListener changeListener : changeListeners) {
     changeSupport.removePropertyChangeListener(changeListener);
   }
 }
コード例 #5
0
  /**
   * 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);
  }
コード例 #6
0
 /**
  * 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);
 }
コード例 #7
0
  /**
   * 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);
    }
  }
コード例 #8
0
  /* (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();
  }
コード例 #9
0
ファイル: PanelModel.java プロジェクト: saiyanprince/pyimager
 /**
  * Remove property change listener.
  *
  * @param l property change listener
  */
 public void removePropertyChangeListener(PropertyChangeListener l) {
   support_.removePropertyChangeListener(l);
 }
コード例 #10
0
 public void removePropertyChangeListener(PropertyChangeListener listener) {
   System.out.println("THRESSHOLD removeListener:" + listener.getClass());
   _support.removePropertyChangeListener(listener);
 }
コード例 #11
0
 public void removePropertyChangeListener(PropertyChangeListener listener) {
   propertyChangeSupport.removePropertyChangeListener(listener);
 }
コード例 #12
0
 /**
  * Remove a property change listener
  *
  * @param pcl a <code>PropertyChangeListener</code> value
  */
 public void removePropertyChangeListener(PropertyChangeListener pcl) {
   m_pcSupport.removePropertyChangeListener(pcl);
 }
コード例 #13
0
ファイル: WPart11Dialog.java プロジェクト: timburrow/ovj3
 /** Removes the specified change listener. */
 public static void removeChangeListener(PropertyChangeListener l) {
   if (m_pcsTypesMgr != null) m_pcsTypesMgr.removePropertyChangeListener(l);
 }
コード例 #14
0
 @Override
 public void removePropertyChangeListener(PropertyChangeListener l) {
   pcs.removePropertyChangeListener(l);
 }
コード例 #15
0
 @Override
 public void removePropertyChangeListener(@Nullable PropertyChangeListener listener) {
   pcs.removePropertyChangeListener(listener);
 }
コード例 #16
0
 @Override
 public void removePropertyChangeListener(java.beans.PropertyChangeListener listener) {
   property.removePropertyChangeListener(listener);
 }
コード例 #17
0
 public void removePropertyChangeListener(PropertyChangeListener propertyChangeListener) {
   support.removePropertyChangeListener(propertyChangeListener);
 }
コード例 #18
0
ファイル: ContentImpl.java プロジェクト: jexp/idea2
 public void removePropertyChangeListener(PropertyChangeListener l) {
   myChangeSupport.removePropertyChangeListener(l);
 }
コード例 #19
0
 @Override
 public void removePropertyChangeListener(
     String propertyName, java.beans.PropertyChangeListener listener) {
   property.removePropertyChangeListener(propertyName, listener);
 }
コード例 #20
0
ファイル: PanelModel.java プロジェクト: saiyanprince/pyimager
 /**
  * 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);
 }
コード例 #21
0
 @Override
 public void removePropertyChangeListener(
     @Nullable String propertyName, @Nullable PropertyChangeListener listener) {
   pcs.removePropertyChangeListener(propertyName, listener);
 }
コード例 #22
0
ファイル: DataAdapter.java プロジェクト: ethanrd/IDV
  /**
   * Removes a PropertyChangeListener from this instance.
   *
   * @param listener The PropertyChangeListener to be removed.
   */
  public void removePropertyChangeListener(PropertyChangeListener listener) {

    if (propertyListeners != null) {
      propertyListeners.removePropertyChangeListener(listener);
    }
  }
コード例 #23
0
 public void removePropertyChangeListener(PropertyChangeListener listener) {
   pcs.removePropertyChangeListener(listener);
 }
コード例 #24
0
ファイル: DataAdapter.java プロジェクト: ethanrd/IDV
  /**
   * 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);
    }
  }
コード例 #25
0
ファイル: OrgRelation.java プロジェクト: djw1149/cougaar-glm
 public void removePropertyChangeListener(PropertyChangeListener pcl) {
   pcs.removePropertyChangeListener(pcl);
 }
コード例 #26
0
ファイル: AbstractAdapter.java プロジェクト: huayuxian/jswat
 @Override
 public void removePropertyChangeListener(PropertyChangeListener listener) {
   super.removePropertyChangeListener(listener);
   initPropSupport();
   propSupport.removePropertyChangeListener(listener);
 }
コード例 #27
0
ファイル: SVGUniverse.java プロジェクト: uazure/josm
 public void removePropertyChangeListener(PropertyChangeListener l) {
   changes.removePropertyChangeListener(l);
 }
コード例 #28
0
 /**
  * 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);
   }
 }
コード例 #29
0
 public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener) {
   propertyChangeSupport.removePropertyChangeListener(propertyName, listener);
 }
コード例 #30
0
 /**
  * Remove a property change listener from this component.
  *
  * @param listener The listener to remove
  */
 @Override
 public void removePropertyChangeListener(PropertyChangeListener listener) {
   support.removePropertyChangeListener(listener);
 }