Package com.volantis.mcs.runtime.layouts

Examples of com.volantis.mcs.runtime.layouts.RuntimeDeviceLayout


     */
    private void pushAnonymousRegion(MarinerPageContext pageContext)
            throws XDIMEException {
        try {
            // Create a layout containing a simple region.
            RuntimeDeviceLayout anonymousLayout = createAnonymousRegionLayout();

            // Create a context for the layout and push it onto the page context.
            DeviceLayoutContext deviceLayoutContext = new DeviceLayoutContext();
            deviceLayoutContext.setMarinerPageContext(pageContext);
            deviceLayoutContext.setDeviceLayout(anonymousLayout);
            deviceLayoutContext.initialise();
            pageContext.pushDeviceLayoutContext(deviceLayoutContext);

            // Get an instance of the layout's region.
            Region region = (Region) anonymousLayout.getRootFormat();
            anonymousRegionInstance = (RegionInstance)
                    pageContext.getFormatInstance(region,
                            NDimensionalIndex.ZERO_DIMENSIONS);

            // Push the region instance onto the container stack.
View Full Code Here


        // Activate it to turn it into a runtime device layout
        LayoutContentActivator activator = new LayoutContentActivator();
        final ActivatedLayoutContent activatedLayoutContent =
                activator.activateLayoutContent(styleSheetActivator,
                        (InternalLayoutContent) layoutContent.getContent());
        RuntimeDeviceLayout runtimeLayout = new RuntimeLayoutAdapter(
                "<anonymous>", layout,
                activatedLayoutContent.getCompiledStyleSheet(),
                activatedLayoutContent.getContainerNameToFragments());

        return runtimeLayout;
View Full Code Here

     */
    private void pushAnonymousRegion(MarinerPageContext pageContext)
            throws XDIMEException {
        try {
            // Create a layout containing a simple region.
            RuntimeDeviceLayout anonymousLayout = createAnonymousRegionLayout();

            // Create a context for the layout and push it onto the page context.
            DeviceLayoutContext deviceLayoutContext = new DeviceLayoutContext();
            deviceLayoutContext.setMarinerPageContext(pageContext);
            deviceLayoutContext.setDeviceLayout(anonymousLayout);
            deviceLayoutContext.initialise();
            pageContext.pushDeviceLayoutContext(deviceLayoutContext);

            // Get an instance of the layout's region.
            Region region = (Region) anonymousLayout.getRootFormat();
            anonymousRegionInstance = (RegionInstance)
                    pageContext.getFormatInstance(region,
                            NDimensionalIndex.ZERO_DIMENSIONS);

            // Push the region instance onto the container stack.
View Full Code Here

        // Activate it to turn it into a runtime device layout
        LayoutContentActivator activator = new LayoutContentActivator();
        final ActivatedLayoutContent activatedLayoutContent =
                activator.activateLayoutContent(styleSheetActivator,
                        (InternalLayoutContent) layoutContent.getContent());
        RuntimeDeviceLayout runtimeLayout = new RuntimeLayoutAdapter(
                "<anonymous>", layout,
                activatedLayoutContent.getCompiledStyleSheet(),
                activatedLayoutContent.getContainerNameToFragments());

        return runtimeLayout;
View Full Code Here

     * @throws XDIMEException - if there was a problem finding the layout
     */
    private DeviceLayoutContext createDeviceLayoutContext(
            MarinerPageContext pageContext, String layoutName)
            throws XDIMEException {
        RuntimeDeviceLayout deviceLayout;
        try {
            deviceLayout = pageContext.getDeviceLayout(layoutName);

            // If a layout could not be found then fail immediately.
            if (deviceLayout == null) {
View Full Code Here

         * Layout objects
         */
        CanvasLayout canvasLayout =
            createDeviceLayout("Test Layout", "Master");

        RuntimeDeviceLayout runtimeDeviceLayout =
                RuntimeDeviceLayoutTestHelper.activate(canvasLayout);

        DeviceLayoutContext deviceLayoutContext = new DeviceLayoutContext();
        deviceLayoutContext.setMarinerPageContext(marinerPageContextMock);
        deviceLayoutContext.setDeviceLayout(runtimeDeviceLayout);
View Full Code Here

            protocol.setInclusion(inclusion);


            // Get the layout.
            if (layoutName != null) {
                RuntimeDeviceLayout deviceLayout =
                        getDeviceLayout(layoutName);
                if (deviceLayout == null) {
                    throw new LayoutException(EXCEPTION_LOCALIZER.format(
                            "no-suitable-device-layout",
                            new Object[]{layoutName,
View Full Code Here

            resolver.resolveUnquotedPolicyExpression(name,
                PolicyType.LAYOUT);

        SelectedVariant selected = assetResolver.selectBestVariant(
            reference, null);
        RuntimeDeviceLayout deviceLayout = null;

        if (selected != null) {
            deviceLayout = (RuntimeDeviceLayout)selected.getOldObject();
        }
View Full Code Here

                            MetaPropertyHandlerFactory.ENCLOSING_FRAGMENT_LINK_LABEL);

            // If no labels have been specified using meta data then there is
            // nothing to update the fragment instance with and so
            if (linkToLabel != null || linkFromLabel != null) {
                final RuntimeDeviceLayout deviceLayout =
                        pageContext.getDeviceLayoutContext().getDeviceLayout();
                final List fragments =
                        deviceLayout.getEnclosingFragments(containerName);
                for (Iterator iter = fragments.iterator(); iter.hasNext();) {
                    final LayoutContentActivator.ContainerPosition position =
                            (LayoutContentActivator.ContainerPosition) iter.next();
                    final Fragment fragment = position.getFragment();
View Full Code Here

                if (currentFragment != null) {
                    // Check the children of this fragment
                    currentFragment.visitChildren(visitor, null);
                } else {
                    // This is not a fragmented layout so use the layout root
                    RuntimeDeviceLayout layout = context.getDeviceLayout();
                    layout.getRootFormat().visit(visitor, null);
                }
            } catch (FormatVisitorException fve) {
                // Do nothing - if we can't visit we can't set a pane!
            }
View Full Code Here

TOP

Related Classes of com.volantis.mcs.runtime.layouts.RuntimeDeviceLayout

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.