Package com.volantis.mcs.protocols.layouts

Examples of com.volantis.mcs.protocols.layouts.RegionInstance


        pageContext.pushDeviceLayoutContext(deviceLayoutContext);
        MarinerURL requestURL = new MarinerURL();
        pageContext.setRequestURL(requestURL);

        // Need to setup a region instance for testing inclusions
        RegionInstance regionInstance =
                new RegionInstance(new NDimensionalIndex(new int[1]));
        regionInstance.setDeviceLayoutContext(deviceLayoutContext);

        pageContext.pushContainerInstance(regionInstance);
    }
View Full Code Here


        pageContext.setProtocol(protocol);

        // Create a region
        Region region = new Region((CanvasLayout) layout);

        RegionInstance instance =
                (RegionInstance) dlContext.getFormatInstance(region,
                NDimensionalIndex.ZERO_DIMENSIONS);
        RegionContent content = new RegionContent() {
            public void render(FormatRendererContext ctx) {
                OutputBufferStack outputBufferStack = ctx.getOutputBufferStack();
                DOMOutputBuffer buffer = (DOMOutputBuffer)
                        outputBufferStack.getCurrentOutputBuffer();
                buffer.openElement(buffer.allocateElement("regionContent"));
                buffer.closeElement("regionContent");
            }
        };
        RegionContent content2 = new RegionContent() {
            public void render(FormatRendererContext ctx) {
                OutputBufferStack outputBufferStack = ctx.getOutputBufferStack();
                DOMOutputBuffer buffer = (DOMOutputBuffer)
                        outputBufferStack.getCurrentOutputBuffer();
                buffer.openElement(buffer.allocateElement("regionContent2"));
                buffer.closeElement("regionContent2");
            }
        };
        instance.addRegionContent(content);
        instance.addRegionContent(content2);

        //Render the format
        FormatRenderer renderer = new RegionRenderer();
        renderer.render(formatRendererContext, instance);
View Full Code Here

        pageContext.setProtocol(protocol);

        // Create a region
        Region region = new Region((CanvasLayout) layout);

        RegionInstance instance =
                (RegionInstance) dlContext.getFormatInstance(region,
                NDimensionalIndex.ZERO_DIMENSIONS);

        RegionContent content = new RegionContent() {
            public void render(FormatRendererContext ctx) {
                OutputBufferStack outputBufferStack = ctx.getOutputBufferStack();
                DOMOutputBuffer buffer = (DOMOutputBuffer)
                        outputBufferStack.getCurrentOutputBuffer();
                buffer.openElement(buffer.allocateElement("regionContent"));
                buffer.closeElement("regionContent");
            }
        };

        instance.getCurrentBuffer().writeText("   \n");
        instance.addRegionContent(content);
        instance.getCurrentBuffer().writeText("   \n");

        //Render the format
        FormatRenderer renderer = new RegionRenderer();
        renderer.render(formatRendererContext, instance);
View Full Code Here

             deviceLayoutContext.initialise();
             pageContext.pushDeviceLayoutContext(deviceLayoutContext);
        
             // Get an instance of the layout's region.
             Region region = (Region) anonymousLayout.getRootFormat();
             RegionInstance anonymousRegionInstance = (RegionInstance)
                     pageContext.getFormatInstance(region,
                             NDimensionalIndex.ZERO_DIMENSIONS);
        
             return anonymousRegionInstance;
            
View Full Code Here

        }

        // Javadoc inherited from super class.
        public boolean visit(Region format, Object object) {

            initialiseFormatInstance(new RegionInstance(index), format);
            // Only visit the topmost format.
            return true;
        }
View Full Code Here

    // javadoc inherited
    public void render(final FormatRendererContext context, final FormatInstance instance)
            throws RendererException {
        if (!instance.isEmpty()) {
            Region region = (Region) instance.getFormat();
            RegionInstance regionInstance = (RegionInstance) instance;

            if (logger.isDebugEnabled()) {
                logger.debug("Rendering region " + region.getName()
                             + " in '" + context.getInclusionPath() + "'");

                // Get the protocol
            }

            // Get the RegionContent which should be rendered inside this
            // region.
            RegionContent content = regionInstance.getRegionContent();
            content.render(context);
        }
    }
View Full Code Here

        // Get the specified container - may be null.
        DeviceLayoutContext layoutContext =
                getSpecifiedLayout(layout, pageContext);

        // If a layout was specified, then ensure it is allowed in this context.
        RegionInstance containingRegion = null;
        if (layoutContext != null) {
            ContainerInstance containingInstance =
                        pageContext.getCurrentContainerInstance();

            // Make sure that the containing instance is a region.
View Full Code Here

            logger.debug("Root page URL is " + rootPageURL);
        }

        // Get the enclosing region context.
        String inclusionPath = null;
        RegionInstance includingRegionInstance = null;
        if (inclusionState) {
            includingRegionInstance
                    = getEnclosingRegionInstance();
        }
View Full Code Here

        // cleaning up the page which had the error.
        boolean isErrorPage = "error".equals(attributes.getPageUsage());

        // Get the enclosing canvas's type, region context if any.
        String enclosingCanvasType = null;
        RegionInstance regionInstance = null;
        if (pageContext.peekCanvasType() != null) {
            enclosingCanvasType = pageContext.peekCanvasType();
            regionInstance = pageContext.getEnclosingRegionInstance();
        }
View Full Code Here

TOP

Related Classes of com.volantis.mcs.protocols.layouts.RegionInstance

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.