Package org.apache.tapestry5.internal.structure

Examples of org.apache.tapestry5.internal.structure.ComponentPageElement


        verify();
    }

    protected final void train_getBlock(Page page, String blockId, Block block)
    {
        ComponentPageElement element = mockComponentPageElement();
        train_getRootElement(page, element);

        expect(element.getBlock(blockId)).andReturn(block);
    }
View Full Code Here


        TrackableComponentEventCallback callback = new ComponentResultProcessorWrapper(resultProcessor);

        environment.push(ComponentEventResultProcessor.class, resultProcessor);
        environment.push(TrackableComponentEventCallback.class, callback);

        ComponentPageElement element = containerPage.getComponentElementByNestedId(parameters.getNestedComponentId());

        boolean handled = element.triggerContextEvent(parameters.getEventType(), parameters.getEventContext(), callback);

        if (!handled)
        {
            throw new TapestryException(String.format("Request event '%s' (on component %s) was not handled; you must provide a matching event handler method in the component or in one of its containers.", parameters.getEventType(), element.getCompleteId()), element,
                    null);
        }

        environment.pop(TrackableComponentEventCallback.class);
        environment.pop(ComponentEventResultProcessor.class);
View Full Code Here

        request.setAttribute(InternalConstants.CONTENT_TYPE_ATTRIBUTE_NAME, contentType);

        Page containerPage = cache.get(parameters.getContainingPageName());

        ComponentPageElement element = containerPage.getComponentElementByNestedId(parameters.getNestedComponentId());

        // In many cases, the triggered element is a Form that needs to be able to
        // pass its event handler return values to the correct result processor.
        // This is certainly the case for forms.

        TrackableComponentEventCallback callback = new ComponentResultProcessorWrapper(interceptor);

        environment.push(ComponentEventResultProcessor.class, interceptor);
        environment.push(TrackableComponentEventCallback.class, callback);

        boolean handled = element
                .triggerContextEvent(parameters.getEventType(), parameters.getEventContext(), callback);

        if (!handled)
            throw new TapestryException(ServicesMessages.eventNotHandled(element, parameters.getEventType()), element,
                    null);
View Full Code Here

    @Test
    public void nested_element_within_page()
    {
        RequestPageCache cache = mockRequestPageCache();
        Page page = mockPage();
        ComponentPageElement element = mockComponentPageElement();
        Component component = mockComponent();

        train_get(cache, PAGE_NAME, page);

        train_getComponentElementByNestedId(page, NESTED_ELEMENT_ID, element);
View Full Code Here

    @Test
    public void encoding_in_content_type()
    {
        RequestPageCache cache = mockRequestPageCache();
        Page page = mockPage();
        ComponentPageElement element = mockComponentPageElement();
        InternalComponentResources resources = mockInternalComponentResources();
        MetaDataLocator locator = mockMetaDataLocator();
        Request request = mockRequest();
        String pageName = "MyPage";
View Full Code Here

    @Test
    public void encoding_on_second_meta_data()
    {
        RequestPageCache cache = mockRequestPageCache();
        Page page = mockPage();
        ComponentPageElement element = mockComponentPageElement();
        InternalComponentResources resources = mockInternalComponentResources();
        MetaDataLocator locator = mockMetaDataLocator();
        Request request = mockRequest();
        String pageName = "MyPage";
        String encoding = "ostritch";
View Full Code Here

        RequestPageCache cache = mockRequestPageCache();
        Page page = mockPage();
        ComponentResources resources = mockComponentResources();
        Component component = mockComponent();
        ComponentPageElement element = mockComponentPageElement();
        PageRenderQueue queue = mockPageRenderQueue();

        train_getComponentResources(component, resources);
        train_getPageName(resources, pageName);
        train_get(cache, pageName, page);
View Full Code Here

        RequestPageCache cache = mockRequestPageCache();
        Page page = mockPage();
        ComponentResources resources = mockComponentResources();
        Component component = mockComponent();
        ComponentPageElement element = mockComponentPageElement();
        PageRenderQueue queue = mockPageRenderQueue();

        train_getComponentResources(component, resources);
        train_getPageName(resources, pageName);
        train_get(cache, pageName, page);
View Full Code Here

    public void page_link()
    {
        Request request = mockRequest();
        Response response = mockResponse();
        Page page = mockPage();
        ComponentPageElement rootElement = mockComponentPageElement();
        LinkFactoryListener listener = mockLinkFactoryListener();
        ComponentInvocationMap map = mockComponentInvocationMap();
        RequestPathOptimizer optimizer = mockRequestPathOptimizer();
        RequestSecurityManager securityManager = mockRequestSecurityManager();
View Full Code Here

    public void secure_page_link()
    {
        Request request = mockRequest();
        Response response = mockResponse();
        Page page = mockPage();
        ComponentPageElement rootElement = mockComponentPageElement();
        LinkFactoryListener listener = mockLinkFactoryListener();
        ComponentInvocationMap map = mockComponentInvocationMap();
        RequestPathOptimizer optimizer = mockRequestPathOptimizer();
        RequestSecurityManager securityManager = mockRequestSecurityManager();
View Full Code Here

TOP

Related Classes of org.apache.tapestry5.internal.structure.ComponentPageElement

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.