Java 8 PropertyChangeSupport - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 PropertyChangeSupport class.

This code example shows how to use the following methods:addPropertyChangeListener
     * @deprecated This service should not be used outside the AS7 codebase itself, as it may be replaced in AS 7.2 
     */ 
    @Deprecated 
    public void addPropertyChangeListener( 
            PropertyChangeListener listener) {
        changeSupport.addPropertyChangeListener(listener);
    } 
 
    /** 
     * Removes a previously {@link #addPropertyChangeListener(PropertyChangeListener) registered listener}. 
     * 
     * @param listener the listener 
     * 
     * @deprecated This service should not be used outside the AS7 codebase itself, as it may be replaced in AS 7.2 
     */ 
    @Deprecated 
    public void removePropertyChangeListener( 
            PropertyChangeListener listener) {
        changeSupport.removePropertyChangeListener(listener);
    } 
8
CodeRank
This code example shows how to use the following methods:addPropertyChangeListener
This code example shows how to use the following methods:addPropertyChangeListener
     * Add a PropertyChangeListener to the listener list. 
     * @param listener The listener to add. 
     */ 
    public void addPropertyChangeListener(PropertyChangeListener listener) {
        if ( propertyChangeSupport == null ) {
            propertyChangeSupport = new PropertyChangeSupport(this);
        } 
        propertyChangeSupport.addPropertyChangeListener(listener);
    } 
     
    /**  
     * Removes a PropertyChangeListener from the listener list. 
     * @param listener The listener to remove. 
     */ 
    public void removePropertyChangeListener(PropertyChangeListener listener) {
        if ( propertyChangeSupport != null ) {
            propertyChangeSupport.removePropertyChangeListener(listener);
        } 
    } 
     
8
CodeRank
This code example shows how to use the following methods:addPropertyChangeListener, hasListeners
public class Test4092905 { 
    private static final String PUBLIC = "public";
    private static final String PRIVATE = "private";
 
    public static void main(String[] args) {
        PropertyChangeSupport pcs = new PropertyChangeSupport(args);
        pcs.addPropertyChangeListener(PUBLIC, new PublicListener());
        pcs.addPropertyChangeListener(PRIVATE, new PrivateListener());
 
        if (!pcs.hasListeners(PUBLIC)) {
            throw new Error("no public listener");
        } 
        if (!pcs.hasListeners(PRIVATE)) {
            throw new Error("no private listener");
        } 
 
        try { 
            // serialize into byte array 
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            ObjectOutputStream output = new ObjectOutputStream(baos);
7
CodeRank
This code example shows how to use the following methods:addPropertyChangeListener
        this.name = name;
        this.i = i;
    } 
 
    public void addPropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.addPropertyChangeListener(listener);
    } 
 
    public Integer getI() {
        return i;
    } 
 
    public void setI(Integer i) {
        changeSupport.firePropertyChange("i", this.i, this.i = i);
    } 
 
    public String getName() {
        return name;
    } 
 
8
CodeRank
This code example shows how to use the following methods:addPropertyChangeListener
    public long getTotalNumBytesRead() { 
        return totalNumBytesRead;
    } 
 
    public void addPropertyChangeListener(PropertyChangeListener l) {
        propertyChangeSupport.addPropertyChangeListener(l);
    } 
 
    public void removePropertyChangeListener(PropertyChangeListener l) {
        propertyChangeSupport.removePropertyChangeListener(l);
    } 
 
    @Override 
    public int read() throws IOException {
        return (int)updateProgress(super.read()); 
    } 
 
    @Override 
    public int read(byte[] b) throws IOException {
        return (int)updateProgress(super.read(b));
8
CodeRank
This code example shows how to use the following methods:addPropertyChangeListener
        return server;
    } 
 
    public void addPropertyChangeListener(PropertyChangeListener listener)
    { 
        changes.addPropertyChangeListener(listener);
    } 
 
    public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener)
    { 
        changes.addPropertyChangeListener(propertyName, listener);
    } 
 
    public void removePropertyChangeListener(PropertyChangeListener listener)
    { 
        changes.removePropertyChangeListener(listener);
    } 
 
    public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener)
    { 
7
CodeRank
This code example shows how to use the following methods:addPropertyChangeListener
    public void addPropertyChangeListener(PropertyChangeListener listener) {
        if (listener == null) {
            return; 
        } 
        if (changeSupport == null) {
            changeSupport = new java.beans.PropertyChangeSupport(this);
        } 
        changeSupport.addPropertyChangeListener(listener);
    } 
 
    public void removePropertyChangeListener(PropertyChangeListener listener) {
        if (listener == null || changeSupport == null) {
            return; 
        } 
        changeSupport.removePropertyChangeListener(listener);
    } 
 
    public PropertyChangeListener[] getPropertyChangeListeners() {
        if (changeSupport == null) {
            return new PropertyChangeListener[0];
7
CodeRank
This code example shows how to use the following methods:addPropertyChangeListener
                                         oldState,
                                         newState );
    } 
 
    public void addPropertyChangeListener(final PropertyChangeListener l) {
        this.changes.addPropertyChangeListener( l );
    } 
 
    public void removePropertyChangeListener(final PropertyChangeListener l) {
        this.changes.removePropertyChangeListener( l );
    } 
     
    public PropertyChangeListener[] getPropertyChangeListeners() {
        return this.changes.getPropertyChangeListeners();
    } 
 
    public boolean isFlag() { 
        return this.flag;
    } 
 
8
CodeRank
This code example shows how to use the following methods:addPropertyChangeListener
package de.vogella.databinding.example; 
 
import java.beans.PropertyChangeListener; 
import java.beans.PropertyChangeSupport; 
 
public class ModelObject { 
	private PropertyChangeSupport changeSupport = new PropertyChangeSupport(
			this);
 
	public void addPropertyChangeListener(PropertyChangeListener listener) {
		changeSupport.addPropertyChangeListener(listener);
	} 
 
	public void removePropertyChangeListener(PropertyChangeListener listener) {
		changeSupport.removePropertyChangeListener(listener);
	} 
 
	public void addPropertyChangeListener(String propertyName,
			PropertyChangeListener listener) {
		changeSupport.addPropertyChangeListener(propertyName, listener);

7
CodeRank
See Code Examples for Java 8 PropertyChangeSupport Methods: