Package com.volantis.mcs.layouts

Examples of com.volantis.mcs.layouts.DissectingPane


        String prevLink = "TestPreviousShardLink";
        String prevClass = "TestPreviousShardLinkClass";
        String maxContentSize = "100";
        boolean nextLinkFirst = true;

        DissectingPane pane = new DissectingPane(canvasLayout);
        pane.setName(paneName);
        pane.setAttribute(FormatConstants.NEXT_SHARD_SHORTCUT_ATTRIBUTE,
                          nextShortcut);
        pane.setAttribute(FormatConstants.NEXT_SHARD_LINK_TEXT_ATTRIBUTE,
                          nextLink);
        pane.setAttribute(FormatConstants.NEXT_SHARD_LINK_CLASS_ATTRIBUTE,
                          nextClass);
        pane.setAttribute(FormatConstants.PREVIOUS_SHARD_SHORTCUT_ATTRIBUTE,
                          prevShortcut);
        pane.setAttribute(FormatConstants.PREVIOUS_SHARD_LINK_TEXT_ATTRIBUTE,
                          prevLink);
        pane.setAttribute(FormatConstants.PREVIOUS_SHARD_LINK_CLASS_ATTRIBUTE,
                          prevClass);
        pane.setAttribute(FormatConstants.MAXIMUM_CONTENT_SIZE_ATTRIBUTE, maxContentSize);

        DissectingPaneAttributes atts = new DissectingPaneAttributes();
        atts.setDissectingPane(pane);
        atts.setInclusionPath(inclusionPath);
        atts.setIsNextLinkFirst(nextLinkFirst);
View Full Code Here


        String prevShortcut = "TestPreviousShardShortcut";
        String prevLink = "TestPreviousShardLink";
        String prevClass = "TestPreviousShardLinkClass";
        boolean nextLinkFirst = true;

        DissectingPane pane = new DissectingPane(canvasLayout);
        pane.setName(paneName);
        pane.setAttribute(FormatConstants.NEXT_SHARD_SHORTCUT_ATTRIBUTE,
                          nextShortcut);
        pane.setAttribute(FormatConstants.NEXT_SHARD_LINK_CLASS_ATTRIBUTE,
                          nextClass);
        pane.setAttribute(FormatConstants.PREVIOUS_SHARD_SHORTCUT_ATTRIBUTE,
                          prevShortcut);
        pane.setAttribute(FormatConstants.PREVIOUS_SHARD_LINK_CLASS_ATTRIBUTE,
                          prevClass);

        // Activate the device layout.
        RuntimeDeviceLayout runtimeDeviceLayout =
                RuntimeDeviceLayoutTestHelper.activate(canvasLayout);
View Full Code Here

        String prevLink = "TestPreviousShardLink";
        String prevClass = "TestPreviousShardLinkClass";
        String maxContentSize = "100";
        boolean nextLinkFirst = true;

        DissectingPane pane = new DissectingPane(canvasLayout);
        pane.setName(paneName);
        pane.setAttribute(FormatConstants.NEXT_SHARD_SHORTCUT_ATTRIBUTE,
                          nextShortcut);
        pane.setAttribute(FormatConstants.NEXT_SHARD_LINK_TEXT_ATTRIBUTE,
                          nextLink);
        pane.setAttribute(FormatConstants.NEXT_SHARD_LINK_CLASS_ATTRIBUTE,
                          nextClass);
        pane.setAttribute(FormatConstants.PREVIOUS_SHARD_SHORTCUT_ATTRIBUTE,
                          prevShortcut);
        pane.setAttribute(FormatConstants.PREVIOUS_SHARD_LINK_TEXT_ATTRIBUTE,
                          prevLink);
        pane.setAttribute(FormatConstants.PREVIOUS_SHARD_LINK_CLASS_ATTRIBUTE,
                          prevClass);
        pane.setAttribute(FormatConstants.MAXIMUM_CONTENT_SIZE_ATTRIBUTE,
                          maxContentSize);

        DissectingPaneAttributes atts = new DissectingPaneAttributes();
        atts.setDissectingPane(pane);
        atts.setInclusionPath(inclusionPath);
View Full Code Here

        activateAndSetDeviceLayout();

        assertSame(pane, context.getPane("pane"));

        Fragment fragment = new Fragment(canvasLayout);
        Format dp = new DissectingPane(canvasLayout);
        dp.setName("dissectingPane");
        canvasLayout.removeFormat(dp);
        fragment.addFormat(dp);

        activateAndSetDeviceLayout();
View Full Code Here

        pane.setName("pane");


        assertSame(pane, context.getPane("pane"));

        Format dp = new DissectingPane(canvasLayout);
        dp.setName("dissectingPane");
        canvasLayout.removeFormat(dp);
        fragment.addFormat(dp);

        context.setCurrentFragment(fragment);
View Full Code Here

        String prevLink = "TestPreviousShardLink";
        String prevClass = "TestPreviousShardLinkClass";

        // Create the DissectingPaneAttributes from the test data.
        CanvasLayout canvasLayout = new CanvasLayout();
        DissectingPane pane = new DissectingPane(canvasLayout);
        pane.setName(paneName);
        pane.setAttribute(FormatConstants.NEXT_SHARD_SHORTCUT_ATTRIBUTE,
                          nextShortcut);
        pane.setAttribute(FormatConstants.NEXT_SHARD_LINK_CLASS_ATTRIBUTE,
                          nextClass);
        pane.setAttribute(FormatConstants.PREVIOUS_SHARD_SHORTCUT_ATTRIBUTE,
                          prevShortcut);
        pane.setAttribute(FormatConstants.PREVIOUS_SHARD_LINK_CLASS_ATTRIBUTE,
                          prevClass);
        DissectingPaneAttributes attributes = new DissectingPaneAttributes();
        attributes.setLinkText(nextLink);
        attributes.setBackLinkText(prevLink);
        attributes.setDissectingPane(pane);
View Full Code Here

     * @param attributes the dissecting pane attributes to use as input.
     * @return the created extended menu.
     */
    public ShardLinkMenu buildShardLinkMenuModel(DissectingPaneAttributes attributes) {
       
        DissectingPane pane = attributes.getDissectingPane();
        Styles styles = attributes.getStyles();

        // Create the next shard link.
        // todo style these properly somehow.
        ShardLinkMenuItem nextLink = createShardLinkMenuItem(true,
                attributes.getLinkText(),
                styles, pane.getNextShardShortcut());

        // Create the previous shard link.
        // todo style these property somehow.
        ShardLinkMenuItem previousLink = createShardLinkMenuItem(false,
                attributes.getBackLinkText(),
                styles, pane.getPreviousShardShortcut());

        // Create the shard link menu with appropriate attributes.
        ShardLinkMenu menu = createShardLinkMenu(pane.getName(),
                attributes.getInclusionPath(),
                styles);

        // Add the shard link items to the menu in the correct order.
        if (attributes.isNextLinkFirst()) {
View Full Code Here

    protected void renderPaneInstance(
            FormatRendererContext context,
            AbstractPaneInstance abstractPaneInstance)
            throws IOException, ProtocolException {

        DissectingPane pane = (DissectingPane) abstractPaneInstance.getFormat();
        String inclusionPath = context.getInclusionPath();
        DissectingPaneInstance paneInstance = (DissectingPaneInstance)
                abstractPaneInstance;

        // Initialise the attributes.
        DissectingPaneAttributes attributes =
                factory.createDissectingPaneAttributes();

        // Copy the tagname and style class from the old attributes
        // Dont just throw them away.
        PaneAttributes oldattr = paneInstance.getAttributes();
        attributes.setStyles(oldattr.getStyles());

        attributes.setInclusionPath(inclusionPath);
        attributes.setDissectingPane(pane);
        attributes.setIsNextLinkFirst(pane.isNextLinkFirst());
        attributes.setLinkText(paneInstance.getLinkToText());
        attributes.setBackLinkText(paneInstance.getLinkFromText());

        // If the output is going to be dissected then write a protocol
        // specific marker in the text which the protocol parser will
View Full Code Here

     */
    private void addDissectingPaneAttributes(
            DOMOutputBuffer dom,
            DissectingPaneAttributes attributes) {

        DissectingPane pane = attributes.getDissectingPane();
        Element element =
                dom.openElement(VDXMLConstants.PSEUDO_DISSECTION_CONTENT);

        // Save the pane so it can be used when handling the standard
        // pane attributes.
        element.getParent().setObject(pane);

        // Now do the next/previous help information
        if (helpZonePane != null) {
            // It is only possible to set the next and previous text links
            // if there is a help area in which to put them!
            String value;

            // Set next stuff - actual link not needed as NEXT/PREVIOUS used
            String nextText = null;
            if ((value = attributes.getLinkText()) != null) {
                 nextText = value;
            } else if ((value = pane.getNextShardLinkText()) != null ) {
                nextText = value;
            }
            MCSAttributes nextStyle = null;
            // todo XDIME-CP style dissection correctly.
            if (((value = pane.getNextShardLinkClass()) != null) &&
                !"".equals(value)){
//                attributes.setStyleClass(value);
                nextStyle = attributes;
            }

            // Set previous stuff - actual link not needed as NEXT/PREVIOUS used
            String prevText = null;
            if ((value = attributes.getBackLinkText()) != null) {
                prevText = value;
            } else if ((value = pane.getPreviousShardLinkText()) != null ) {
                prevText = value;
            }
            MCSAttributes prevStyle = null;
            // todo XDIME-CP style dissection correctly.
            if (((value = pane.getPreviousShardLinkClass()) != null) &&
                !"".equals(value)) {
//                attributes.setStyleClass(value);
                prevStyle = attributes;
            }

View Full Code Here

            // not have a maximum page size but an explicit limit has been set
            // on this pane then we need to generate markup and remember that
            // we need to dissect the page's contents.
            String value;
            boolean dissectionNeeded = true;
            DissectingPane pane = attributes.getDissectingPane();
            String maxContentSize;

            if (!isDissecting()) {
                if (logger.isDebugEnabled()) {
                    logger.debug("Dissecting not required for total page " +
                                 "size but may be required for this pane");
                }

                if ((maxContentSize = pane.getMaximumContentSize()) == null) {
                    if (logger.isDebugEnabled()) {
                        logger.debug("Dissecting not required for this pane");
                    }

                    dissectionNeeded = false;
                }
            } else {
                if (logger.isDebugEnabled()) {
                    logger.debug("Dissecting required");
                }

                maxContentSize = pane.getMaximumContentSize();
            }

            if (logger.isDebugEnabled()) {
                logger.debug("Maximum content size is set to " +
                             maxContentSize);
            }

            if (dissectionNeeded) {
                // Dissection is needed because we are generating mark up for a
                // dissecting pane.
                setDissectionNeeded(true);

                Element element = dom.openElement(DISSECTABLE_CONTENTS_ELEMENT);
                addCoreAttributes(element, attributes);
               
                Element parent = element.getParent();
                if (parent != null && parent.getStyles() != null) {
                    element.setStyles(StylingFactory.getDefaultInstance()
                            .createInheritedStyles(parent.getStyles(), null));
                    if (logger.isDebugEnabled()) {
                        logger.debug("Setting parent styles");
                    }
                }
               
                if ((value = attributes.getInclusionPath()) != null) {
                    element.setAttribute(INCLUSION_PATH_ATTRIBUTE, value);
                }

                element.setAttribute(DISSECTING_PANE_NAME_ATTRIBUTE,
                                     pane.getName());

//                if ((value = attributes.getStyleClass()) != null) {
//                    element.setAttribute(DISSECTING_PANE_CLASS_ATTRIBUTE,
//                                         value);
//                }

                if ((value = pane.getNextShardShortcut()) != null) {
                    element.setAttribute(NEXT_SHARD_SHORTCUT_ATTRIBUTE,
                                         value);
                }

                if ((value = attributes.getLinkText()) != null) {
                    element.setAttribute(NEXT_SHARD_LINK_TEXT_ATTRIBUTE,
                                         value);
                } else if(( value = pane.getNextShardLinkText()) != null ) {
                    element.setAttribute (NEXT_SHARD_LINK_TEXT_ATTRIBUTE,
                                          value);
                }

                if ((value = pane.getPreviousShardShortcut()) != null) {
                    element.setAttribute(PREVIOUS_SHARD_SHORTCUT_ATTRIBUTE,
                                         value);
                }

                if ((value = attributes.getBackLinkText()) != null) {
                    element.setAttribute(PREVIOUS_SHARD_LINK_TEXT_ATTRIBUTE,
                                         value);
                } else if(( value = pane.getPreviousShardLinkText()) != null ) {
                    element.setAttribute (PREVIOUS_SHARD_LINK_TEXT_ATTRIBUTE, value);
                }

                // set the GENERATE_NEXT_LINK_FIRST_ATTRIBUTE attribute
                // the DissectingPaneAttributes isNextLinkFirst() method
View Full Code Here

TOP

Related Classes of com.volantis.mcs.layouts.DissectingPane

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.