Package com.volantis.mcs.protocols

Examples of com.volantis.mcs.protocols.AnchorAttributes


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

        // Initialise our protocol attributes with an id attribute.
        String idValue = "the identifier value";
        AnchorAttributes attributes = new AnchorAttributes();
        attributes.setId(idValue);

        // Create the expected value for the name attribute output.
        String expectedNameValue = null;
        if (protocol.enableNameIdentification) {
            expectedNameValue = idValue;
View Full Code Here


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

        // Initialise our protocol attributes with an id attribute.
        String idValue = "the identifier value";
        AnchorAttributes attributes = new AnchorAttributes();
        attributes.setStyles(StylesBuilder.getInitialValueStyles());
        attributes.setId(idValue);

        // Create the expected value for the name attribute output.
        String expectedNameValue = null;
        if (protocol.enableNameIdentification) {
            expectedNameValue = idValue;
View Full Code Here

        ContextInternals.setMarinerPageContext(requestContext, context);
        testable.setStyleSheetRenderer(CSSStyleSheetRenderer.getSingleton());
        context.setDeviceName("PC-Win32-IE5.5");
        protocol.setMarinerPageContext(context);

        AnchorAttributes attributes = new AnchorAttributes();
        attributes.setStyles(StylesBuilder.getInitialValueStyles());

        // test no link style
        Element element = domFactory.createStyledElement(attributes.getStyles());
        protocol.addAnchorAttributes(element, attributes);
        assertEquals("no link style means no button attribute",
                null, element.getAttributeValue("button"));

        // test unrelated numeric shortcut link style
        attributes.setStyles(StylesBuilder.getCompleteStyles(
                "mcs-link-style: numeric-shortcut"));
        element = domFactory.createStyledElement(attributes.getStyles());
        protocol.addAnchorAttributes(element, attributes);
        assertEquals("unrelated link style means no button attribute",
                null, element.getAttributeValue("button"));

        // test proper button link style
        attributes.setStyles(StylesBuilder.getCompleteStyles(
                "mcs-link-style: button"));
        element = domFactory.createStyledElement(attributes.getStyles());
        protocol.addAnchorAttributes(element, attributes);
        assertEquals("button link style means button attribute",
                "button", element.getAttributeValue("button"));

    }
View Full Code Here

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

        renderer.open(buffer, item);

        AnchorAttributes attributes = (AnchorAttributes)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

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

        // Initialise our protocol attributes with an id attribute.
        String idValue = "the identifier value";
        AnchorAttributes attributes = new AnchorAttributes();
        attributes.setId(idValue);

        // Create the expected value for the name attribute output.
        String expectedNameValue = null;
        if (protocol.enableNameIdentification) {
            expectedNameValue = idValue;
View Full Code Here

    };

    public AnchorElement(XDIMEContextInternal context) {
        super(XHTML2Elements.A, context);

        protocolAttributes = new AnchorAttributes();

        // Add anchor specific events.
        EVENTS.registerEvents(eventMapper);
    }
View Full Code Here

    // Javadoc inherited
    protected XDIMEResult callOpenOnProtocol(
            XDIMEContextInternal context, XDIMEAttributes attributes)
        throws XDIMEException {

      AnchorAttributes anchorAttributes = (AnchorAttributes) protocolAttributes;

      String id = anchorAttributes.getId();
     
      if (id != null) {
        String keyValue = (String) context.getIdToAccessKeyMap().get(id);
       
        if (keyValue != null) {
          anchorAttributes.setShortcut(new LiteralTextAssetReference(keyValue));
        }
      }
     
        VolantisProtocol protocol = getProtocol(context);
View Full Code Here

     */
    private void writeDefaultSegmentLink(MarinerPageContext pageContext,
                                           String defaultSegmentURL)
            throws IOException, RendererException {

        AnchorAttributes a = new AnchorAttributes();

        a.setHref(defaultSegmentURL);

        if (pageContext.getPageTagId() != null) {
            a.setId(pageContext.getPageTagId());
        }

        VolantisProtocol protocol = pageContext.getProtocol();
        try {
            protocol.writeDefaultSegmentLink(a);
View Full Code Here

     * class.
     *
     * NOTE: Close method removed.
     */
    public void testWriteOpenAnchor() throws Exception {
        final AnchorAttributes attributes =
                (AnchorAttributes) ProtocolIntegrationTestHelper.
                provideAttributes(AnchorAttributes.class);

        final VolantisProtocol protocol = getProtocol();

View Full Code Here

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

        final VolantisProtocol protocol = getProtocol();

View Full Code Here

TOP

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

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.