javaquery/demo-calculator/src/main/java/org/apidesign/bck2brwsr/demo/calc/staticcompilation/Calc.java
branchmodel
changeset 877 3392f250c784
parent 511 b26510e3e105
child 878 ecbd252fd3a7
     1.1 --- a/javaquery/demo-calculator/src/main/java/org/apidesign/bck2brwsr/demo/calc/staticcompilation/Calc.java	Mon Jan 21 16:04:25 2013 +0100
     1.2 +++ b/javaquery/demo-calculator/src/main/java/org/apidesign/bck2brwsr/demo/calc/staticcompilation/Calc.java	Fri Mar 22 16:59:47 2013 +0100
     1.3 @@ -33,7 +33,8 @@
     1.4      @Property(name = "memory", type = double.class),
     1.5      @Property(name = "display", type = double.class),
     1.6      @Property(name = "operation", type = String.class),
     1.7 -    @Property(name = "hover", type = boolean.class)
     1.8 +    @Property(name = "hover", type = boolean.class),
     1.9 +    @Property(name = "history", type = double.class, array = true)
    1.10  })
    1.11  public class Calc {
    1.12      static {
    1.13 @@ -65,11 +66,13 @@
    1.14      
    1.15      @On(event = CLICK, id="result")
    1.16      static void computeTheValue(Calculator c) {
    1.17 -        c.setDisplay(compute(
    1.18 +        final double newValue = compute(
    1.19              c.getOperation(), 
    1.20              c.getMemory(), 
    1.21              c.getDisplay()
    1.22 -        ));
    1.23 +        );
    1.24 +        c.setDisplay(newValue);
    1.25 +        c.getHistory().add(newValue);
    1.26          c.setMemory(0);
    1.27      }
    1.28