Indexing by Combo to have access to properties batchnotify
authorJaroslav Tulach <jaroslav.tulach@apidesign.org>
Fri, 13 Sep 2013 10:17:21 +0200
branchbatchnotify
changeset 296fdd06d76c268
parent 295 7c422ac65622
child 297 c9b035e84f40
Indexing by Combo to have access to properties
ko-fx/src/main/java/org/apidesign/html/kofx/FXContext.java
     1.1 --- a/ko-fx/src/main/java/org/apidesign/html/kofx/FXContext.java	Fri Sep 13 10:06:56 2013 +0200
     1.2 +++ b/ko-fx/src/main/java/org/apidesign/html/kofx/FXContext.java	Fri Sep 13 10:17:21 2013 +0200
     1.3 @@ -59,7 +59,7 @@
     1.4      private static Boolean javaScriptEnabled;
     1.5      private final Fn.Presenter browserContext;
     1.6      
     1.7 -    private final Map<JSObject,Set<String>> notifyMutated = new HashMap<JSObject, Set<String>>();
     1.8 +    private final Map<Combo,Set<String>> notifyMutated = new HashMap<Combo, Set<String>>();
     1.9  
    1.10      public FXContext(Fn.Presenter browserContext) {
    1.11          this.browserContext = browserContext;
    1.12 @@ -120,10 +120,10 @@
    1.13          if (notifyMutated.isEmpty()) {
    1.14              FnUtils.runLater(this);
    1.15          }
    1.16 -        Set<String> ss = notifyMutated.get(data);
    1.17 +        Set<String> ss = notifyMutated.get(c);
    1.18          if (ss == null) {
    1.19              ss = new HashSet<String>();
    1.20 -            notifyMutated.put(data, ss);
    1.21 +            notifyMutated.put(c, ss);
    1.22          }
    1.23          ss.add(propertyName);
    1.24      }
    1.25 @@ -199,9 +199,9 @@
    1.26          List<JSObject> objs = new ArrayList<JSObject>();
    1.27          List<String> strngs = new ArrayList<String>();
    1.28          synchronized (this) {
    1.29 -            for (Map.Entry<JSObject, Set<String>> entry : notifyMutated.entrySet()) {
    1.30 +            for (Map.Entry<Combo, Set<String>> entry : notifyMutated.entrySet()) {
    1.31                  for (String propertyName : entry.getValue()) {
    1.32 -                    objs.add(entry.getKey());
    1.33 +                    objs.add(entry.getKey().js);
    1.34                      strngs.add(propertyName);
    1.35                  }
    1.36              }