samples/openfixed/src/org/apidesign/openfixed/ModificationEvent.java
changeset 409 40cabcdcd2be
parent 373 c20d1d8ef2ca
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/samples/openfixed/src/org/apidesign/openfixed/ModificationEvent.java	Thu Oct 30 21:30:10 2014 +0100
     1.3 @@ -0,0 +1,35 @@
     1.4 +package org.apidesign.openfixed;
     1.5 +
     1.6 +import java.util.Collection;
     1.7 +import java.util.EventObject;
     1.8 +
     1.9 +// BEGIN: openfixed.event
    1.10 +public final class ModificationEvent extends EventObject {
    1.11 +    private final int delta;
    1.12 +    ModificationEvent(Object source, int delta) {
    1.13 +        super(source);
    1.14 +        this.delta = delta;
    1.15 +    }
    1.16 +    
    1.17 +    public int getChange() {
    1.18 +        return delta;
    1.19 +    }
    1.20 +    
    1.21 +// FINISH: openfixed.event
    1.22 +    
    1.23 +// BEGIN: openfixed.addgetter    
    1.24 +    int pending;
    1.25 +    /** @since 2.0 */
    1.26 +    public int getPending() {
    1.27 +        return pending;
    1.28 +    }
    1.29 +// END: openfixed.addgetter    
    1.30 +    
    1.31 +// BEGIN: openfixed.mount
    1.32 +    Collection<PostModificationListener> posts;
    1.33 +    /** @since 3.0 */
    1.34 +    public void postProcess(PostModificationListener p) {
    1.35 +        posts.add(p);
    1.36 +    }
    1.37 +// END: openfixed.mount  
    1.38 +}