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

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

Introduction

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

Prototype

@Override
    public void setId(String id) 

Source Link

Usage

From source file:org.ednovo.gooru.application.client.gin.AppClientFactory.java

License:Open Source License

/**
 *
 * @function setMetaDataDescription//  www . j  a  v a  2 s. co  m
 *
 * @created_date : 26-Dec-2013
 *
 * @description :This method is used to meta data information.
 *
 *
 * @parm(s) : @param newDescription
 *
 * @return : void
 *
 * @throws : <Mentioned if any exceptions>
 */
public static void setMetaDataDescription(String newDescription) {
    NodeList<Element> tags = Document.get().getElementsByTagName("meta");
    for (int i = 0; i < tags.getLength(); i++) {
        MetaElement metaTag = ((MetaElement) tags.getItem(i));
        if (metaTag.getName().equals("description")) {
            metaTag.setContent(newDescription);
            metaTag.setId("gooru-seo-meta-content");
        }
        if (metaTag.getName().equals("author")) {
            metaTag.setContent("");
            metaTag.setId("");
        }
    }
}