站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc (Current Development Version)

ChangeSupport (Utilities API) - NetBeans API Javadoc (Current Development Version)

org.openide.util 7.9.0 1

org.openide.util
Class ChangeSupport

java.lang.Object
  extended by org.openide.util.ChangeSupport

public final class ChangeSupport
extends Object

A simple equivalent of PropertyChangeSupport for ChangeListeners. This class is not serializable.

Since:
7.8

Constructor Summary
ChangeSupport(Object source)
          Creates a new ChangeSupport
 
Method Summary
 void addChangeListener(ChangeListener listener)
          Adds a ChangeListener to the listener list.
 void fireChange()
          Fires a change event to all registered listeners.
 boolean hasListeners()
          Checks if there are any listeners registered to thisChangeSupport.
 void removeChangeListener(ChangeListener listener)
          Removes a ChangeListener from the listener list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChangeSupport

public ChangeSupport(Object source)
Creates a new ChangeSupport

Parameters:
source - the instance to be given as the source for events.
Method Detail

addChangeListener

public void addChangeListener(ChangeListener listener)
Adds a ChangeListener to the listener list. The same listener object may be added more than once, and will be called as many times as it is added. If listener is null, no exception is thrown and no action is taken.

Parameters:
listener - the ChangeListener to be added.

removeChangeListener

public void removeChangeListener(ChangeListener listener)
Removes a ChangeListener from the listener list. If listener was added more than once, it will be notified one less time after being removed. If listener is null, or was never added, no exception is thrown and no action is taken.

Parameters:
listener - the ChangeListener to be removed.

fireChange

public void fireChange()
Fires a change event to all registered listeners.


hasListeners

public boolean hasListeners()
Checks if there are any listeners registered to thisChangeSupport.

Returns:
true if there are one or more listeners for the given property, false otherwise.

org.openide.util 7.9.0 1

Built on May 28 2007.  |  Portions Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.