Exemplo n.º 1
0
  public void bind(ButtonHandler handler) {

    /* Calculate the hash for the widget */
    int hash = Widget.getHash(handler.getParent(), handler.getChild());

    List<ButtonHandler> list = handlerLists.get(hash);

    /* Create and store the list if it does not exist */
    if (list == null) {
      list = new LinkedList<>();
      handlerLists.put(hash, list);
    }

    /* Add the handler to the list */
    list.add(handler);
  }