Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  
  package org.jdesktop.application;
  
An encapsulation of the PropertyChangeSupport methods based on java.beans.PropertyChangeSupport. PropertyChangeListeners are fired on the event dispatching thread.

Note: this class is only public because the so-called "fix" for javadoc bug 4780441 still fails to correctly document public methods inherited from a package private class.

 
 public class AbstractBean {
     private final PropertyChangeSupport pcs;
 
     public AbstractBean() {
 	 = new EDTPropertyChangeSupport(this);
     }

    
Add a PropertyChangeListener to the listener list. The listener is registered for all properties and its propertyChange method will run on the event dispatching thread.

If listener is null, no exception is thrown and no action is taken.

 
     public void addPropertyChangeListener(PropertyChangeListener listener) {
         .addPropertyChangeListener(listener);
     }
  
    
Remove a PropertyChangeListener from the listener list.

If listener is null, no exception is thrown and no action is taken.

 
     public void removePropertyChangeListener(PropertyChangeListener listener) {
         .removePropertyChangeListener(listener);
     }

    
Add a PropertyChangeListener for a specific property. The listener will be invoked only when a call on firePropertyChange names that specific property. The same listener object may be added more than once. For each property, the listener will be invoked the number of times it was added for that property. If propertyName or listener is null, no exception is thrown and no action is taken.

Parameters:
propertyName The name of the property to listen on.
listener the PropertyChangeListener to be added
See also:
java.beans.PropertyChangeSupport.addPropertyChangeListener(java.lang.String,java.beans.PropertyChangeListener)
 
     public void addPropertyChangeListener(String propertyNamePropertyChangeListener listener) {
         .addPropertyChangeListener(propertyNamelistener);
     }

    
Remove a PropertyChangeListener for a specific property. If listener 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 propertyName is null, no exception is thrown and no action is taken. If listener is null, or was never added for the specified property, no exception is thrown and no action is taken.

Parameters:
propertyName The name of the property that was listened on.
listener The PropertyChangeListener to be removed
See also:
java.beans.PropertyChangeSupport.removePropertyChangeListener(java.lang.String,java.beans.PropertyChangeListener)
 
     public synchronized void removePropertyChangeListener(String propertyNamePropertyChangeListener listener) {
         .removePropertyChangeListener(propertyNamelistener);
     }

    
An array of all of the PropertyChangeListeners added so far.

Returns:
all of the PropertyChangeListeners added so far.
See also:
java.beans.PropertyChangeSupport.getPropertyChangeListeners()
        return .getPropertyChangeListeners();
    }
  
    
Called whenever the value of a bound property is set.

If oldValue is not equal to newValue, invoke the propertyChange method on all of the PropertyChangeListeners added so far, on the event dispatching thread.

    protected void firePropertyChange(String propertyNameObject oldValueObject newValue) {
        if (oldValue != null && newValue != null && oldValue.equals(newValue)) {
	    return;
        }
        .firePropertyChange(propertyNameoldValuenewValue);
    }

    
Fire an existing PropertyChangeEvent

If the event's oldValue property is not equal to newValue, invoke the propertyChange method on all of the PropertyChangeListeners added so far, on the event dispatching thread.

    protected void firePropertyChange(PropertyChangeEvent e) {
    }
    private static class EDTPropertyChangeSupport extends PropertyChangeSupport {
	    super(source);
	}
	public void firePropertyChange(final PropertyChangeEvent e) {
	    if (SwingUtilities.isEventDispatchThread()) {
	    } 
	    else {
		Runnable doFirePropertyChange = new Runnable() {
		    public void run() {
		    }
		};
		SwingUtilities.invokeLater(doFirePropertyChange);
	    }
	}
    }
New to GrepCode? Check out our FAQ X