Package com.volantis.mcs.protocols

Examples of com.volantis.mcs.protocols.GridAttributes


        context.setDevice(INTERNAL_DEVICE_FACTORY.createInternalDevice(
            new DefaultDevice(DEVICE_NAME, new HashMap(), null)));
        DOMOutputBuffer buffer = new DOMOutputBuffer();
        buffer.initialise();

        GridAttributes gridAttrs = new GridAttributes();
        gridAttrs.setStyles(StylesBuilder.getDeprecatedStyles());
        gridAttrs.setFormat(pane);

        protocol.openGrid(buffer, gridAttrs);

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


            new DefaultDevice(DEVICE_NAME, new HashMap(), null)));
        protocol.setMarinerPageContext(context);

        // INPUT: no style class, a device name that doesn't end with 'Netscape4'.
        // EXPECTED: Should result no borderwidth and style class.
        GridAttributes attributes = new GridAttributes();
        attributes.setStyles(StylesBuilder.getDeprecatedStyles());
        protocol.addGridAttributes(element, attributes);

        // INPUT: a device name that ends with 'Netscape4'.
        // EXPECTED: Should result in a '0' borderwidth and no style class.
        attributes = new GridAttributes();
        attributes.setStyles(StylesBuilder.getDeprecatedStyles());
        resetElement();
        context.setDeviceName("xxxxxxNetscape4");
        protocol.addGridAttributes(element, attributes);
    }
View Full Code Here

     * Prove that the column attribute is not added to the element by the
     * openGrid method
     */
    public void testOpenGrid() {
        privateSetUp();
        GridAttributes attributes = new GridAttributes();
        attributes.setStyles(StylesBuilder.getDeprecatedStyles());

        attributes.setFormat(new Form(new CanvasLayout()));
        buffer.addStyledElement("table", attributes);
        protocol.openGrid(buffer, attributes);
        Element e = buffer.getCurrentElement();
        assertNull(e.getAttributeValue("columns"));
    }
View Full Code Here

        context.setDeviceName("PC");
        protocol.setMarinerPageContext(context);

        // INPUT: no style class, a device name that doesn't end with 'Netscape4'.
        // EXPECTED: Should result no borderwidth and style class.
        GridAttributes attributes = new GridAttributes();
        protocol.addGridAttributes(element, attributes);

        // INPUT: a device name that ends with 'Netscape4'.
        // EXPECTED: Should result in a '0' borderwidth and no style class.
        attributes = new GridAttributes();
        attributes.setStyles(StylesBuilder.getDeprecatedStyles());
        element = domFactory.createElement();
        element.setName("testElement");
        context.setDeviceName("xxxxxxNetscape4");
        protocol.addGridAttributes(element, attributes);
    }
View Full Code Here

            throws RendererException {

        Grid grid = (Grid) gridInstance.getFormat();

        // Initialise the attributes.
        GridAttributes attributes = gridInstance.getAttributes();

        TableLayers layers = new TableLayers();

        // Style the grid, and then style all of its columns.
        FormatStylingEngine formatStylingEngine =
                context.getFormatStylingEngine();
        Styles formatStyles = formatStylingEngine.startStyleable(
                grid, grid.getStyleClass());
        layers.setLayer(TableLayers.TABLE, formatStyles);

        attributes.setStyles(formatStyles);
        attributes.setLayers(layers);

        // Style the columns so that we can pick up the height and any
        // other properties associated with the column's style class
        // if any.

        // Style the group of columns. This is to simply group the grid columns
        // together within a single element to simplify the use of those
        // selectors that rely on the position of an element within its parent,
        // e.g. nth-child().
        Styles columnGroupStyles = formatStylingEngine.startStyleable(
                SyntheticStyleableFormat.GRID_COLUMNS,
                null);
        layers.setLayer(TableLayers.COLUMN_GROUP, columnGroupStyles);

        Styles[] columnStyles = getColumnStyles(grid, formatStylingEngine,
                requiredColumns);

        formatStylingEngine.endStyleable(
                SyntheticStyleableFormat.GRID_COLUMNS);

        if (logger.isDebugEnabled()) {
            logger.debug("Grid.writeOutput()");
        }

        attributes.setColumns(columns);

        // Should the order of the columns be reversed,
        // false = 0...n, true = n...0
        boolean reversed =
                DirectionHelper.isDirectionReversed(grid, formatStyles);

        // Open the grid, even if no rows are written
        attributes.setFormat(grid);
        module.writeOpenGrid(attributes);

        // Style the group of rows. See the comment in getColumnStyles().
        Styles bodyStyles = formatStylingEngine.startStyleable(
                SyntheticStyleableFormat.GRID_BODY, null);
View Full Code Here

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

        final VolantisProtocol protocol = getProtocol();

View Full Code Here

    /**
     * Create a new <code>GridInstance</code>.
     */
    public GridInstance(NDimensionalIndex index) {
        super(index);
        attributes = new GridAttributes();
        rowAttributes = new GridRowAttributes();
        childAttributes = new GridChildAttributes();
    }
View Full Code Here

TOP

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

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.