Package org.apache.tapestry

Examples of org.apache.tapestry.IActionListener


    public void testIsCached() throws Exception
    {
        Listener l = new Listener();
        ListenerMap m = new ListenerMap(l);

        IActionListener listener = (IActionListener) m.getListener("actualListenerMethod");

        assertSame("Listener", listener, m.getListener("actualListenerMethod"));
    }
View Full Code Here


        {
            boolean current = isDescending();
            setDescending(!current);
        }

        IActionListener listener = getListener();
        if (listener == null)
            throw Tapestry.createRequiredParameterException(this, "listener");

        listener.actionTriggered(this, cycle);
    }
View Full Code Here

     * If the listener parameter is not bound, attempt to locate an implicit
     * listener named by the capitalized component id, prefixed by "do".
     */
    public void trigger(IRequestCycle cycle)
    {
        IActionListener listener = getListener();
        if (listener == null)
            listener = getContainer().getListeners().getImplicitListener(this);

        Object[] params = cycle.getListenerParameters();

View Full Code Here

     *             if the component is stateful, and the session is new.
     */

    public void trigger(IRequestCycle cycle)
    {
        IActionListener listener = getListener();

        if (listener == null)
          listener = getContainer().getListeners().getImplicitListener(this);

        getListenerInvoker().invokeListener(listener, this, cycle);
View Full Code Here

     *
     **/

    public void trigger(IRequestCycle cycle)
    {
        IActionListener listener = getListener();
       
        if (listener == null)
          throw Tapestry.createRequiredParameterException(this, "listener");

        listener.actionTriggered(this, cycle);
    }
View Full Code Here

        verifyControls();
    }

    public void testTriggerWithListener()
    {
        IActionListener listener = newListener();
        IForm form = newForm();
        IRequestCycle cycle = newCycle();

        Creator creator = new Creator();
        Submit submit = (Submit) creator.newInstance(Submit.class, new Object[]
        { "listener", listener, "listenerInvoker", new ListenerInvokerTerminator() });

        listener.actionTriggered(submit, cycle);

        replayControls();

        submit.handleClick(cycle, form);
View Full Code Here

        verifyControls();
    }

    public void testTriggerWithDeferredListener()
    {
        IActionListener listener = newListener();
        MockForm form = new MockForm();
        IRequestCycle cycle = newCycle();

        Creator creator = new Creator();
        Submit submit = (Submit) creator.newInstance(Submit.class, new Object[]
        { "listener", listener, "defer", Boolean.TRUE, "listenerInvoker",
                new ListenerInvokerTerminator() });

        replayControls();

        submit.handleClick(cycle, form);

        verifyControls();

        listener.actionTriggered(submit, cycle);

        replayControls();

        form.runDeferred();
View Full Code Here

        verifyControls();
    }

    public void testTriggerWithDeferredListenerAndSingleParameter()
    {
        IActionListener listener = newListener();
        MockForm form = new MockForm();
        MockControl cycleControl = newControl(IRequestCycle.class);
        IRequestCycle cycle = (IRequestCycle) cycleControl.getMock();

        Object parameter = new Object();
        Creator creator = new Creator();
        Submit submit = (Submit) creator.newInstance(Submit.class, new Object[]
        { "listener", listener, "defer", Boolean.TRUE, "parameters", parameter, "listenerInvoker",
                new ListenerInvokerTerminator() });

        cycle.setListenerParameters(new Object[]
        { parameter });
        cycleControl.setMatcher(MockControl.ARRAY_MATCHER);

        replayControls();

        submit.handleClick(cycle, form);

        verifyControls();

        listener.actionTriggered(submit, cycle);

        replayControls();

        form.runDeferred();
View Full Code Here

        verifyControls();
    }

    public void testTriggerWithDeferredListenerAndMultipleParameters()
    {
        IActionListener listener = newListener();
        MockForm form = new MockForm();
        MockControl cycleControl = newControl(IRequestCycle.class);
        IRequestCycle cycle = (IRequestCycle) cycleControl.getMock();

        Collection parameters = new LinkedList();
        parameters.add("p1");
        parameters.add("p2");

        Creator creator = new Creator();
        Submit submit = (Submit) creator.newInstance(Submit.class, new Object[]
        { "listener", listener, "defer", Boolean.TRUE, "parameters", parameters, "listenerInvoker",
                new ListenerInvokerTerminator() });

        cycle.setListenerParameters(new Object[]
        { "p1", "p2" });
        cycleControl.setMatcher(MockControl.ARRAY_MATCHER);

        replayControls();

        submit.handleClick(cycle, form);

        verifyControls();

        listener.actionTriggered(submit, cycle);

        replayControls();

        form.runDeferred();
View Full Code Here

        return (IActionListener) newMock(IActionListener.class);
    }

    public void testFindCancelListener()
    {
        IActionListener cancel = newListener();
        IActionListener listener = newListener();

        replayControls();

        Form form = (Form) newInstance(Form.class, new Object[]
        { "listener", listener, "cancel", cancel });
View Full Code Here

TOP

Related Classes of org.apache.tapestry.IActionListener

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.