Examples of KeywordValueHandler


Examples of com.volantis.mcs.protocols.styles.KeywordValueHandler

    public WMLDOMTransformer(WMLRoot protocol, boolean honoursAlignment) {

        // Initialise the style value handlers.
        paragraphAlignHandler = new ValueHandlerToPropertyAdapter(
            StylePropertyDetails.TEXT_ALIGN,
            new KeywordValueHandler(
                    WMLParagraphAlignKeywordMapper.getDefaultInstance()));

        paragraphModeHandler = new DefaultingPropertyHandler(
                new ValueHandlerToPropertyAdapter(
                        StylePropertyDetails.WHITE_SPACE,
                        new KeywordValueHandler(WMLParagraphModeKeywordMapper
                                .getDefaultInstance())), "wrap");

        deviceHonoursAlignOnParagraphWhenModeNowrap = honoursAlignment;

        this.factory = protocol.getDOMFactory();
View Full Code Here

Examples of com.volantis.mcs.protocols.styles.KeywordValueHandler

        super.initialiseStyleHandlers();

        // Initialise the style value handlers.
        horizontalAlignChecker = new ValueHandlerToPropertyAdapter(
                StylePropertyDetails.TEXT_ALIGN,
                new KeywordValueHandler(
                        HTMLiModeDivHorizontalAlignKeywordMapper.
                                getDefaultInstance()),
                NoopPropertyUpdater.getDefaultInstance());

        horizontalAlignHandler = new ValueHandlerToPropertyAdapter(
                StylePropertyDetails.TEXT_ALIGN,
                new KeywordValueHandler(
                        HTMLiModeDivHorizontalAlignKeywordMapper.
                                getDefaultInstance()),
                PropertyClearer.getDefaultInstance());

        // If no color is specified on body then default to black for text and
View Full Code Here

Examples of com.volantis.mcs.protocols.styles.KeywordValueHandler

        DefaultKeywordMapper alignmentMapper = new DefaultKeywordMapper();
        alignmentMapper.addMapping(TextAlignKeywords.LEFT, "left");
        alignmentMapper.addMapping(TextAlignKeywords.RIGHT, "right");

        horizontalRuleAlignHandler = new ValueHandlerToPropertyAdapter(StylePropertyDetails.TEXT_ALIGN,
                new KeywordValueHandler(alignmentMapper));

        DefaultKeywordMapper shadeMapper = new DefaultKeywordMapper();
        shadeMapper.addMapping(BorderStyleKeywords.SOLID, "true");

        horizontalRuleShadeHandler = new ValueHandlerToPropertyAdapter(StylePropertyDetails.BORDER_TOP_STYLE,
                new KeywordValueHandler(shadeMapper));

        horizontalRuleSizeHandler = new ValueHandlerToPropertyAdapter(StylePropertyDetails.HEIGHT,
                new PositivePixelLengthHandler());

        // noWrap property
        // noWrapMapper maps "noWrap" to the NOWRAP value and will null to other
        // values
        final DefaultKeywordMapper noWrapMapper = new DefaultKeywordMapper();
        noWrapMapper.addMapping(WhiteSpaceKeywords.NOWRAP, "noWrap");

        noWrapHandler = new ValueHandlerToPropertyAdapter(StylePropertyDetails.WHITE_SPACE,
                new KeywordValueHandler(noWrapMapper));
    }
View Full Code Here

Examples of com.volantis.mcs.protocols.styles.KeywordValueHandler

        // TODO: Maybe we should be using the NoopPropertyClearer as the
        // default rather than PropertyClearer? Need to think more about this.

        // Initialise the style value handlers.
        KeywordValueHandler textAlignKeywordHandler = new KeywordValueHandler(
                TextAlignKeywordMapper.getSingleton());

        horizontalAlignChecker = new TextAlignHandler(
                textAlignKeywordHandler,
                NoopPropertyUpdater.getDefaultInstance());

        // NOTE: do not attempt to use the NoopPropertyClearer here without due
        // thought. I tried it on the Orange OAT pagination.oml and the
        // pagination buttons stopped rendering properly. The right side of
        // the pagination is in a right aligned table cell (as shown below with
        // [] meaning a table and | a cell separator)
        // [ [ < | prev ]                                        [ next | > ] ]
        // stopped rendering properly, the sub table  [ next | > ] was not right
        // aligned in the parent table's td. This is because when you leave in
        // the text-align: on the td, it apparently overrides the align= and
        // has a slightly different meaning, whereby to get the "next >" right
        // aligned you need to add width: 100% on the table that surrounds it.
        // Not sure how we should address this in future, but we shouldn't be
        // relying on such nastyness...
        horizontalAlignHandler = new TextAlignHandler(
                textAlignKeywordHandler,
                PropertyExcluder.getDefaultInstance());

        // Property handlers for vertical-align style property.
        // We have two instances as handler checks device capabilities in order
        // to decide if update property (if so valign attribute is later added):
        // - First used for table cells and to open grid (table or div).
        //   In the later case we use only PropertyChecker interface so we
        //   don't need distinct instance.
        // - Second used for table rows.
        verticalAlignHandler = new DeviceAwareValueHandlerToPropertyAdapter(
                supportsCSS,
                protocolConfiguration.getDeviceCapabilityManager(),
                "td",
                StylePropertyDetails.VERTICAL_ALIGN,
                "valign",
                new KeywordValueHandler(
                        XHTMLBasicTableCellVerticalAlignKeywordMapper.getDefaultInstance()),
                PropertyClearer.getDefaultInstance());
        tableRowVerticalAlignHandler = new DeviceAwareValueHandlerToPropertyAdapter(
                supportsCSS,
                protocolConfiguration.getDeviceCapabilityManager(),
                "tr",
                StylePropertyDetails.VERTICAL_ALIGN,
                "valign",
                new KeywordValueHandler(
                        XHTMLBasicTableCellVerticalAlignKeywordMapper.getDefaultInstance()),
                PropertyClearer.getDefaultInstance());

        widthChecker = new ValueHandlerToPropertyAdapter(
                StylePropertyDetails.WIDTH,
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.