Package com.ponysdk.core.event

Examples of com.ponysdk.core.event.HandlerRegistration


        for (final PTextBoxBase field : fields) {
            field.addKeyPressHandler(handler);
        }
        keypPressHandlers.add(handler);

        return new HandlerRegistration() {

            @Override
            public void removeHandler() {
                keypPressHandlers.remove(handler);
            }
View Full Code Here


        for (final FormFieldComponent<? extends PTextBoxBase> field : fields) {
            field.getInput().addKeyPressHandler(handler);
        }
        keypPressHandlers.add(handler);

        return new HandlerRegistration() {

            @Override
            public void removeHandler() {
                keypPressHandlers.remove(handler);
            }
View Full Code Here

    }

    @Override
    public HandlerRegistration addKeyPressHandler(final PKeyPressHandler handler) {
        keyPressHandlers.add(handler);
        return new HandlerRegistration() {

            @Override
            public void removeHandler() {
                keyPressHandlers.remove(handler);
            }
View Full Code Here

    }

    @Override
    public HandlerRegistration addKeyPressHandler(final PKeyPressHandler handler) {
        keyPressHandlers.add(handler);
        return new HandlerRegistration() {

            @Override
            public void removeHandler() {
                keyPressHandlers.remove(handler);
            }
View Full Code Here

        setWidth(Size.HUNDRED_PERCENT);
        setHeight(Size.HUNDRED_PERCENT);
    }

    public <H extends EventHandler> HandlerRegistration removeDomHandler(final H handler, final PDomEvent.Type<H> type) {
        final HandlerRegistration handlerRegistration = ensureDomHandler().addHandler(type, handler);
        final RemoveHandler removeHandler = new RemoveHandler(getID(), HANDLER.KEY_.DOM_HANDLER);
        if (handler instanceof JSONObject) {
            removeHandler.put(PROPERTY.DOM_HANDLER_CODE, handler);
        }
        Txn.get().getTxnContext().save(removeHandler);
View Full Code Here

    }

    @SuppressWarnings("unchecked")
    public <H extends EventHandler> HandlerRegistration addDomHandler(final H handler, final PDomEvent.Type<H> type) {
        final Set<H> handlerSet = ensureDomHandler().getHandlerSet(type, this);
        final HandlerRegistration handlerRegistration = domHandler.addHandlerToSource(type, this, handler);
        if (handlerSet.isEmpty()) {
            final AddHandler addHandler = new AddHandler(getID(), HANDLER.KEY_.DOM_HANDLER);
            addHandler.put(PROPERTY.DOM_HANDLER_CODE, type.getDomHandlerType().ordinal());
            if (handler instanceof JSONObject) {
                try {
View Full Code Here

        if (l != null) {
            nlist = l;
        }
        nlist.add(listener);

        return new HandlerRegistration() {

            @Override
            public void removeHandler() {
                listeners.get(key).remove(listener);
            }
View Full Code Here

    private final Collection<PusherListener<T>> listeners = new CopyOnWriteArrayList<PusherListener<T>>();

    public HandlerRegistration register(final PusherListener<T> listener) {
        listeners.add(listener);
        return new HandlerRegistration() {

            @Override
            public void removeHandler() {
                listeners.remove(listener);
            }
View Full Code Here

TOP

Related Classes of com.ponysdk.core.event.HandlerRegistration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.