Example usage for com.google.gwt.dom.client MetaElement setAttribute

List of usage examples for com.google.gwt.dom.client MetaElement setAttribute

Introduction

In this page you can find the example usage for com.google.gwt.dom.client MetaElement setAttribute.

Prototype

@Override
    public void setAttribute(String name, String value) 

Source Link

Usage

From source file:com.arcbees.seo.TagsInjector.java

License:Apache License

private void setMetaTag(Map<String, MetaElement> metaElementsMap, String property, String content) {
    if (content != null) {
        MetaElement metaElement = metaElementsMap.get(property);

        if (metaElement == null) {
            metaElement = document.createMetaElement();
            metaElement.setAttribute("property", property);

            document.getHead().insertFirst(metaElement);

            metaElementsMap.put(property, metaElement);
        }/*from w ww .j a v a 2  s  . c  o m*/

        metaElement.setContent(content);
    }
}