Package com.volantis.styling

Examples of com.volantis.styling.Styles


                    logger.debug("Checking element " + name);
                }

                if ("p".equals(name)) {

                    Styles styles = getStylesForElement(child);
                    String mode = paragraphModeHandler.getAsString(styles);
                    String align = paragraphAlignHandler.getAsString(styles);

                    // Emulate mode= using white-space.
                    // This inherits the value from the previous paragraph so
View Full Code Here


            if (WMLConstants.BLOCH_ELEMENT.equals(parentName)) {
                // Merge the attributes from the parent paragraph node into this
                // one, existing values are not changed.
                element.mergeAttributes(parent, false);
                // Merge styles in as well.
                Styles elementStyles = getStylesForElement(element);
                Styles parentStyles = getStylesForElement(parent);
                stylingFactory.getStylesMerger().merge(elementStyles,
                        parentStyles);
            } else {
                // Reuse the parent node if we can but otherwise create a clone of
                // it and then insert it as the parent of this element's children.
View Full Code Here

            card.addTail(p);
        }
    }

    private Styles getStylesForElement(Element element) {
        Styles styles = element.getStyles();
        // Styles should never be null, but at the moment we create
        // non-papi related content improperly with null styles.
        // Work around this by creating a styles here anyway.
        if (styles == null) {
            MutablePropertyValues values = stylingFactory.createPropertyValues(
View Full Code Here

    private void insertCardTitle(Element element, EmulateEmphasisTag tag) {
        String value = element.getAttributeValue("title");
        if (value != null && !value.equals("")) {
            Element e = element.getDOMFactory().createElement();
            e.setName(WMLConstants.BLOCH_ELEMENT);
            Styles styles = getStylesForElement(e);
            styles.getPropertyValues().setComputedValue(
                    StylePropertyDetails.TEXT_ALIGN,
                    TextAlignKeywords.CENTER);
            Text t = element.getDOMFactory().createText();
            t.append(value);
            e.addHead(t);
View Full Code Here

            HorizontalRuleAttributes attributes,
            DeviceElementCapability divElementCapability) {

        HorizontalRuleEmulator emulator = null;

        Styles styles = attributes.getStyles();

        boolean requiresColor = false;
        boolean requiresWidth = false;
        boolean requiresMarginTop = false;
        boolean requiresMarginBottom = false;

        if (styles != null && styles.getPropertyValues() != null) {
            MutablePropertyValues propertyValues = styles.getPropertyValues();
            requiresColor = propertyValues.
                    getComputedValue(StylePropertyDetails.COLOR) != null;
            requiresWidth = propertyValues.
                    getComputedValue(StylePropertyDetails.WIDTH) != null;
            requiresMarginTop = propertyValues.
View Full Code Here

     */
    private void renderTabLabel(VolantisProtocol protocol) throws ProtocolException {
       
        String textLabel = "";
        // Get content value specified for ::mcs-label
        Styles tabStyles = protocolAttributes.getStyles();
        Styles labelStyles = (null == tabStyles ? null : tabStyles
                .getNestedStyles(PseudoElements.MCS_LABEL));
        StyleValue labelContent = (null == labelStyles ? null : labelStyles
                .getPropertyValues().getSpecifiedValue(
                        StylePropertyDetails.CONTENT));

        // Render label content
        if (null != labelContent) {
View Full Code Here

                       
        // Default values if not specified in styles       
        String startColor = "#ffffff";
        String endColor = startColor;
       
        Styles styles = element.getStyles();       
       
        StyleValue startColorValue = styles.getPropertyValues().getComputedValue(StylePropertyDetails.BACKGROUND_COLOR);
        if(startColorValue != null) {
            startColor = startColorValue.getStandardCSS();
        }
       
        //if default color is set, it should be change for highlight effect to white color
        if(startColor.equals("transparent")) {
            startColor = "#ffffff";               
        }
               
        Styles focusStyles = styles.findNestedStyles(StatefulPseudoClasses.FOCUS);
       
        if (focusStyles != null) {
            StyleValue endColorValue = focusStyles.getPropertyValues().getComputedValue(StylePropertyDetails.BACKGROUND_COLOR);
            if (endColorValue != null) {
                endColor = endColorValue.getStandardCSS();                
                // highlight effect overrides standard behaviour of focus 
                focusStyles.getPropertyValues().setComputedAndSpecifiedValue(StylePropertyDetails.BACKGROUND_COLOR, startColorValue);  
            }           
        }
                               
    Element newElement = element.getDOMFactory().createElement();
        newElement.setName("script");
View Full Code Here

    * @param element current element
    */
  
   public void visit(Element element) {
    
       Styles styles = element.getStyles();
       if(styles != null) {
           StyleValue effectTypeValue = styles.getPropertyValues().getComputedValue(StylePropertyDetails.MCS_EFFECT_STYLE);
           if(effectTypeValue != null && effectTypeValue.getStandardCSS().equals(
                   StyleKeywords.HIGHLIGHT.getName())) {
              
            HighlightRule rule = (HighlightRule)ruleSet.get(element.getName());
   
View Full Code Here

            divAttributes.copy(sourceAttributes);
        }

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

            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);
View Full Code Here

TOP

Related Classes of com.volantis.styling.Styles

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.