Examples of MCSAttributes


Examples of com.volantis.mcs.protocols.MCSAttributes

     * are tested. In addition writeOpenMarkup is implicitly test here - see
     * design for more info.
     * @throws Exception
     */
    public void testElementStart() throws Exception {
        MCSAttributes protocolAttributes =
                createTestableProtocolAttributes();
        attrsAttributes.setId("id");
        attrsAttributes.setStyleClass("styleClass");
        attrsAttributes.setTitle("title");
        TestableAttrsElementImpl element =
                (TestableAttrsElementImpl) createTestablePAPIElement();

        element.setVolantisAttributes(protocolAttributes);

        AttrsElementImpl attrsElement = (AttrsElementImpl) element;
        int result = attrsElement.elementStart(requestContext,
                                               attrsAttributes);

        assertEquals("Comparing id.", attrsAttributes.getId(),
                     protocolAttributes.getId());
        assertEquals("Comparing title. ", attrsAttributes.getTitle(),
                     protocolAttributes.getTitle());

        // The writeOpenMarkup() method in the element should have been called.
        assertTrue("AttrsElementImpl.writeOpenMarkup() should have been called" +
                   " for element " + element + " but it was not.",
                   element.writeOpenMarkupHasBeenCalled());
View Full Code Here

Examples of com.volantis.mcs.protocols.MCSAttributes

     *
     * @param styles the styles to use for the element.
     */
    private void open(Styles styles) {
        // Create an instance of MCSAttributes - the type doesn't matter
        MCSAttributes attributes = new StyleAttributes();
        attributes.setStyles(styles);
        buffer.openStyledElement(VDXMLConstants.PSEUDO_INLINE_ELEMENT,
                attributes);
    }
View Full Code Here

Examples of com.volantis.mcs.protocols.MCSAttributes

     *
     * @param begin the styles to begin this display context with.
     */
    private void openTexte(Styles begin) {
        // Create an instance of MCSAttributes - the type doesn't matter
        MCSAttributes attributes = new StyleAttributes();
        attributes.setStyles(begin);
        buffer.openStyledElement(VDXMLConstants.TEXT_BLOCK_ELEMENT, attributes);
    }
View Full Code Here

Examples of com.volantis.mcs.protocols.MCSAttributes

     * @param styles the styles to use for the element.
     */
    private void open(Styles styles) {

        // Create an instance of MCSAttributes - the type doesn't matter
        MCSAttributes attributes = new StyleAttributes();
        attributes.setStyles(styles);
        buffer.openStyledElement(
                VDXMLConstants.PSEUDO_BLOCK_ELEMENT, attributes);
    }
View Full Code Here

Examples of com.volantis.mcs.protocols.MCSAttributes

     * @param begin the styles to use for the element.
     */
    private void openTexte(Styles begin) {

        // Create an instance of MCSAttributes - the type doesn't matter
        MCSAttributes attributes = new StyleAttributes();
        attributes.setStyles(begin);
        buffer.openStyledElement(VDXMLConstants.TEXT_BLOCK_ELEMENT, attributes);
    }
View Full Code Here

Examples of com.volantis.mcs.protocols.MCSAttributes

        WidgetDefaultModule module = getWidgetDefaultModule(protocol);
       
        // If parent attributes is instance of JavaScriptArrayAttributes,
        // add ID of this widget to the array attributes.
        if (!module.getOuterAttributesStack().empty()) {
            MCSAttributes currentAttributes = (MCSAttributes) module.getOuterAttributesStack().peek();
       
            if (currentAttributes instanceof JavaScriptArrayAttributes) {
                if (attributes.getId() == null) {
                    attributes.setId(protocol.getMarinerPageContext().generateUniqueFCID());
                }
View Full Code Here

Examples of com.volantis.mcs.protocols.MCSAttributes

     * @param protocol The protocol used.
     * @returns closed widget attributes.
     * @throws ProtocolException
     */
    protected MCSAttributes renderWidgetClose(VolantisProtocol protocol) throws ProtocolException {
        MCSAttributes attributes = getCurrentAttributes(protocol);
       
        renderWidgetClose(protocol, attributes);
       
        return attributes;
    }
View Full Code Here

Examples of com.volantis.mcs.protocols.MCSAttributes

     * methods calls.
     *
     * @return parent widget attributes.
     */
    protected MCSAttributes getParentAttributes(VolantisProtocol protocol) {
        MCSAttributes parentAttributes = null;
       
        Stack stack = getWidgetDefaultModule(protocol).getInnerAttributesStack();
       
        if (stack.size() >= 2) {
            parentAttributes = (MCSAttributes) stack.get(stack.size() - 2);
View Full Code Here

Examples of com.volantis.mcs.protocols.MCSAttributes

     * has just finished invoking its doRenderOpen() method.
     *
     * @return The widget attributes.
     */
    protected MCSAttributes getCurrentAttributes(VolantisProtocol protocol) {
        MCSAttributes parentAttributes = null;
       
        Stack stack = getWidgetDefaultModule(protocol).getInnerAttributesStack();
       
        if (stack.size() >= 1) {
            parentAttributes = (MCSAttributes) stack.get(stack.size() - 1);
View Full Code Here

Examples of com.volantis.mcs.protocols.MCSAttributes

        // is used as a part of simple or multiple validator.
        validateAttributes
                .setMultiple(parent instanceof MultipleValidatorElement);

        if (parent instanceof XFInputElementImpl) {
            MCSAttributes inputAttributes = ((XFInputElementImpl) parent)
                    .getProtocolAttributes();

            // If input element does not have an ID, generate it now,
            // because JavaScript Widget.SimpleValidator class needs
            // to use it as a reference
            if (inputAttributes.getId() == null) {
                inputAttributes.setId(getProtocol(context)
                        .getMarinerPageContext().generateUniqueFCID());
            }

            // Store the ID in validate attributes, for easy access.
            validateAttributes.setInputElementId(inputAttributes.getId());

//            temporarily changed (VMS-321) and implemented in javascript as event type should depends on device policy
//            which will say if browser supports mouse cursor or not.
//            For exmple for NetFront3.4 in SE K660i onblur will be replaced with onmouseout
//            Empty events attribute will be rendered and will be filled in javascript
            if (validateAttributes.isAuto()) {
//               This needs to be done using timers, because without timers the autoFocus feature does not work.
//               String validateString = "setTimeout(function(){Widget.getInstance('"
//                        + validateAttributes.getId() + "').validate()}, 0)";

                String validateString = "";
                inputAttributes.getEventAttributes(true).setEvent(
                        EventConstants.ON_BLUR, validateString);
                inputAttributes.getEventAttributes(true).setEvent(
                        EventConstants.ON_MOUSE_OUT, validateString);
            }

            // Set up the styles extractor to extract the MCS_INVALID value. Set
            // that value in the
            // ValidateAttributes object so that the extractor can use the value
            // when it is run. The
            // value used here is from a pseduoclass.

            // Extract styles from 'mcs-invalid' pseudo-class,
            // to be used to emphasise validation errors.
            StylesExtractor stylesExtractor =
                WidgetHelper.createStylesExtractor(null, inputAttributes.getStyles());
            stylesExtractor.setPseudoClass(StatefulPseudoClasses.MCS_INVALID);
            String invalidStyles = stylesExtractor.getJavaScriptStyles();

            validateAttributes.setInvalidStyle(invalidStyles);
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.