io.webfolder.ui4j.spi.NativeEventManager Maven / Gradle / Ivy
The newest version!
package io.webfolder.ui4j.spi;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import io.webfolder.ui4j.api.dom.EventTarget;
import io.webfolder.ui4j.api.event.EventHandler;
@SuppressWarnings("unchecked")
public class NativeEventManager implements EventManager {
private PageContext context;
public NativeEventManager(PageContext context) {
this.context = context;
}
@Override
public void bind(EventTarget target, String event, EventHandler handler) {
if (target != null) {
context.getEventRegistrar().register(target, event, handler);
Map map = new HashMap<>();
map.put("event", event);
map.put("listener", handler);
List