Package org.displaytag.util

Examples of org.displaytag.util.HtmlAttributeMap


     * Writes the open <tr> tag.
     * @return String <tr> tag with the appropriate css class attribute
     */
    public String getOpenTag()
    {
        Map rowAttributes = new HtmlAttributeMap();
        MultipleHtmlAttribute cssAttribute = new MultipleHtmlAttribute(this.tableModel.getProperties().getCssRow(
            this.rowNumber));

        if (this.tableModel.getTableDecorator() != null)
        {
            try
            {
                String addStyle = this.tableModel.getTableDecorator().addRowClass();

                if (StringUtils.isNotBlank(addStyle))
                {
                    cssAttribute.addAttributeValue(addStyle);
                }

                String id = this.tableModel.getTableDecorator().addRowId();
                if (StringUtils.isNotBlank(id))
                {
                    rowAttributes.put(TagConstants.ATTRIBUTE_ID, id);
                }
            }
            catch (NoSuchMethodError e)
            {
                // this catch is here to allow decorators compiled with displaytag 1.0 work with 1.1
                // since the addRowClass() and addRowId() are new in displaytag 1.1 earlier decorators could throw
                // a NoSuchMethodError... be nice with them till a next major release
            }
        }

        rowAttributes.put(TagConstants.ATTRIBUTE_CLASS, cssAttribute);

        StringBuffer tag = new StringBuffer();
        tag.append(TagConstants.TAG_OPEN);
        tag.append(TagConstants.TAGNAME_ROW);

        tag.append(rowAttributes.toString());

        tag.append(TagConstants.TAG_CLOSE);

        return tag.toString();
    }
View Full Code Here


        Object rowStyle = this.attributeMap.get(TagConstants.ATTRIBUTE_STYLE);
        Object rowClass = this.attributeMap.get(TagConstants.ATTRIBUTE_CLASS);
        if (rowStyle != null || rowClass != null)
        {
            HtmlAttributeMap perRowValues = new HtmlAttributeMap();
            if (rowStyle != null)
            {
                perRowValues.put(TagConstants.ATTRIBUTE_STYLE, rowStyle);
            }
            if (rowClass != null)
            {
                perRowValues.put(TagConstants.ATTRIBUTE_CLASS, rowClass);
            }
            if (cell == null)
            {
                cell = new Cell(null);
            }
View Full Code Here

     * Writes the open <tr> tag.
     * @return String <tr> tag with the appropriate css class attribute
     */
    public String getOpenTag()
    {
        Map rowAttributes = new HtmlAttributeMap();

        MultipleHtmlAttribute cssAttribute = new MultipleHtmlAttribute(this.tableModel.getProperties().getCssRow(
            this.rowNumber));

        if (this.tableModel.getTableDecorator() != null)
        {
            try
            {
                String addStyle = this.tableModel.getTableDecorator().addRowClass();

                if (StringUtils.isNotBlank(addStyle))
                {
                    cssAttribute.addAttributeValue(addStyle);
                }

                String id = this.tableModel.getTableDecorator().addRowId();
                if (StringUtils.isNotBlank(id))
                {
                    rowAttributes.put(TagConstants.ATTRIBUTE_ID, id);
                }
            }
            catch (NoSuchMethodError e)
            {
                // this catch is here to allow decorators compiled with displaytag 1.0 work with 1.1
                // since the addRowClass() and addRowId() are new in displaytag 1.1 earlier decorators could throw
                // a NoSuchMethodError... be nice with them till a next major release
            }
        }

        if (!cssAttribute.isEmpty())
        {
            rowAttributes.put(TagConstants.ATTRIBUTE_CLASS, cssAttribute);
        }

        StringBuffer tag = new StringBuffer();
        tag.append(TagConstants.TAG_OPEN);
        tag.append(TagConstants.TAGNAME_ROW);

        tag.append(rowAttributes.toString());

        tag.append(TagConstants.TAG_CLOSE);

        return tag.toString();
    }
View Full Code Here

     * Generates the cell open tag.
     * @return String td open tag
     */
    public String getOpenTag()
    {
        HtmlAttributeMap rowAttributes = cell.getPerRowAttributes();

        HtmlAttributeMap atts = htmlAttributes;
        if (rowAttributes != null)
        {
            atts = (HtmlAttributeMap) atts.clone();
            atts.putAll(rowAttributes);
        }
        return HtmlTagUtil.createOpenTagString(TagConstants.TAGNAME_COLUMN, atts);
    }
View Full Code Here

        }

        // if headerAttributes has not been set, instantiates a new map
        if (headerAttributes == null)
        {
            headerAttributes = new HtmlAttributeMap();
        }

        Object classAttributes = this.headerAttributes.get(TagConstants.ATTRIBUTE_CLASS);

        // handle multiple values
View Full Code Here

        Object rowStyle = this.attributeMap.get(TagConstants.ATTRIBUTE_STYLE);
        Object rowClass = this.attributeMap.get(TagConstants.ATTRIBUTE_CLASS);
        if (rowStyle != null || rowClass != null)
        {
            HtmlAttributeMap perRowValues = new HtmlAttributeMap();
            if (rowStyle != null)
            {
                perRowValues.put(TagConstants.ATTRIBUTE_STYLE, rowStyle);
            }
            if (rowClass != null)
            {
                perRowValues.put(TagConstants.ATTRIBUTE_CLASS, rowClass);
            }
            if (cell == null)
            {
                cell = new Cell(null);
            }
View Full Code Here

TOP

Related Classes of org.displaytag.util.HtmlAttributeMap

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.