use of java.beans.PropertyChangeEvent in project jo-client-platform by jo-source.
the class BeanProxyImpl method getPropertyChangesForClear.
private List<PropertyChangeEvent> getPropertyChangesForClear() {
final List<PropertyChangeEvent> result = new LinkedList<PropertyChangeEvent>();
for (final Entry<String, IBeanModification> modificationEntry : modifications.entrySet()) {
final String propertyName = modificationEntry.getKey();
result.add(new PropertyChangeEvent(this, propertyName, modificationEntry.getValue().getNewValue(), beanDto.getValue(propertyName)));
}
return result;
}
use of java.beans.PropertyChangeEvent in project jo-client-platform by jo-source.
the class BeanProxyImpl method propertyChange.
private void propertyChange(final Object source, final String propertyName, final Object oldValue, final Object newValue) {
final PropertyChangeEvent event = new PropertyChangeEvent(source, propertyName, oldValue, newValue);
propertyChangeObservable.firePropertyChange(event);
}
use of java.beans.PropertyChangeEvent in project jo-client-platform by jo-source.
the class BeanProxyImpl method getPropertyChangesForUpdate.
private List<PropertyChangeEvent> getPropertyChangesForUpdate(final IBeanDto beanDto) {
final List<PropertyChangeEvent> result = new LinkedList<PropertyChangeEvent>();
for (final String propertyName : attributes.getPropertyNames()) {
final Object oldValue = getValue(propertyName);
final Object newValue = beanDto.getValue(propertyName);
if (!NullCompatibleEquivalence.equals(oldValue, newValue)) {
result.add(new PropertyChangeEvent(this, propertyName, oldValue, newValue));
}
}
return result;
}
use of java.beans.PropertyChangeEvent in project cayenne by apache.
the class TemplateCreator method initBindings.
protected void initBindings() {
BindingBuilder builder = new BindingBuilder(getApplication().getBindingFactory(), this);
builder.bindToAction(view.getCancelButton(), "cancelAction()");
builder.bindToAction(view.getOkButton(), "okAction()");
final FSPath path = getLastTemplateDirectory();
view.getTemplateChooser().setCurrentDirectory(path.getExistingDirectory(false));
view.getTemplateChooser().addPropertyChangeListener(FileChooser.CURRENT_DIRECTORY_PROPERTY, new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent evt) {
File directory = view.getTemplateChooser().getCurrentDirectory();
path.setDirectory(directory);
}
});
}
use of java.beans.PropertyChangeEvent in project cayenne by apache.
the class ComponentGeometry method bindIntProperty.
/**
* Binds this preference object to synchronize its state with a given component
* property.
*/
public void bindIntProperty(final Component component, final String property, int defaultValue) {
updateIntProperty(component, property, defaultValue);
component.addPropertyChangeListener(property, new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent e) {
Object value = e.getNewValue();
getPreference().put(property, value != null ? value.toString() : null);
}
});
}
Aggregations