Example usage for com.google.gwt.user.client Element setInnerText

List of usage examples for com.google.gwt.user.client Element setInnerText

Introduction

In this page you can find the example usage for com.google.gwt.user.client Element setInnerText.

Prototype

@Override
    public void setInnerText(String text) 

Source Link

Usage

From source file:com.eduworks.russel.ui.client.pagebuilder.screen.UserScreen.java

License:Apache License

private void makeOption(final String username, String eName) {
    Element e = DOM.getElementById(eName);
    Element a = DOM.createOption();
    a.setInnerText(username);
    e.appendChild(a);/*from ww  w .jav  a  2s.co  m*/
}

From source file:com.isotrol.impe3.pms.gui.client.widget.design.Frame.java

License:Open Source License

protected Frame<D> init(D frame) {
    this.frame = frame;
    this.inherited = frame.isInherited();

    addStyleName(CSS_BOX);//from   ww  w. ja  v  a 2s  . co  m

    if (!inherited) {
        Element domDraggable = DOM.createDiv();
        domDraggable.setInnerText("a");
        domDraggable.setClassName(getDraggableStyle());
        HTML draggableZone = new HTML(domDraggable.getString());
        menuPanel.add(draggableZone);
        add(menuPanel);
        // make the frame draggable
        DesignDNDController.getInstance().makeDraggable(this, draggableZone);
    }

    add(vertPanel);

    return this;
}

From source file:com.jitlogic.zico.widgets.client.MenuItem.java

License:Open Source License

private void init() {
    item = DOM.createDiv();/*from   w w w.  j  a  v a 2  s . c o m*/
    item.addClassName(resources.css().item());

    if (!enabled) {
        item.addClassName(resources.css().disabled());
    }

    Element a = DOM.createAnchor();

    Element img = DOM.createImg();
    img.setAttribute("src", icon != null ? icon.getURL() : resources.empty().getURL());
    a.appendChild(img);

    Element span = DOM.createSpan();
    span.setInnerText(text);
    a.appendChild(span);

    item.appendChild(a);
}

From source file:com.spaceapplications.vaadin.addon.eventtimeline.gwt.client.VEventLabel.java

public VEventLabel(VEvent event, float w, float h) {
    this.event = event;

    setStylePrimaryName(VEventTimelineDisplay.CLASSNAME_EVENT);

    final Element caption = DOM.createDiv();
    // FIXME: the limits to show the caption are hard-coded by now
    if (w > 45 && h > 20) {
        caption.setInnerText(Util.escapeHTML(event.getCaption()));
    } else {/*from w  w w . j  ava  2 s  . c  om*/
        caption.setInnerHTML("");
    }

    caption.addClassName(VEventTimelineDisplay.CLASSNAME_EVENT_CAPTION);
    getElement().appendChild(caption);

    Element eventContent = DOM.createDiv();
    eventContent.addClassName(VEventTimelineDisplay.CLASSNAME_EVENT_CONTENT);
    eventContent.setInnerHTML(event.getDescription());
    getElement().appendChild(eventContent);

    if (event.getStyleName() != null && event.getStyleName().length() > 0) {
        addStyleName(event.getStyleName());
    }

    setWidth(w + "px");
    setHeight(h + "px");
}

From source file:eml.studio.client.IndexPage.java

License:Open Source License

/**
 * IndexPage module load method//from   w  w w .  ja v  a  2  s  . c  o m
 */
@Override
public void onModuleLoad() {
    init();
    loginPanel.addGuestLoginHandler(new GuestLoginHandler());
    loginPanel.addSignInHandler(new SignInHandler());
    loginPanel.addSignUpHandler(new SignUpHandler());
    loginPanel.addForgetPwdHandler(new ForgetPwdHandler());

    loginPanel.addDomHandler(new KeyUpHandler() {
        @Override
        public void onKeyUp(KeyUpEvent event) {
            if (event.getNativeKeyCode() == 13) {
                enterLogin();
            }
        }
    }, KeyUpEvent.getType());

    Element elem = DOM.getElementById("bda-login-a");
    loginAnchor = Anchor.wrap(elem);
    loginAnchor.setText(Constants.logUIMsg.login());
    DOM.sinkEvents(elem, Event.ONCLICK);
    DOM.setEventListener(elem, new EventListener() {
        @Override
        public void onBrowserEvent(Event event) {
            if (Event.ONCLICK == event.getTypeInt()) {
                registerPanel.hide();
                forgetPwdPanel.hide();

                if (loginPanel.isShowing())
                    loginPanel.hide();
                else {
                    loginPanel.showRelativeTo(loginAnchor);
                }
            }
        }

    });

    elem = DOM.getElementById("bda-logout-a");
    elem.setInnerText(Constants.logUIMsg.logout());
    DOM.sinkEvents(elem, Event.ONCLICK);
    DOM.setEventListener(elem, new EventListener() {
        @Override
        public void onBrowserEvent(Event event) {
            if (Event.ONCLICK == event.getTypeInt()) {
                accountSrv.logout(new AsyncCallback<Void>() {

                    @Override
                    public void onFailure(Throwable caught) {
                        Window.Location.reload();
                    }

                    @Override
                    public void onSuccess(Void result) {
                        Window.Location.reload();
                    }

                });
            }
        }

    });

    Window.addResizeHandler(new ResizeHandler() {

        @Override
        public void onResize(ResizeEvent event) {
            if (loginPanel.isShowing())
                loginPanel.showRelativeTo(loginAnchor);
            if (registerPanel.isShowing())
                registerPanel.showRelativeTo(loginAnchor);
        }

    });

}

From source file:fr.aliasource.webmail.client.reader.invitation.InvitationAgendaLine.java

License:GNU General Public License

public InvitationAgendaLine(String date, String title) {
    Element div = DOM.createElement("ul");
    div.setAttribute("class", "agendaLine");
    Element spanDate = DOM.createElement("li");
    spanDate.setAttribute("class", "agendaDate");
    spanDate.setInnerText(date);
    div.appendChild(spanDate);/* w  w w  .  jav a  2  s .c  o  m*/

    Element spanTitre = DOM.createElement("li");
    spanTitre.setAttribute("class", "agendaTitre");
    spanTitre.setInnerText(title);
    div.appendChild(spanTitre);

    this.setElement(div);
}

From source file:fr.aliasource.webmail.client.reader.invitation.InvitationPanel.java

License:GNU General Public License

private VerticalPanel fillInfoEventPanel() {
    VerticalPanel vp = new VerticalPanel();
    vp.setStyleName("detailEvent noWrap");
    Label lb = new Label(strings.newEvent());
    vp.add(lb);//from   w w w .j a  va2  s.c  o  m

    this.infoEventPanel = new FlexTable();
    infoEventPanel.addStyleName("leftPanel");
    infoEventPanel.setText(0, 0, strings.invitationTitle() + ":");
    infoEventPanel.setText(0, 1, invitationInfo.getEvent().getTitle());

    infoEventPanel.setText(1, 0, strings.invitationOwner() + ":");
    infoEventPanel.setText(1, 1, invitationInfo.getEvent().getOwner());

    infoEventPanel.setText(2, 0, strings.invitationWhen() + ":");

    if (invitationInfo.getEvent().getDtStart() != null) {
        DateTimeFormat dtfStart = DateTimeFormat.getShortDateTimeFormat();
        String sStart = dtfStart.format(invitationInfo.getEvent().getDtStart());

        DateTimeFormat dtfEnd = DateTimeFormat.getShortTimeFormat();
        String sEnd = dtfEnd.format(invitationInfo.getEvent().getDtEnd());

        infoEventPanel.setText(2, 1, sStart + " - " + sEnd);
    }

    infoEventPanel.setText(3, 0, strings.invitationWhere() + ":");
    infoEventPanel.setText(3, 1, invitationInfo.getEvent().getLocation());

    String who = getWho();
    if (!"".endsWith(who)) {
        infoEventPanel.setText(4, 0, strings.invitationWho() + ":");
        infoEventPanel.setText(4, 1, who);
    }

    Element moreDetail = DOM.createElement("a");
    moreDetail.setAttribute("href", invitationInfo.getCalendarUrl());
    moreDetail.setInnerText(strings.moreActions());
    HTML linkMoreDetail = new HTML();
    linkMoreDetail.getElement().appendChild(moreDetail);

    infoEventPanel.setWidget(5, 1, linkMoreDetail);

    accept = getGoingLink(strings.invitationYes(), "invitationYes", INVITATION_ACCEPT);
    maybe = getGoingLink(strings.invitationMaybe(), "invitationMaybe", INVITATION_MAYBE);
    refuse = getGoingLink(strings.invitationNo(), "invitationNo", INVITATION_REFUSE);
    updateGoingLink("");

    for (int i = 0; i < infoEventPanel.getRowCount(); ++i) {
        infoEventPanel.getCellFormatter().setStyleName(i, 0, "keys");
    }
    infoEventPanel.getRowFormatter().addStyleName(0, "titleEvent");
    infoEventPanel.getRowFormatter().addStyleName(1, "ownerEvent");
    infoEventPanel.getRowFormatter().addStyleName(2, "startEvent");

    vp.add(infoEventPanel);
    return vp;
}

From source file:ilarkesto.gwt.client.ImageAnchor.java

License:Open Source License

public ImageAnchor(Image image, String text, boolean spacerBetweenImageAndText) {
    if (image == null && text == null)
        throw new IllegalArgumentException("image or text must be not null");

    a = AnchorElement.as(DOM.createAnchor());
    setElement(a);//from w  ww .  j  a v a 2  s .c om
    setStyleName("ImageAnchor");

    // a.setHref("javascript:");

    if (image != null) {
        Element img = image.getElement();
        DOM.appendChild(getElement(), img);
    }

    // if (spacerBetweenImageAndText && image != null && text != null) {
    // Element span = DOM.createSpan();
    // span.setInnerHTML("&nbsp;");
    // DOM.appendChild(getElement(), span);
    // }

    if (text != null) {
        Element div = DOM.createDiv();
        div.setClassName("text");
        div.setInnerText(text);
        DOM.appendChild(getElement(), div);
    }

    if (image != null) {
        Element clear = DOM.createDiv();
        clear.setClassName("floatClear");
        DOM.appendChild(getElement(), clear);
    }
}

From source file:info.magnolia.ui.vaadin.gwt.client.applauncher.widget.VPermanentAppTileGroup.java

License:Open Source License

private void createSectionItem() {
    final Element sectionEl = DOM.createDiv();
    final Element sectionLabel = DOM.createSpan();

    sectionEl.appendChild(sectionLabel);
    sectionEl.addClassName("item");
    sectionEl.addClassName("section");

    sectionLabel.addClassName("sectionLabel");
    if (caption != null && !caption.contains("\u00AD")) {
        sectionLabel.addClassName("wordwrap");
    }/*  www  .j av a 2s  . co  m*/
    sectionLabel.setInnerText(caption);
    sectionEl.getStyle().setBackgroundColor(getColor());
    getElement().appendChild(sectionEl);
}

From source file:info.magnolia.ui.vaadin.gwt.client.applauncher.widget.VTemporaryAppGroupBarTile.java

License:Open Source License

private void constructDOM(String caption) {

    element = this.getElement();
    element.addClassName("item");
    element.addClassName("section");
    element.addClassName("closed");

    /*//  ww  w.  j  a  v a2s .  com
     * if (group.isClientGroup()) {
     * element.addClassName("client-group");
     * } else {
     * }
     */

    final Element label = DOM.createSpan();
    label.addClassName("sectionLabel");
    if (caption != null && !caption.contains("\u00AD")) {
        label.addClassName("wordwrap");
    }
    label.setInnerText(caption);

    Element notch = DOM.createSpan();
    notch.addClassName("notch");

    element.appendChild(label);
    element.appendChild(notch);

}