Examples of AnchorAttributes


Examples of com.volantis.mcs.papi.AnchorAttributes

     */
    public void testInitialiseFocusEventAttributes() throws Exception {
        final String ON_BLUR = "OnBlur";
        final String ON_FOCUS = "OnFocus";

        AnchorAttributes papiAttributes = new AnchorAttributes();
        doTestInitialiseFocusEventAttribute(papiAttributes,
                                             EventConstants.ON_BLUR,
                                             null);

        // Valid on change
        papiAttributes.setOnBlur(ON_BLUR);
        doTestInitialiseFocusEventAttribute(papiAttributes,
                                             EventConstants.ON_BLUR,
                                             ON_BLUR);

        // Valid on select
        papiAttributes.setOnFocus(ON_FOCUS);
        doTestInitialiseFocusEventAttribute(papiAttributes,
                                             EventConstants.ON_FOCUS,
                                             ON_FOCUS);

        // Other events should not have been set (choose one, say ON_CLICK).
View Full Code Here

Examples of com.volantis.mcs.papi.AnchorAttributes

     */
    private static String mark = "(c) Volantis Systems Ltd 2004.";

    // Inherit javadoc.
    protected BlockAttributes createTestableBlockAttributes() {
        return new AnchorAttributes();
    }
View Full Code Here

Examples of com.volantis.mcs.papi.AnchorAttributes

     * Ensure that a PAPI id attribute generates a Protocol id attribute.
     *
     * @throws com.volantis.mcs.papi.PAPIException
     */
    public void testIdGeneratesId() throws PAPIException {
        AnchorAttributes papiAttrs = createTestableAnchorAttributes();
        String value = "value";
        papiAttrs.setId(value);
        checkIdIsGenerated(papiAttrs, value);
    }
View Full Code Here

Examples of com.volantis.mcs.papi.AnchorAttributes

     * Ensure that a PAPI name attribute generates a Protocol id attribute.
     *
     * @throws PAPIException
     */
    public void testNameGeneratesId() throws PAPIException {
        AnchorAttributes papiAttrs = createTestableAnchorAttributes();
        String value = "value";
        papiAttrs.setName(value);
        checkIdIsGenerated(papiAttrs, value);
    }
View Full Code Here

Examples of com.volantis.mcs.papi.AnchorAttributes

     * id attribute.
     *
     * @throws PAPIException
     */
    public void testIdAndNameSameGeneratesId() throws PAPIException {
        AnchorAttributes papiAttrs = createTestableAnchorAttributes();
        String value = "value";
        papiAttrs.setId(value);
        papiAttrs.setName(value);
        checkIdIsGenerated(papiAttrs, value);
    }
View Full Code Here

Examples of com.volantis.mcs.papi.AnchorAttributes

     * name.
     *
     * @throws PAPIException
     */
    public void testIdAndNameDifferentGeneratesId() throws PAPIException {
        AnchorAttributes papiAttrs = createTestableAnchorAttributes();
        String value = "value";
        papiAttrs.setId(value);
        papiAttrs.setName("ignored");
        // NOTE: this should generate a warning as well, but a bit hard to
        // test for without some infrastructure...
        checkIdIsGenerated(papiAttrs, value);
    }
View Full Code Here

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

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.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

Examples of com.volantis.mcs.protocols.AnchorAttributes

        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

Examples of com.volantis.mcs.protocols.AnchorAttributes

        // 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
TOP
Copyright © 2018 www.massapi.com. 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.