Example usage for com.google.gwt.dom.client Document createHElement

List of usage examples for com.google.gwt.dom.client Document createHElement

Introduction

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

Prototype

public HeadingElement createHElement(int n) 

Source Link

Usage

From source file:com.pronoiahealth.olhie.client.widgets.booklist3d.BookLIWidget.java

License:Open Source License

/**
 * Constructor/*from   ww  w . ja va2 s  .co  m*/
 * 
 */
public BookLIWidget() {
    // Create the tocWidget
    tocWidget = new TOCDivWidget();

    // Create the root
    Document doc = Document.get();
    root = doc.createLIElement();
    setElement(root);

    // Book id div
    bkBook = createDivWithClassStyle(doc, "bk-book book-1 bk-bookdefault", null);
    root.appendChild(bkBook);

    // Book front
    DivElement bookFront = createDivWithClassStyle(doc, "bk-front", null);
    bkBook.appendChild(bookFront);

    // Front Cover
    bookFrontCover = createDivWithClassStyle(doc, "bk-cover", null);
    bookFront.appendChild(bookFrontCover);

    // MyCollection Indicator
    DivElement cd1 = createDivWithClassStyle(doc, null, "float: right; margin: 10px;");
    bookFrontCover.appendChild(cd1);
    DivElement cd2 = createDivWithClassStyle(doc, null, null);
    cd1.appendChild(cd2);
    myCollectionBtnIndicator = doc.createAnchorElement();
    cd2.appendChild(myCollectionBtnIndicator);
    myCollectionBtnIndicatorIcon = doc.createElement("i");
    myCollectionBtnIndicator.appendChild(myCollectionBtnIndicatorIcon);

    // BK Cover Back
    bkCoverBack = this.createDivWithClassStyle(doc, "bk-cover-back", "background-color: #FFFF00;");
    bookFront.appendChild(bkCoverBack);

    // Book Page
    bkPage = createDivWithClassStyle(doc, "bk-page", null);
    bkBook.appendChild(bkPage);

    // Book Back
    bkBack = this.createDivWithClassStyle(doc, "bk-back", null);
    bkBook.appendChild(bkBack);
    bookDescription = doc.createPElement();
    bkBack.appendChild(bookDescription);

    // Book Right
    DivElement bkRight = createDivWithClassStyle(doc, "bk-right", null);
    bkBook.appendChild(bkRight);

    // Left
    bkLeft = createDivWithClassStyle(doc, "bk-left", "background-color: #FFFF00;");
    bkBook.appendChild(bkLeft);
    bookBinding = doc.createHElement(2);
    bkLeft.appendChild(bookBinding);
    bookBindingAuthor = doc.createSpanElement();
    bookBinding.appendChild(bookBindingAuthor);
    bookBindingTitle = doc.createSpanElement();
    bookBinding.appendChild(bookBindingTitle);

    // Book top and botton
    bkBook.appendChild(createDivWithClassStyle(doc, "bk-top", null));
    bkBook.appendChild(createDivWithClassStyle(doc, "bk-bottom", null));

    // Book info
    DivElement bkInfo = createDivWithClassStyle(doc, "bk-info", null);
    root.appendChild(bkInfo);

    // Back button
    ButtonElement bkBookback = doc.createButtonElement();
    bkBookback.setClassName("bk-bookback");
    bkInfo.appendChild(bkBookback);

    // Front button
    ButtonElement bkBookview = doc.createButtonElement();
    bkBookview.setClassName("bk-bookview");
    bkInfo.appendChild(bkBookview);

    // Rating
    DivElement rh = createDivWithClassStyle(doc, null, "margin-top: 15px;");
    bkInfo.appendChild(rh);
    DivElement rh1 = createDivWithClassStyle(doc, null, "float: left; padding-right: 10px;");
    rh.appendChild(rh1);
    Element rh11 = doc.createElement("b");
    rh1.appendChild(rh11);
    rh11.setInnerText("Rating:");

    // Holder for rating
    ratingHolder = doc.createDivElement();
    rh.appendChild(ratingHolder);

    // Book hours
    DivElement bh = createDivWithClassStyle(doc, null, "margin-top: 15px;");
    bkInfo.appendChild(bh);
    DivElement bh1 = createDivWithClassStyle(doc, null, "float: left; padding-right: 10px;");
    bh.appendChild(bh1);
    Element bh11 = doc.createElement("b");
    bh1.appendChild(bh11);
    bh11.setInnerText("Book Hours:");

    // Holder for hours
    bookHoursHolder = doc.createDivElement();
    bh.appendChild(bookHoursHolder);
}

From source file:com.smartgwt.mobile.client.widgets.Header1.java

License:Open Source License

/**
 * The header constructor./*w ww.  j  a va  2s  . c  o m*/
 */
public Header1() {
    final Document document = Document.get();
    HeadingElement element = document.createHElement(1);
    element.setClassName(_CSS.headingClass());
    element.addClassName(_CSS.heading1Class());
    span = Document.get().createSpanElement();
    span.setClassName(_CSS.headingContentClass());
    element.appendChild(span);
    setElement(element);
}