Package com.volantis.mcs.protocols

Examples of com.volantis.mcs.protocols.ColumnIteratorPaneAttributes


    public void testOpenColumnIteratorPaneCellspacing() throws Exception {
        privateSetUp();
        DOMOutputBuffer buffer = new DOMOutputBuffer();
        buffer.initialise();

        ColumnIteratorPaneAttributes cipAttrs =
                new ColumnIteratorPaneAttributes();
        cipAttrs.setStyles(StylesBuilder.getDeprecatedStyles());
        cipAttrs.setPane(pane);
        cipAttrs.setFormat(pane);

        protocol.openColumnIteratorPane(buffer, cipAttrs);

        buffer.closeElement("tr");
        Element table = buffer.closeElement("table");
View Full Code Here


            final String expectedUnstyledAttributes,
            final String expectedStyledAttributes)
            throws Exception {

        doAddPaneAttributesTest(
                new ColumnIteratorPaneAttributes(),
                new InvokeElementAttributesMethod() {
                    public void invoke(Element element, MCSAttributes attributes) {

                        ColumnIteratorPaneAttributes iteratorPaneAttributes =
                                (ColumnIteratorPaneAttributes) attributes;

                        // Assign an optimization level
                        iteratorPaneAttributes.getPane().setOptimizationLevel(
                                FormatConstants.OPTIMIZATION_LEVEL_VALUE_LITTLE_IMPACT);

                        protocol.addColumnIteratorPaneAttributes(
                                element, iteratorPaneAttributes);
                    }
View Full Code Here

        context.setDeviceName("Master");
        protocol.setMarinerPageContext(context);
        MutablePropertyValues properties = createPropertyValues();

        Element element = domFactory.createElement();
        ColumnIteratorPaneAttributes attrs =
                new ColumnIteratorPaneAttributes();
        Pane pane = new Pane(new CanvasLayout());
        // Mimic an element created by openColumnIteratorPane and assign
        // an optimization level
        element.setName("table");
        pane.setOptimizationLevel(
                FormatConstants.OPTIMIZATION_LEVEL_VALUE_LITTLE_IMPACT);
        attrs.setPane(pane);

        protocol.addColumnIteratorPaneAttributes(element, attrs);

//        String cellpadding = element.getAttributeValue("cellpadding");
//        assertNull("cellpadding attribute should not have been set as " +
//                "stylesheets are supported.", cellpadding);

        String cellspacing = element.getAttributeValue("cellspacing");
        assertNull("cellspacing attribute should not have been set as " +
                "stylesheets are supported.", cellspacing);

        String border = element.getAttributeValue("border");
        assertNull("border attribute should not have been set as " +
                "stylesheets are supported.", border);

        // Test for optimization - attributes should have been applied if
        // format optimization is supported, and should not have been
        // applied otherwise.
        String optimizationLevel = element.getAttributeValue(
                OptimizationConstants.OPTIMIZATION_ATTRIBUTE);

        Field inlineSupport = VolantisProtocol.
                class.getDeclaredField("supportsInlineStyles");
        boolean inlineAccessible = inlineSupport.isAccessible();
        inlineSupport.setAccessible(true);

        boolean inlineOrigValue = inlineSupport.getBoolean(protocol);
        inlineSupport.setBoolean(protocol, false);

        Field externalSupport = VolantisProtocol.
                class.getDeclaredField("supportsExternalStyleSheets");
        boolean externalAccessible = externalSupport.isAccessible();
        externalSupport.setAccessible(true);

        boolean externalOrigValue = externalSupport.getBoolean(protocol);
        externalSupport.setBoolean(protocol, false);


        element = domFactory.createElement();
        protocol.addColumnIteratorPaneAttributes(element, attrs);

//        cellpadding = element.getAttributeValue("cellpadding");
//        assertNull("cellpadding attribute should have not have been set as " +
//                "cell padding is not supported in i-mode", cellpadding);

        cellspacing = element.getAttributeValue("cellspacing");
        assertNull("cellspacing attribute should have not have been set as " +
                "cellspacing is not supported in i-mode.", cellspacing);

        border = element.getAttributeValue("border");
        assertNull("border attribute should have not have been set as " +
                "border is not supported in i-mode.", border);

        element = domFactory.createElement();
        attrs = new ColumnIteratorPaneAttributes();
        attrs.setStyles(StylesBuilder.getStyles(
                "border-width: 2px; " +
                "border-spacing: 2px"));
//        attrs.setBorderWidth("2");
//        attrs.setCellPadding("2");
//        attrs.setCellSpacing("2");
View Full Code Here

                abstractPaneInstance.getFormat();
        ColumnIteratorPaneInstance paneInstance = (ColumnIteratorPaneInstance)
                abstractPaneInstance;

        // Get the attributes.
        ColumnIteratorPaneAttributes attributes = (ColumnIteratorPaneAttributes)
                paneInstance.getAttributes();

        if (logger.isDebugEnabled()) {
            logger.debug("ColumnIteratorFormat.writeOutput() for "
                         + pane.getName());
        }

        // Get the module.
        LayoutModule module = context.getLayoutModule();

        // Write out our pane preamble
        module.writeOpenColumnIteratorPane(attributes);

        Iterator itr =
                paneInstance.getBufferIterator();
        while (itr.hasNext()) {
            Object o = itr.next();
            if (o instanceof OutputBuffer) {
                OutputBuffer contentBuffer = (OutputBuffer) o;
                if (!contentBuffer.isEmpty()) {

                    // Copy the attributes because the rendering process
                    // destroys the styles.
                    ColumnIteratorPaneAttributes paneElementAttributes =
                            new ColumnIteratorPaneAttributes();
                    paneElementAttributes.copy(attributes);

                    // Write out the element preamble
                    module.writeOpenColumnIteratorPaneElement(
                            attributes);
View Full Code Here

     * com.volantis.mcs.protocols.VolantisProtocol class.
     * <p>
     * NOTE: Close method removed.
     */
    public void testWriteOpenColumnIteratorPane() throws Exception {
        final ColumnIteratorPaneAttributes attributes =
                (ColumnIteratorPaneAttributes) ProtocolIntegrationTestHelper.
                provideAttributes(ColumnIteratorPaneAttributes.class);

        final VolantisProtocol protocol = getProtocol();

        attributes.setPane(new Pane(new CanvasLayout()));

        MethodInvoker invoker = new MethodInvoker() {
            public void invoke() throws Exception {
                protocol.writeOpenColumnIteratorPane(attributes);
                protocol.writeCloseColumnIteratorPane(attributes);
View Full Code Here

     * This method tests the method public void
     * writeOpenColumnIteratorPaneElement ( ColumnIteratorPaneAttributes ) for
     * the com.volantis.mcs.protocols.VolantisProtocol class.
     */
    public void testWriteOpenColumnIteratorPaneElement() throws Exception {
        final ColumnIteratorPaneAttributes attributes =
                (ColumnIteratorPaneAttributes) ProtocolIntegrationTestHelper.
                provideAttributes(ColumnIteratorPaneAttributes.class);

        attributes.setPane(new Pane(new CanvasLayout()));
        final VolantisProtocol protocol = getProtocol();

        MethodInvoker invoker = new MethodInvoker() {
            public void invoke() throws Exception {
                protocol.writeOpenColumnIteratorPaneElement(attributes);
View Full Code Here

    /**
     * Create a new <code>ColumnIteratorPaneInstance</code>.
     */
    public ColumnIteratorPaneInstance(NDimensionalIndex index) {
        super(index);
        attributes = new ColumnIteratorPaneAttributes();
    }
View Full Code Here

TOP

Related Classes of com.volantis.mcs.protocols.ColumnIteratorPaneAttributes

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.