Package org.apache.tapestry

Examples of org.apache.tapestry.IComponent


        if (cycle.isRewinding()
                || TapestryUtils.getOptionalPageRenderSupport(cycle) == null)
            return;
       
        // Don't render fields being pre-rendered, otherwise we'll render twice
        IComponent field = (IComponent)cycle.getAttribute(TapestryUtils.FIELD_PRERENDER);
        if (field != null && field == component)
            return;
       
        if (_invoker.hasEvents(component.getId()))
            linkComponent(cycle, component);
View Full Code Here


        for (int i=0; i < deferred.size(); i++) {
           
            Object[] val = (Object[])deferred.get(i);
           
            Map scriptParms = (Map)val[0];
            IComponent component = (IComponent)scriptParms.get("component");
           
            ComponentEventProperty props = _invoker.getComponentEvents(component.getId());
            Object[][] formEvents = buildFormEvents(cycle, form.getId(),
                    props.getFormEvents(), (Boolean)val[1]);
           
            // don't want any events accidently connected again
            scriptParms.remove("events");
View Full Code Here

    {
        List listeners = prop.getEventListeners(event.getName());
        for (int i=0; i < listeners.size(); i++) {
            EventBoundListener eventListener = (EventBoundListener)listeners.get(i);
           
            IComponent container = component.getContainer();
            if (container == null) // only IPage has no container
                container = component;
           
            IActionListener listener =
                container.getListeners().getListener(eventListener.getMethodName());
            _invoker.invokeListener(listener, container, cycle);
        }
    }
View Full Code Here

        List listeners = getFormEvents(id, event);
       
        for (int i=0; i < listeners.size(); i++) {
            EventBoundListener eventListener = (EventBoundListener)listeners.get(i);
           
            final IComponent container =
                (component.getContainer() == null) ? component : component.getContainer();
           
            final IActionListener listener =
                container.getListeners().getListener(eventListener.getMethodName());
           
            // defer execution until after form is done rewinding
            component.addDeferredRunnable(new Runnable()
            {
                public void run()
View Full Code Here

    public void testCreate()
    {
        ValueConverter vc = (ValueConverter) newMock(ValueConverter.class);

        MockControl componentc = newControl(IComponent.class);
        IComponent component = (IComponent) componentc.getMock();

        MockControl beanProviderc = newControl(IBeanProvider.class);
        IBeanProvider beanProvider = (IBeanProvider) beanProviderc.getMock();

        Location l = fabricateLocation(21);

        Object bean = new Object();

        component.getBeans();
        componentc.setReturnValue(beanProvider);

        beanProvider.getBean("fred");
        beanProviderc.setReturnValue(bean);
View Full Code Here

public class TestListenerMethodBinding extends BindingTestCase
{
    public void testGetObject()
    {
        MockControl cc = newControl(IComponent.class);
        IComponent component = (IComponent) cc.getMock();

        MockControl lmc = newControl(ListenerMap.class);
        ListenerMap lm = (ListenerMap) lmc.getMock();

        IActionListener listener = (IActionListener) newMock(IActionListener.class);

        component.getListeners();
        cc.setReturnValue(lm);

        lm.getListener("foo");
        lmc.setReturnValue(listener);
View Full Code Here

     *  
     *  @param objSettingsContainer the component from which to get the settings
     */
    public void loadSettings(IComponent objSettingsContainer)
    {
        IComponent objColumnRendererSource = (IComponent) objSettingsContainer.getComponents().get(getColumnName() + COLUMN_RENDERER_BLOCK_SUFFIX);
        if (objColumnRendererSource != null && objColumnRendererSource instanceof Block)
            setColumnRendererSource(new BlockTableRendererSource((Block) objColumnRendererSource));

        IComponent objValueRendererSource = (IComponent) objSettingsContainer.getComponents().get(getColumnName() + VALUE_RENDERER_BLOCK_SUFFIX);
        if (objValueRendererSource != null && objValueRendererSource instanceof Block)
            setValueRendererSource(new BlockTableRendererSource((Block) objValueRendererSource));
    }
View Full Code Here

    {
        Defense.isAssignable(parameter, DirectServiceParameter.class, "parameter");

        DirectServiceParameter dsp = (DirectServiceParameter) parameter;

        IComponent component = dsp.getDirect();

        // New since 1.0.1, we use the component to determine
        // the page, not the cycle. Through the use of tricky
        // things such as Block/InsertBlock, it is possible
        // that a component from a page different than
        // the response page will render.
        // In 1.0.6, we start to record *both* the render page
        // and the component page (if different).

        IPage activePage = cycle.getPage();
        IPage componentPage = component.getPage();

        Map parameters = new HashMap();

        boolean stateful = _request.getSession(false) != null;

        parameters.put(ServiceConstants.SERVICE, Tapestry.DIRECT_SERVICE);
        parameters.put(ServiceConstants.PAGE, activePage.getPageName());
        parameters.put(ServiceConstants.COMPONENT, component.getIdPath());
        parameters.put(ServiceConstants.CONTAINER, componentPage == activePage ? null
                : componentPage.getPageName());
        parameters.put(ServiceConstants.SESSION, stateful ? "T" : null);
        parameters.put(ServiceConstants.PARAMETER, dsp.getServiceParameters());

View Full Code Here

        cycle.activate(page);

        IPage componentPage = componentPageName == null ? page : cycle.getPage(componentPageName);

        IComponent component = componentPage.getNestedComponent(componentId);

        IDirect direct = null;

        try
        {
View Full Code Here

    }

    private void process(OpenToken token)
    {
        String id = token.getId();
        IComponent component = null;
        String componentType = token.getComponentType();

        if (componentType == null)
            component = getEmbeddedComponent(id);
        else
View Full Code Here

TOP

Related Classes of org.apache.tapestry.IComponent

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.