Java Code Examples for com.google.gwt.user.client.Element#setInnerText()

The following examples show how to use com.google.gwt.user.client.Element#setInnerText() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MapEditorView.java    From dashbuilder with Apache License 2.0 5 votes vote down vote up
@Override
public MapEditor.View showError(final SafeHtml message) {
    final Element element = errorLabel.getElement();
    element.setInnerText(message.asString());
    element.getStyle().setDisplay(Style.Display.INLINE);
    element.getStyle().setBorderColor("red");
    element.getStyle().setBorderStyle(Style.BorderStyle.SOLID);
    element.getStyle().setBorderWidth(1, Style.Unit.PX);
    errorLabel.setVisible(true);
    return this;
}
 
Example 2
Source File: MapEditorView.java    From dashbuilder with Apache License 2.0 5 votes vote down vote up
@Override
public MapEditor.View clearError() {
    final Element element = errorLabel.getElement();
    element.setInnerText("");
    element.getStyle().setDisplay(Style.Display.NONE);
    element.getStyle().setBorderWidth(0, Style.Unit.PX);
    errorLabel.setVisible(false);
    return this;
}
 
Example 3
Source File: StackedBar.java    From core with GNU Lesser General Public License v2.1 4 votes vote down vote up
public Widget asWidget() {

        SafeHtmlBuilder builder = new SafeHtmlBuilder();

        builder.appendHtmlConstant("<div id='"+ outerId +"'><div id='"+innerId+"'/></div>");

        panel = new HTMLPanel(builder.toSafeHtml());

        Element outerElement = panel.getElementById(outerId);
        outerElement.addClassName("stacked-bar-total");
        outerElement.setAttribute("style", "width:100%");
        outerElement.setAttribute("cssText", "width:100%!important");


        Element innerElement = panel.getElementById(innerId);
        innerElement.addClassName("stacked-bar-actual");
        innerElement.setInnerText(label);

        return panel;
    }