Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2009 Matthew Hall and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html Contributors: Matthew Hall - initial API and implementation (bug 265561) Matthew Hall - bug 268336 /
package org.eclipse.core.internal.databinding.beans;

Since:
3.3
public abstract class BeanPropertyListener extends NativePropertyListener
		implements PropertyChangeListener {
	protected BeanPropertyListener(IProperty property,
			PropertyDescriptor propertyDescriptor,
		super(propertylistener);
		this. = propertyDescriptor;
	}
		if (evt.getPropertyName() == null
			Object oldValue = evt.getOldValue();
			Object newValue = evt.getNewValue();
			IDiff diff;
			if (evt.getPropertyName() == null || oldValue == null
					|| newValue == null)
				diff = null;
			else
				diff = computeDiff(oldValuenewValue);
			fireChange(evt.getSource(), diff);
		}
	}
	protected abstract IDiff computeDiff(Object oldValueObject newValue);
	protected void doAddTo(Object source) {
		BeanPropertyListenerSupport.hookListener(source
				.getName(), this);
	}
	protected void doRemoveFrom(Object source) {
		BeanPropertyListenerSupport.unhookListener(source
				.getName(), this);
	}
New to GrepCode? Check out our FAQ X