Search in sources :

Example 1 with ObservableMap

use of groovy.util.ObservableMap in project gradle by gradle.

the class DefaultAntBuilder method getReferences.

public Map<String, Object> getReferences() {
    ObservableMap map = new ObservableMap(getProject().getReferences());
    map.addPropertyChangeListener(new PropertyChangeListener() {

        public void propertyChange(PropertyChangeEvent event) {
            getProject().addReference(event.getPropertyName(), event.getNewValue());
        }
    });
    @SuppressWarnings("unchecked") Map<String, Object> castMap = (Map<String, Object>) map;
    return castMap;
}
Also used : PropertyChangeEvent(java.beans.PropertyChangeEvent) PropertyChangeListener(java.beans.PropertyChangeListener) GroovyObject(groovy.lang.GroovyObject) ObservableMap(groovy.util.ObservableMap) ObservableMap(groovy.util.ObservableMap)

Example 2 with ObservableMap

use of groovy.util.ObservableMap in project gradle by gradle.

the class DefaultAntBuilder method getProperties.

public Map<String, Object> getProperties() {
    ObservableMap map = new ObservableMap(getProject().getProperties());
    map.addPropertyChangeListener(new PropertyChangeListener() {

        public void propertyChange(PropertyChangeEvent event) {
            doSetProperty(event.getPropertyName(), event.getNewValue());
        }
    });
    @SuppressWarnings("unchecked") Map<String, Object> castMap = (Map<String, Object>) map;
    return castMap;
}
Also used : PropertyChangeEvent(java.beans.PropertyChangeEvent) PropertyChangeListener(java.beans.PropertyChangeListener) GroovyObject(groovy.lang.GroovyObject) ObservableMap(groovy.util.ObservableMap) ObservableMap(groovy.util.ObservableMap)

Aggregations

GroovyObject (groovy.lang.GroovyObject)2 ObservableMap (groovy.util.ObservableMap)2 PropertyChangeEvent (java.beans.PropertyChangeEvent)2 PropertyChangeListener (java.beans.PropertyChangeListener)2