Example usage for com.google.gwt.event.shared HandlerManager HandlerManager

List of usage examples for com.google.gwt.event.shared HandlerManager HandlerManager

Introduction

In this page you can find the example usage for com.google.gwt.event.shared HandlerManager HandlerManager.

Prototype

public HandlerManager(Object source) 

Source Link

Document

Creates a handler manager with a source to be set on all events fired via #fireEvent(GwtEvent) .

Usage

From source file:org.turbogwt.mvp.databind.client.mock.HasValueMock.java

License:Apache License

private HandlerManager ensureHandlerManager() {
    return handlerManager == null ? handlerManager = new HandlerManager(this) : handlerManager;
}

From source file:org.zoxweb.client.data.ApplicationClientDAO.java

License:Apache License

protected ApplicationClientDAO(String name, HandlerManager handlerManager) {
    this.name = name;

    if (handlerManager != null) {
        this.handlerManager = handlerManager;
    } else {//from  w w w .j a v  a 2 s .co  m
        this.handlerManager = new HandlerManager(this);
    }
}

From source file:sk.turn.gwtmvp.client.EventManager.java

License:Apache License

/**
 * Sets an event handler for an {@code Element}. All previous event handlers of this type of event are removed.
 * @param element The element to bind the event handler for
 * @param eventType The event type (e.g. {@code ClickEvent.getType()})
 * @param handler The handler that handler the event
 *//* w  w w  .  j  a v  a  2s.co  m*/
public static <H extends EventHandler> void setEventHandler(final Element element, DomEvent.Type<H> eventType,
        H handler) {
    if (element == null) {
        return;
    }
    HandlerManager hm = handlerManagers.get(element);
    if (hm == null) {
        handlerManagers.put(element, hm = new HandlerManager(element));
        DOM.setEventListener(element, new EventListener() {
            @Override
            public void onBrowserEvent(Event event) {
                DomEvent.fireNativeEvent(event, handlerManagers.get(element), element);
            }
        });
    }
    DOM.sinkBitlessEvent(element, eventType.getName());
    while (hm.getHandlerCount(eventType) > 0) {
        hm.removeHandler(eventType, hm.getHandler(eventType, 0));
    }
    hm.addHandler(eventType, handler);
}

From source file:thothbot.parallax.core.client.RenderingPanel.java

License:Open Source License

/**
 * This constructor will create new instance of the widget.
 *///from w ww . j a  v  a 2 s . c  om
public RenderingPanel() {
    this.handlerManager = new HandlerManager(this);

    this.ensureDebugId("renderingPanel");
    this.getElement().getStyle().setPosition(Position.RELATIVE);
    this.setWidth("100%");
    this.setHeight("100%");
    this.canvas3dAttributes = new Canvas3dAttributes();
    this.canvas3dAttributes.setStencilEnable(true);

    updateBackground();
}

From source file:uk.ac.ebi.fg.annotare2.web.gwt.editor.client.view.widget.ListBoxValueIndex.java

License:Apache License

public ListBoxValueIndex(ListBox box) {
    this.box = box;
    this.handlerManager = new HandlerManager(this);
}