/**
* Returns an array of all the property change listeners
* registered on this component.
*
* @return all of this component's PropertyChangeListener
s
* or an empty array if no property change
* listeners are currently registered
*
* @see #addPropertyChangeListener
* @see #removePropertyChangeListener
* @see java.beans.PropertyChangeSupport#getPropertyChangeListeners
*
* @since 1.6
*/
public PropertyChangeListener[] getPropertyChangeListeners() {
if (changeSupport == null) {
return new PropertyChangeListener[0];
}
return changeSupport.getPropertyChangeListeners();
}
/** * Returns an array of all the listeners which have been associated * with the named property. * * @return all of thePropertyChangeListener
s associated with * the named property; if no such listeners have been added or * ifpropertyName
isnull
, an empty * array is returned * * @see #addPropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener) * @see #removePropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener) * @see #getPropertyChangeListeners * @since 1.4 */ public PropertyChangeListener[] getPropertyChangeListeners( String propertyName) { synchronized (getObjectLock()) { if (changeSupport == null) { return new PropertyChangeListener[0]; } return changeSupport.getPropertyChangeListeners(propertyName); } }
/** * Returns an array of all the listeners which have been associated * with the named property. * * @param propertyName the property name * @return all of the {@code PropertyChangeListener}s associated with * the named property; if no such listeners have been added or * if {@code propertyName} is {@code null}, an empty * array is returned * * @see #addPropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener) * @see #removePropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener) * @see #getPropertyChangeListeners * @since 1.4 */ public PropertyChangeListener[] getPropertyChangeListeners(String propertyName) { synchronized (getObjectLock()) { if (changeSupport == null) { return new PropertyChangeListener[0]; } return changeSupport.getPropertyChangeListeners(propertyName); } }
/** * Adds an event listener to be invoked when the logging * properties are re-read. Adding multiple instances of * the same event Listener results in multiple entries * in the property event listener table. * * @param l event listener * @exception SecurityException if a security manager exists and if * the caller does not have LoggingPermission("control"). * @exception NullPointerException if the PropertyChangeListener is null. */ public void addPropertyChangeListener(PropertyChangeListener l) throws SecurityException { if (l == null) { throw new NullPointerException(); } checkAccess(); changes.addPropertyChangeListener(l); }
/** * Add a {@code PropertyChangeListener}, which will be invoked when * the properties are reread. * * @param l * the {@code PropertyChangeListener} to be added. */ public void addPropertyChangeListener(PropertyChangeListener l) { if (l == null) { throw new NullPointerException(); } checkAccess(); listeners.addPropertyChangeListener(l); }
public void addPropertyChangeListener( PropertyChangeListener l ) { if( null == propSupport ) propSupport = new PropertyChangeSupport( this ); propSupport.addPropertyChangeListener( l ); }
if (haveToAdd) { changes.addPropertyChangeListener(propertyName, listener); }
for ( int i = 0; i < subProperties.length; ++i ) subProperties[i].addPropertyChangeListener( listener );
if (changeSupport != null && state != STATE_SESSION_IMPOSSIBLE) changeSupport.addPropertyChangeListener(PROPERTY_STATE, listener);
if (changeSupport == null) { changeSupport = new PropertyChangeSupport(this); }
private static PropertyChangeSupport createPropertyChangeSupport(Toolkit toolkit) { if (toolkit instanceof SunToolkit || toolkit instanceof HeadlessToolkit) { return new DesktopPropertyChangeSupport(toolkit); } else { return new PropertyChangeSupport(toolkit); } }
/** @return Getter for pcs */ private PropertyChangeSupport getPCS() { if (pcs == null) pcs = new PropertyChangeSupport(this); return pcs; }
public TimeZonePropertyEditor() { propertyChangeSupport = new PropertyChangeSupport( this ); valueConverter = new TimeZoneValueConverter(); }
/** * construct a BeanContextChildSupport where the JavaBean component * itself implements BeanContextChild, and encapsulates this, delegating * that interface to this implementation * @param bcc the underlying bean context child */ public BeanContextChildSupport(BeanContextChild bcc) { super(); beanContextChildPeer = (bcc != null) ? bcc : this; pcSupport = new PropertyChangeSupport(beanContextChildPeer); vcSupport = new VetoableChangeSupport(beanContextChildPeer); }
/** * Create the layer and fill in the necessary components. * @param name Layer name */ public Layer(String name) { this.propertyChangeSupport = new PropertyChangeSupport(this); setName(name); }
if (oldValue != wheelZooming) { this.wheelZooming = wheelZooming; propertyChangeSupport.firePropertyChange(ATTR_WHEEL_ZOOMING, oldValue, this.wheelZooming); }
/** * Support for reporting bound property changes for boolean properties. * This method can be called when a bound property has changed and it will * send the appropriate PropertyChangeEvent to any registered * PropertyChangeListeners. * * @param propertyName the property whose value has changed * @param oldValue the property's previous value * @param newValue the property's new value * * @since 1.6 */ protected void firePropertyChange(String propertyName, Object oldValue, Object newValue) { if (changeSupport != null) { changeSupport.firePropertyChange(propertyName, oldValue, newValue); } }
if (canUndoState != value) { // System.out.println("canUndo = " + value); canUndoState = value; propSupport.firePropertyChange(CAN_UNDO, !value, value); }
/** * Unregisters a listener. * * Iflistener
has not been registered previously, * nothing happens. Also, no exception is thrown if *listener
isnull
. */ public synchronized void removePropertyChangeListener(PropertyChangeListener listener) { if (listener != null) pcs.removePropertyChangeListener(listener); }
if (changeSupport != null) { changeSupport.removePropertyChangeListener(propertyName, listener); }
/** * Remove a PropertyChangeListener from this component. * @param listner PropertyChangeListener instance */ public synchronized void removePropertyChangeListener(PropertyChangeListener listner) { if (listner != null) { propertyChangeSupport.removePropertyChangeListener(listner); } }
public void removePropertyChangeListener(PropertyChangeListener listener) { pcs.removePropertyChangeListener(listener); if (!alwaysActive && !pcs.hasListeners(null)) { setActive(false); } }
public void removePropertyChangeListener(PropertyChangeListener l) { if (propertyChangeSupport == null) return; propertyChangeSupport.removePropertyChangeListener(l); }
/** * 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. ** 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 PropertyChangeSupport#removePropertyChangeListener(java.beans.PropertyChangeListener) */ public synchronized void removePropertyChangeListener( String propertyName, PropertyChangeListener listener) { if (listener == null || changeSupport == null) { return; } changeSupport.removePropertyChangeListener(propertyName, listener); }