Package com.google.gwt.dom.client

Examples of com.google.gwt.dom.client.DivElement


    private void appendMessage(String action) {
        String message = Util.getSimpleName(this) + action
                + Util.getSimpleName(target);

        DivElement element = Document.get().createDivElement();
        element.setInnerText(message);

        Document.get().getBody().insertFirst(element);
    }
View Full Code Here


    private TouchScrollHandler touchScrollHandler;

    public VPanel() {
        super();
        DivElement captionWrap = Document.get().createDivElement();
        captionWrap.appendChild(captionNode);
        captionNode.appendChild(captionText);

        captionWrap.setClassName(CLASSNAME + "-captionwrap");
        captionNode.setClassName(CLASSNAME + "-caption");
        contentNode.setClassName(CLASSNAME + "-content");
        bottomDecoration.setClassName(CLASSNAME + "-deco");

        getElement().appendChild(captionWrap);
View Full Code Here

        if (synthesizedFrame == null) {
            // Attach a hidden IFrame to the form. This is the target iframe to
            // which the form will be submitted. We have to create the iframe
            // using innerHTML, because setting an iframe's 'name' property
            // dynamically doesn't work on most browsers.
            DivElement dummy = Document.get().createDivElement();
            dummy.setInnerHTML("<iframe src=\"javascript:''\" name='"
                    + getFrameName()
                    + "' style='position:absolute;width:0;height:0;border:0'>");
            synthesizedFrame = dummy.getFirstChildElement();
            Document.get().getBody().appendChild(synthesizedFrame);
            element.setTarget(getFrameName());
            onloadstrategy.hookEvents(synthesizedFrame, this);
        }
    }
View Full Code Here

     * @return the corresponding absolute URL as a string
     */
    public static String getAbsoluteUrl(String url) {
        if (BrowserInfo.get().isIE8()) {
            // The hard way - must use innerHTML and attach to DOM in IE8
            DivElement divElement = Document.get().createDivElement();
            divElement.getStyle().setDisplay(Display.NONE);

            RootPanel.getBodyElement().appendChild(divElement);
            divElement.setInnerHTML("<a href='" + escapeAttribute(url)
                    + "' ></a>");

            AnchorElement a = divElement.getChild(0).cast();
            String href = a.getHref();

            RootPanel.getBodyElement().removeChild(divElement);
            return href;
        } else {
View Full Code Here

  }
 
  private DivElement createMessage(final String user,final String message,boolean local)
  {
    Element element = DOM.createDiv();
    DivElement messageDiv = DivElement.as(element);
    lastMsgID = DOM.createUniqueId();
    messageDiv.setId(lastMsgID);
    messageDiv.setClassName("selected-article");
   
    //create the avatar table
    element = DOM.createTable();
    TableElement avatarTable = TableElement.as(element);
    messageDiv.appendChild(avatarTable);
    avatarTable.setAttribute("hspace", "4");
    avatarTable.setAttribute("cellspacing","0");
    avatarTable.setAttribute("vspace", "2");
    avatarTable.setAttribute("border", "0");
    avatarTable.setAttribute("align", "left");
   
    Element tbodyElement = DOM.createTBody();
    avatarTable.appendChild(tbodyElement);
   
    Element trElement = DOM.createTR();
    tbodyElement.appendChild(trElement);
   
    Element tdElement = DOM.createTD();
    trElement.appendChild(tdElement);
    tdElement.setAttribute("height", "45");
    tdElement.setAttribute("width", "45");
    tdElement.setAttribute("align", "middle");
    Style style = tdElement.getStyle();
    style.setProperty("border", "1px solid black");
    style.setProperty("background-color", "white");
   
    Element imgElement = DOM.createImg();
    ImageElement imageElement = ImageElement.as(imgElement);
    tdElement.appendChild(imageElement);
    imageElement.setAttribute("height", "45");
    imageElement.setAttribute("widht", "45");
    XmppVCard vc = null;
    if(local)
      vc = JabberApp.instance().getSelfVCard();
    else
      vc = vcard;
    if(!GXT.isIE&&vc != null&&!vc.photo().isEmpty())
      imageElement.setSrc("data:image;base64,"+vc.photo());
    else
      imageElement.setSrc("images/default_avatar.png");
   
    tdElement = DOM.createTD();
    tdElement.setInnerHTML("&nbsp&nbsp");
    trElement.appendChild(tdElement);
   
    //create the div for timestamp and nick
    element = DOM.createDiv();
    DivElement tnDiv = DivElement.as(element);
    tnDiv.setClassName("msg_header");
    messageDiv.appendChild(tnDiv);
    //style = tnDiv.getStyle();
    //style.setProperty("border-bottom", "1px solid black");
   
    element = DOM.createTable();
    TableElement tnTableElement = TableElement.as(element);
    tnDiv.appendChild(tnTableElement);
    tnTableElement.setAttribute("cellspacing", "0");
    tnTableElement.setAttribute("cellpadding", "0");
    tnTableElement.setAttribute("width", "80%");
    tnTableElement.setAttribute("border", "0");
   
View Full Code Here

  }
 
  private DivElement createMessage(final String user,final String message,boolean local)
  {
    Element element = DOM.createDiv();
    DivElement messageDiv = DivElement.as(element);
    lastMsgID = DOM.createUniqueId();
    messageDiv.setId(lastMsgID);
    messageDiv.setClassName("selected-article");
   
    //create the avatar table
    element = DOM.createTable();
    TableElement avatarTable = TableElement.as(element);
    messageDiv.appendChild(avatarTable);
    avatarTable.setAttribute("hspace", "4");
    avatarTable.setAttribute("cellspacing","0");
    avatarTable.setAttribute("vspace", "2");
    avatarTable.setAttribute("border", "0");
    avatarTable.setAttribute("align", "left");
   
    Element tbodyElement = DOM.createTBody();
    avatarTable.appendChild(tbodyElement);
   
    Element trElement = DOM.createTR();
    tbodyElement.appendChild(trElement);
   
    Element tdElement = DOM.createTD();
    trElement.appendChild(tdElement);
    tdElement.setAttribute("height", "45");
    tdElement.setAttribute("width", "45");
    tdElement.setAttribute("align", "middle");
    Style style = tdElement.getStyle();
    style.setProperty("border", "1px solid black");
    style.setProperty("background-color", "white");
   
    Element imgElement = DOM.createImg();
    ImageElement imageElement = ImageElement.as(imgElement);
    tdElement.appendChild(imageElement);
    imageElement.setAttribute("height", "45");
    imageElement.setAttribute("widht", "45");
    XmppVCard vc = null;
    if(local)
      vc = JabberApp.instance().getSelfVCard();
    else
      vc = vcard;
    if(!GXT.isIE&&vc != null&&!vc.photo().isEmpty())
      imageElement.setSrc("data:image;base64,"+vc.photo());
    else
      imageElement.setSrc(JabberApp.instance().getAvatarUrl(jid));
   
    tdElement = DOM.createTD();
    tdElement.setInnerHTML("&nbsp&nbsp");
    trElement.appendChild(tdElement);
   
    //create the div for timestamp and nick
    element = DOM.createDiv();
    DivElement tnDiv = DivElement.as(element);
    tnDiv.setClassName("msg_header");
    messageDiv.appendChild(tnDiv);
    //style = tnDiv.getStyle();
    //style.setProperty("border-bottom", "1px solid black");
   
    element = DOM.createTable();
    TableElement tnTableElement = TableElement.as(element);
    tnDiv.appendChild(tnTableElement);
    tnTableElement.setAttribute("cellspacing", "0");
    tnTableElement.setAttribute("cellpadding", "0");
    tnTableElement.setAttribute("width", "80%");
    tnTableElement.setAttribute("border", "0");
   
View Full Code Here

            // Style style = widgetDIV.getStyle();
            // FF2 chokes on some floats very easily. Measuring size escpecially
            // becomes terribly slow
            TableElement tableEl = Document.get().createTableElement();
            tableEl.setInnerHTML("<tbody><tr><td><div></div></td></tr></tbody>");
            DivElement div = (DivElement) tableEl.getFirstChildElement()
                    .getFirstChildElement().getFirstChildElement()
                    .getFirstChildElement();
            tableEl.setCellPadding(0);
            tableEl.setCellSpacing(0);
            tableEl.setBorder(0);
            div.getStyle().setProperty("padding", "0");

            setElement(tableEl);
            containerDIV = div;
        } else {
            setFloat(widgetDIV, "left");
View Full Code Here

    b.append("</").append(tag).append('>');
   
    // We could use the static hiddenDiv, but that thing is attached
    // to the document. The caller might not want that.
   
    DivElement scratchDiv = Document.get().createDivElement();
    scratchDiv.setInnerHTML(b.toString());
    setElement(scratchDiv.getFirstChildElement());
    getElement().removeFromParent();
  }
View Full Code Here

    emptyMessageElem = Document.get().createDivElement();
    showOrHide(emptyMessageElem, false);

    // TODO: find some way for cells to communicate what they're interested in.
    DivElement outerDiv = Document.get().createDivElement();
    outerDiv.appendChild(childContainer);
    outerDiv.appendChild(emptyMessageElem);
    setElement(outerDiv);
    sinkEvents(Event.ONCLICK | Event.ONCHANGE | Event.MOUSEEVENTS);

    // Create the implementation.
    impl = new CellListImpl<T>(this, DEFAULT_PAGE_SIZE, childContainer) {
View Full Code Here

* dynamically detects IE7 and punts to the super implementation.
*/
class LayoutImplIE6 extends LayoutImplIE8 {

  private static Element createStyleRuler(Element parent) {
    DivElement styleRuler = Document.get().createDivElement();
    DivElement styleInner = Document.get().createDivElement();

    styleRuler.getStyle().setPosition(Position.ABSOLUTE);
    styleRuler.getStyle().setLeft(-10000, PX);

    parent.appendChild(styleRuler);
View Full Code Here

TOP

Related Classes of com.google.gwt.dom.client.DivElement

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.