Search in sources :

Example 91 with PropertyChangeEvent

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;
}
Also used : PropertyChangeEvent(java.beans.PropertyChangeEvent) IBeanModification(org.jowidgets.cap.common.api.bean.IBeanModification) LinkedList(java.util.LinkedList)

Example 92 with PropertyChangeEvent

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);
}
Also used : PropertyChangeEvent(java.beans.PropertyChangeEvent)

Example 93 with PropertyChangeEvent

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;
}
Also used : PropertyChangeEvent(java.beans.PropertyChangeEvent) LinkedList(java.util.LinkedList)

Example 94 with PropertyChangeEvent

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);
        }
    });
}
Also used : PropertyChangeEvent(java.beans.PropertyChangeEvent) PropertyChangeListener(java.beans.PropertyChangeListener) BindingBuilder(org.apache.cayenne.swing.BindingBuilder) FSPath(org.apache.cayenne.modeler.pref.FSPath) File(java.io.File)

Example 95 with PropertyChangeEvent

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);
        }
    });
}
Also used : PropertyChangeEvent(java.beans.PropertyChangeEvent) PropertyChangeListener(java.beans.PropertyChangeListener)

Aggregations

PropertyChangeEvent (java.beans.PropertyChangeEvent)589 PropertyChangeListener (java.beans.PropertyChangeListener)375 ActionEvent (java.awt.event.ActionEvent)42 ActionListener (java.awt.event.ActionListener)35 JPanel (javax.swing.JPanel)35 Test (org.junit.Test)33 ArrayList (java.util.ArrayList)30 IWidgetPropertyChangeHandler (org.csstudio.opibuilder.properties.IWidgetPropertyChangeHandler)27 IFigure (org.eclipse.draw2d.IFigure)25 File (java.io.File)24 JLabel (javax.swing.JLabel)24 BorderLayout (java.awt.BorderLayout)22 List (java.util.List)21 IOException (java.io.IOException)19 Dimension (java.awt.Dimension)16 ChangeEvent (javax.swing.event.ChangeEvent)15 PropertyVetoException (java.beans.PropertyVetoException)14 PropertyChangeSupport (java.beans.PropertyChangeSupport)13 ChangeListener (javax.swing.event.ChangeListener)13 UnprocessedChangeEvents (org.jvnet.hk2.config.UnprocessedChangeEvents)13