Package org.apache.tapestry

Examples of org.apache.tapestry.IBinding


    public void testUnableToFormat()
    {
        Object value = "xyzzyx";
        Location l = fabricateLocation(87);
        IBinding binding = newBinding(l);

        Format format = DateFormat.getInstance();

        IRequestCycle cycle = newRequestCycle(false);
        IMarkupWriter writer = newWriter();
View Full Code Here


        verifyControls();
    }

    public void testStyleClass()
    {
        IBinding informal = newBinding("informal-value");

        IRequestCycle cycle = newRequestCycle(false);
        IMarkupWriter writer = newWriter();
        IComponentSpecification spec = newSpec("informal", null);
View Full Code Here

    }

    protected IBinding newBinding(Object value)
    {
        MockControl control = newControl(IBinding.class);
        IBinding binding = (IBinding) control.getMock();
   
        binding.getObject();
        control.setReturnValue(value);
   
        return binding;
    }
View Full Code Here

        BSFManagerFactory mf = (BSFManagerFactory) newMock(BSFManagerFactory.class);

        replayControls();

        IBinding b = new ListenerBinding("foo", vc, null, c, "", "", mf);

        assertSame(b, b.getObject());

        verifyControls();
    }
View Full Code Here

        verifyControls();
    }

    public void testElement()
    {
        IBinding informal = newBinding("informal-value");
        IComponentSpecification spec = newSpec("informal", null);

        IRequestCycle cycle = newRequestCycle(false);
        IMarkupWriter writer = newWriter();
        IRender body = newRender(writer, cycle);
View Full Code Here

        ValueConverter vc = newValueConverter();

        replayControls();

        IBinding b = newBinding("fred", vc, asm, null);

        assertEquals(Boolean.TRUE, b.getObject());

        verifyControls();
    }
View Full Code Here

        ValueConverter vc = newValueConverter();

        replayControls();

        IBinding b = newBinding("fred", vc, asm, l);

       
        try
        {
            b.getObject();
            unreachable();
        }
        catch (ApplicationRuntimeException ex)
        {
            assertEquals("Nested exception.", ex.getMessage());
View Full Code Here

        ValidatorBindingFactory factory = new ValidatorBindingFactory();
        factory.setValueConverter(vc);
        factory.setValidatorBeanFactory(vbf);

        IBinding binding = factory.createBinding(null, "validator bean", "foo,bar=baz", l);

        assertSame(validator, binding.getObject());
        assertSame(l, binding.getLocation());

        verifyControls();
    }
View Full Code Here

    {
        Creator creator = new Creator();
        Submit submit = (Submit) creator.newInstance(Submit.class, new Object[]
        { "tag", "clicked" });

        IBinding binding = newBinding();
        submit.setBinding("selected", binding);

        IValidationDelegate delegate = newDelegate();
        MockControl formc = newControl(IForm.class);
        IForm form = (IForm) formc.getMock();
View Full Code Here

            // ImageButton is used for its original purpose (as a kind
            // of image map). In modern usage, we only care about
            // whether the user clicked on the image (and thus submitted
            // the form), not where in the image the user actually clicked.

            IBinding pointBinding = getBinding("point");

            if (pointBinding != null)
            {
                int x = Integer.parseInt(value);

                parameterName = name + ".y";
                value = context.getParameter(parameterName);

                int y = Integer.parseInt(value);

                pointBinding.setObject(new Point(x, y));
            }

            // Notify the application, by setting the select parameter
            // to the tag parameter.

            IBinding selectedBinding = getBinding("selected");

            if (selectedBinding != null)
                selectedBinding.setObject(getTag());

            IActionListener listener = getListener();

            if (listener != null)
                listener.actionTriggered(this, cycle);
View Full Code Here

TOP

Related Classes of org.apache.tapestry.IBinding

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.