Package com.volantis.mcs.protocols

Examples of com.volantis.mcs.protocols.SpanAttributes


            }
        };

        protocol.setMarinerPageContext(context);

        SpanAttributes attributes = new SpanAttributes();
        attributes.setSrc(new LiteralTextAssetReference(text));

        DOMOutputBuffer buffer = new DOMOutputBuffer();
        buffer.initialise();

        protocol.openSpan(buffer, attributes);
View Full Code Here


            }
        };

        protocol.setMarinerPageContext(context);

        SpanAttributes attributes = new SpanAttributes();
        attributes.setSrc(new LiteralTextAssetReference(text));

        DOMOutputBuffer buffer = new DOMOutputBuffer();
        buffer.initialise();

        protocol.openSpan(buffer, attributes);
View Full Code Here

     * Test that the openSpan method behaves correctly when there is no
     * src attribute with a value it can use.
     */
    public void testOpenCloseSpanNoSrcAttribute() throws Exception {

        SpanAttributes attributes = new SpanAttributes();

        DOMOutputBuffer buffer = new DOMOutputBuffer();
        buffer.initialise();

        protocol.openSpan(buffer, attributes);
View Full Code Here

        // Render.
        TestDOMOutputBuffer buffer = new TestDOMOutputBuffer();

        renderer.open(buffer, item);
        SpanAttributes attributes = (SpanAttributes)PrivateAccessor.
                getField(renderer, "attributes");
        assertNotNull("MCS Attributes should not be null", attributes);
        Styles styles = attributes.getStyles();

        assertNotNull("The Styles on the MCS Attributes must not be null",
                styles);
        assertEquals("The styles on the MCS Attributes must be the same " +
                "as the styles on the ElementDetails",
View Full Code Here

                    // Is the idref's asset valid?
                    if (pageContext.getIdValue(attributes.getIdref()) == null) {
                        // We need to skip the tags but still send the plain
                        // markup wrapped in a span element.
                        skipped = true;
                        SpanAttributes spanAttributes = new SpanAttributes();
                        spanAttributes.setStyles(pattributes.getStyles());
                        protocol.writeOpenSpan(spanAttributes);
                        return PROCESS_ELEMENT_BODY;
                    }
                }
            }
View Full Code Here

        LocalizationFactory.createExceptionLocalizer(SpanElement.class);

    public SpanElement(XDIMEContextInternal context) {
        super(XHTML2Elements.SPAN, context);

        protocolAttributes = new SpanAttributes();
    }
View Full Code Here

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

        final VolantisProtocol protocol = getProtocol();

View Full Code Here

        // Open a placeholder span element for the widget
        // content, which will converted to the JavaScript string.
        // Generate a HTML ID for it, so that it can be referenced
        // from JavaScript code.
        placeholderSpanAttributes = new SpanAttributes();
       
        placeholderSpanAttributes.copy(attributes);
       
        if (placeholderSpanAttributes.getId() == null) {
            placeholderSpanAttributes.setId(protocol.getMarinerPageContext().generateUniqueFCID());
View Full Code Here

     */
    protected Element closeSpanElement(VolantisProtocol protocol)
            throws ProtocolException {
        // Pop span attributes from the stack.
        // Convert EmptyStackException to protocol exception.
        SpanAttributes spanAttributes;

        try {
            spanAttributes = popSpanAttributes();
        } catch (EmptyStackException e) {
            throw new ProtocolException("Span element not opened.");
View Full Code Here

     * @return Created span attributes.
     */
    protected SpanAttributes createSpanAttributes(VolantisProtocol protocol,
            MCSAttributes sourceAttributes, boolean generateDefaultId) {
        // Create new instance of SpanAttributes
        SpanAttributes spanAttributes = new SpanAttributes();

        // If source attributes are specified, copy all attribute values.
        if (sourceAttributes != null) {
            spanAttributes.copy(sourceAttributes);
        }

        // If styles are not specified, create new inherited styles.
        if (spanAttributes.getStyles() == null) {
            Styles styles = StylingFactory.getDefaultInstance()
                .createInheritedStyles(
                    protocol.getMarinerPageContext().getStylingEngine()
                            .getStyles(), DisplayKeywords.BLOCK);
           
            spanAttributes.setStyles(styles);
        }

        // If there's no ID attribute, and generateDefaultId flag is set,
        // generate unique value for it.
        if (generateDefaultId && spanAttributes.getId() == null) {
            spanAttributes.setId(protocol.getMarinerPageContext()
                    .generateUniqueFCID());
        }

        // Return created DivAttributes
        return spanAttributes;
View Full Code Here

TOP

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

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.