Examples of HandlersChain


Examples of org.apache.wink.server.handlers.HandlersChain

    @Test
    public void testRequestsHandleRequestWithNoLoggerAtDebug() throws Throwable {
        Requests r = new Requests();
        r.init(null);
        final MessageContext context = mockContext.mock(MessageContext.class);
        final HandlersChain chain = mockContext.mock(HandlersChain.class);

        mockContext.checking(new Expectations() {
            {
                oneOf(chain).doChain(context);
            }
View Full Code Here

Examples of org.apache.wink.server.handlers.HandlersChain

    public void testRequestsHandleRequestWithLoggerAtDebug() throws Throwable {
        Logger.getLogger("org.apache.wink").setLevel(Level.FINE);
        Requests r = new Requests();
        r.init(null);
        final MessageContext context = mockContext.mock(MessageContext.class);
        final HandlersChain chain = mockContext.mock(HandlersChain.class);

        final HttpServletRequestWrapper requestWrapper =
            mockContext.mock(HttpServletRequestWrapper.class);
        final Sequence normalSequence = mockContext.sequence("normalSequence");
        final RequestWrapper wrapper = mockContext.mock(RequestWrapper.class);
View Full Code Here

Examples of org.richfaces.renderkit.util.HandlersChain

        return options;
    }

    public static void addEventOption(FacesContext context, UIComponent component, Map<String, Object> options, String eventName) {

        HandlersChain handlersChain = new HandlersChain(context, component);
        handlersChain.addInlineHandlerFromAttribute(ON + eventName);
        handlersChain.addBehaviors(eventName);
        // handlersChain.addAjaxSubmitFunction();

        String handler = handlersChain.toScript();
        if (handler != null) {
            options.put(ON + eventName, new JSFunctionDefinition(JSReference.EVENT).addToBody(handler));
        }
    }
View Full Code Here

Examples of org.richfaces.renderkit.util.HandlersChain

    public String getOnClick(FacesContext context, UIComponent component) {
        StringBuffer onClick = new StringBuffer();

        if (!getUtils().isBooleanAttribute(component, "disabled")) {
            HandlersChain handlersChain = new HandlersChain(context, component);

            handlersChain.addInlineHandlerFromAttribute("onclick");
            handlersChain.addBehaviors("click", "action");
            handlersChain.addAjaxSubmitFunction();

            String handlerScript = handlersChain.toScript();

            if (handlerScript != null) {
                onClick.append(handlerScript);
            }
View Full Code Here

Examples of org.richfaces.renderkit.util.HandlersChain

        JSFunction function = new JSFunction(AJAX_POLL_FUNCTION);
        Map<String, Object> options = new HashMap<String, Object>();

        RenderKitUtils.addToScriptHash(options, "interval", poll.getInterval(), "1000");
        // RenderKitUtils.addToScriptHash(options, "pollId", component.getClientId(context));
        HandlersChain handlersChain = new HandlersChain(context, poll);
        handlersChain.addInlineHandlerFromAttribute(AbstractPoll.ON_TIMER);
        handlersChain.addBehaviors(AbstractPoll.TIMER);
        handlersChain.addAjaxSubmitFunction();

        String handler = handlersChain.toScript();

        if (handler != null) {
            JSFunctionDefinition timerHandler = new JSFunctionDefinition(JSReference.EVENT);
            timerHandler.addToBody(handler);
            options.put(AbstractPoll.ON_TIMER, timerHandler);
View Full Code Here

Examples of org.richfaces.renderkit.util.HandlersChain

        Map<String, Object> options = new HashMap<String, Object>();

        Map<String, Object> attributes = ajaxStatus.getAttributes();
        for (String eventName : EVENT_NAMES) {
            String eventAttribute = "on" + eventName;
            HandlersChain handlersChain = new HandlersChain(context, component, true);
            handlersChain.addInlineHandlerFromAttribute(eventAttribute);
            handlersChain.addBehaviors(eventName);
            addToScriptHash(options, eventAttribute, handlersChain.toScript(), null, ScriptHashVariableWrapper.eventHandler);
        }

        addToScriptHash(options, "statusName", attributes.get("name"));

        if (!options.isEmpty()) {
View Full Code Here

Examples of org.richfaces.renderkit.util.HandlersChain

    public String getOnClick(FacesContext context, UIComponent component) {
        StringBuffer onClick = new StringBuffer();

        if (!getUtils().isBooleanAttribute(component, "disabled")) {
            HandlersChain handlersChain = new HandlersChain(context, component);

            handlersChain.addInlineHandlerFromAttribute("onclick");
            handlersChain.addBehaviors("click", "action");
            handlersChain.addAjaxSubmitFunction();

            String handlerScript = handlersChain.toScript();

            if (handlerScript != null) {
                onClick.append(handlerScript);
            }
View Full Code Here

Examples of org.richfaces.renderkit.util.HandlersChain

        Map<String, Object> options = new HashMap<String, Object>();

        Map<String, Object> attributes = ajaxStatus.getAttributes();
        for (String eventName : EVENT_NAMES) {
            String eventAttribute = "on" + eventName;
            HandlersChain handlersChain = new HandlersChain(context, component, true);
            handlersChain.addInlineHandlerFromAttribute(eventAttribute);
            handlersChain.addBehaviors(eventName);
            addToScriptHash(options, eventAttribute, handlersChain.toScript(), null, ScriptHashVariableWrapper.eventHandler);
        }

        addToScriptHash(options, "statusName", attributes.get("name"));

        if (!options.isEmpty()) {
View Full Code Here

Examples of org.richfaces.renderkit.util.HandlersChain

        JSFunction function = new JSFunction(AJAX_POLL_FUNCTION);
        Map<String, Object> options = new HashMap<String, Object>();

        RenderKitUtils.addToScriptHash(options, "interval", poll.getInterval(), "1000");
        // RenderKitUtils.addToScriptHash(options, "pollId", component.getClientId(context));
        HandlersChain handlersChain = new HandlersChain(context, poll);
        handlersChain.addInlineHandlerFromAttribute(AbstractPoll.ON_TIMER);
        handlersChain.addBehaviors(AbstractPoll.TIMER);
        handlersChain.addAjaxSubmitFunction();

        String handler = handlersChain.toScript();

        if (handler != null) {
            JSFunctionDefinition timerHandler = new JSFunctionDefinition(JSReference.EVENT);
            timerHandler.addToBody(handler);
            options.put(AbstractPoll.ON_TIMER, timerHandler);
View Full Code Here

Examples of org.richfaces.renderkit.util.HandlersChain

        return options;
    }

    public static void addEventOption(FacesContext context, UIComponent component, Map<String, Object> options, String eventName) {

        HandlersChain handlersChain = new HandlersChain(context, component);
        handlersChain.addInlineHandlerFromAttribute(ON + eventName);
        handlersChain.addBehaviors(eventName);
        // handlersChain.addAjaxSubmitFunction();

        String handler = handlersChain.toScript();
        if (handler != null) {
            options.put(ON + eventName, new JSFunctionDefinition(JSReference.EVENT).addToBody(handler));
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.