Example usage for com.google.gwt.user.client.ui HTML HTML

List of usage examples for com.google.gwt.user.client.ui HTML HTML

Introduction

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

Prototype

protected HTML(Element element) 

Source Link

Document

This constructor may be used by subclasses to explicitly use an existing element.

Usage

From source file:com.appspot.codsallarts.client.Application.java

License:Apache License

/**
 * Add a link to the top of the page./*  w ww  .  j  a va2s .c o m*/
 * 
 * @param link the widget to add to the mainLinks
 */
public void setLinks(List<Widget> links) {
    boolean first = true;
    for (Widget w : links) {
        if (!first) {
            linksPanel.add(new HTML("&nbsp;|&nbsp;"));
            first = false;
        }
        linksPanel.add(w);
    }
}

From source file:com.appspot.codsallarts.client.Application.java

License:Apache License

/**
 * Set the {@link Widget} to display in the content area.
 * //from www .j ava  2 s  .  c o  m
 * @param content the content widget
 */
public void setContent(Widget content) {
    if (content == null) {
        contentWrapper.setWidget(new HTML("Coming Soon"));
    } else {
        contentWrapper.setWidget(content);
    }
}

From source file:com.appspot.hommkmessage.client.view.Hommk_message.java

License:Open Source License

private ListView createListView(String password) {
    RootPanel.get("listViewContainer").getElement().setInnerHTML("");
    RootPanel.get("listViewContainer").add(new HTML("<b>Nachrichten sortiert nach Upload-Datum:</b>"));

    DateFormatter dateFormatter = new DateFormatter();
    LocalStorage localStorage = new LocalStorage();
    final ListView listView = new ListView(dateFormatter, localStorage, password);
    RootPanel.get("listViewContainer").add(listView);
    return listView;
}

From source file:com.appspot.hommkmessage.client.view.ListView.java

License:Open Source License

public ListView(DateFormatter dateFormatter, LocalStorage localStorage, String password) {
    this.dateFormatter = dateFormatter;
    this.localStorage = localStorage;
    this.password = password;
    this.userId = localStorage.getUserId();

    setWidth("100%");

    throbberPanel = new VerticalPanel();
    throbberPanel.setWidth("100%");
    Image image = new Image("images/roller.gif");
    throbberPanel.add(new HTML("<p></p>"));
    throbberPanel.add(image);/*from   w  w  w  .  j a v  a 2  s .com*/
    throbberPanel.setCellHorizontalAlignment(image, ALIGN_CENTER);
}

From source file:com.appspot.hommkmessage.client.view.ListView.java

License:Open Source License

private AsyncCallback<List<MessageMetadata>> refreshCallback() {
    return new AsyncCallback<List<MessageMetadata>>() {

        @Override/*from   w w w  . j a v a 2  s  .  co  m*/
        public void onSuccess(List<MessageMetadata> messageMetadataList) {
            throbberPanel.setVisible(false);
            if (messageMetadataList.isEmpty()) {
                add(new HTML("kein Ergebnis gefunden"));
            }
            int index = 0;
            for (MessageMetadata messageMetadata : messageMetadataList) {
                index++;
                createListEntry(index, messageMetadata);
            }
        }

        @Override
        public void onFailure(Throwable caught) {
            throbberPanel.setVisible(false);
            HTML textBox = new HTML();
            textBox.setText("Server error");
            textBox.addStyleName("serverResponseError");
            add(textBox);
        }
    };
}

From source file:com.appspot.hommkmessage.shared.MessageMetadata.java

License:Open Source License

public HTML getInfoLine(DateFormatter dateFormatter, LocalStorage localStorage) {
    String creationDatePart = "<span class=\"messageListEntryUploadDate\">"
            + dateFormatter.formatDateTime(creationDate) + "</span>";
    String iconHtml = getMessageType().getIconHtml();
    SafeHtmlBuilder safeHtmlBuilder = new SafeHtmlBuilder();
    String subjectClass = "";
    if (localStorage.isMessageUnread(id)) {
        subjectClass = "messageListEntrySubjectUnread";
    }//from w ww  .  j  a v a  2  s.co m
    safeHtmlBuilder.appendHtmlConstant("<span class=\"" + subjectClass + "\">");
    safeHtmlBuilder.appendEscaped(subjectText);
    safeHtmlBuilder.appendHtmlConstant("</span><br/><span class=\"messageListEntrySecondLine\">");
    safeHtmlBuilder.appendEscaped(messageDateText);
    safeHtmlBuilder.appendEscaped(receiverText);
    safeHtmlBuilder.appendHtmlConstant("</span>");
    return new HTML(creationDatePart + " -- " + iconHtml + safeHtmlBuilder.toSafeHtml().asString());
}

From source file:com.appspot.sendmail.client.RichTextToolbar.java

License:Open Source License

/** Initialize the options on the toolbar **/
private void buildTools() {
    //Init the TOP Panel forst
    topPanel.add(bold = createToggleButton(HTTP_STATIC_ICONS_GIF, 0, 0, 20, 20, GUI_HOVERTEXT_BOLD));
    topPanel.add(italic = createToggleButton(HTTP_STATIC_ICONS_GIF, 0, 60, 20, 20, GUI_HOVERTEXT_ITALIC));
    topPanel.add(//  w  w  w.  j a  v a2  s.c o  m
            underline = createToggleButton(HTTP_STATIC_ICONS_GIF, 0, 140, 20, 20, GUI_HOVERTEXT_UNDERLINE));
    topPanel.add(stroke = createToggleButton(HTTP_STATIC_ICONS_GIF, 0, 120, 20, 20, GUI_HOVERTEXT_STROKE));
    topPanel.add(new HTML("&nbsp;"));
    topPanel.add(
            subscript = createToggleButton(HTTP_STATIC_ICONS_GIF, 0, 600, 20, 20, GUI_HOVERTEXT_SUBSCRIPT));
    topPanel.add(
            superscript = createToggleButton(HTTP_STATIC_ICONS_GIF, 0, 620, 20, 20, GUI_HOVERTEXT_SUPERSCRIPT));
    topPanel.add(new HTML("&nbsp;"));
    topPanel.add(alignleft = createPushButton(HTTP_STATIC_ICONS_GIF, 0, 460, 20, 20, GUI_HOVERTEXT_ALIGNLEFT));
    topPanel.add(
            alignmiddle = createPushButton(HTTP_STATIC_ICONS_GIF, 0, 420, 20, 20, GUI_HOVERTEXT_ALIGNCENTER));
    topPanel.add(
            alignright = createPushButton(HTTP_STATIC_ICONS_GIF, 0, 480, 20, 20, GUI_HOVERTEXT_ALIGNRIGHT));
    topPanel.add(new HTML("&nbsp;"));
    topPanel.add(orderlist = createPushButton(HTTP_STATIC_ICONS_GIF, 0, 80, 20, 20, GUI_HOVERTEXT_ORDERLIST));
    topPanel.add(
            unorderlist = createPushButton(HTTP_STATIC_ICONS_GIF, 0, 20, 20, 20, GUI_HOVERTEXT_UNORDERLIST));
    topPanel.add(
            indentright = createPushButton(HTTP_STATIC_ICONS_GIF, 0, 400, 20, 20, GUI_HOVERTEXT_IDENTRIGHT));
    topPanel.add(indentleft = createPushButton(HTTP_STATIC_ICONS_GIF, 0, 540, 20, 20, GUI_HOVERTEXT_IDENTLEFT));
    topPanel.add(new HTML("&nbsp;"));
    topPanel.add(generatelink = createPushButton(HTTP_STATIC_ICONS_GIF, 0, 500, 20, 20, GUI_HOVERTEXT_LINK));
    topPanel.add(breaklink = createPushButton(HTTP_STATIC_ICONS_GIF, 0, 640, 20, 20, GUI_HOVERTEXT_BREAKLINK));
    topPanel.add(new HTML("&nbsp;"));
    topPanel.add(insertline = createPushButton(HTTP_STATIC_ICONS_GIF, 0, 360, 20, 20, GUI_HOVERTEXT_HLINE));
    //topPanel.add(insertimage = createPushButton(HTTP_STATIC_ICONS_GIF,0,380,20,20,GUI_HOVERTEXT_IMAGE));
    topPanel.add(new HTML("&nbsp;"));
    topPanel.add(removeformatting = createPushButton(HTTP_STATIC_ICONS_GIF, 20, 460, 20, 20,
            GUI_HOVERTEXT_REMOVEFORMAT));
    topPanel.add(new HTML("&nbsp;"));
    topPanel.add(
            texthtml = createToggleButton(HTTP_STATIC_ICONS_GIF, 0, 260, 20, 20, GUI_HOVERTEXT_SWITCHVIEW));

    //Init the BOTTOM Panel
    bottomPanel.add(fontlist = createFontList());
    bottomPanel.add(new HTML("&nbsp;"));
    bottomPanel.add(colorlist = createColorList());
}

From source file:com.appspot.socialinquirer.client.util.UiUtils.java

License:Apache License

/**
 * Show help dialog./*w w w  .j  a  v a2  s.c o m*/
 *
 * @param clientFactory the client factory
 * @param name the name
 */
public static void showHelpDialog(ClientFactory clientFactory, String name) {
    final EverScribeConstants constants = clientFactory.getConstants();
    clientFactory.getContentService().getHelpText(name, new AsyncCallback<String>() {

        @Override
        public void onFailure(Throwable caught) {
            UiUtils.showErrorDialog(constants, caught.getLocalizedMessage());
        }

        @Override
        public void onSuccess(String result) {
            final DialogBox dialogBox = new DialogBox();
            dialogBox.setText(constants.titleDialogBoxHelp());
            dialogBox.setAnimationEnabled(true);
            dialogBox.setWidth("400px");
            dialogBox.setHeight("200px");
            VerticalPanel dialogVPanel = new VerticalPanel();
            dialogVPanel.add(new HTML(result));
            final Button closeButton = new Button(constants.closeButton());
            // We can set the id of a widget by accessing its
            // Element
            closeButton.getElement().setId("closeButton");
            dialogVPanel.add(closeButton);
            dialogBox.setWidget(dialogVPanel);

            closeButton.addClickHandler(new ClickHandler() {
                public void onClick(ClickEvent event) {
                    dialogBox.hide();
                }
            });
            dialogBox.center();
        }
    });
}

From source file:com.appspot.socialinquirer.client.util.UiUtils.java

License:Apache License

/**
 * Show question summary dialog.// w  w  w  . j  a  va2 s  .  c o  m
 *
 * @param result the result
 * @param constants the constants
 */
public static void showQuestionSummaryDialog(String result, EverScribeConstants constants) {
    final DialogBox dialogBox = new DialogBox();
    dialogBox.setText("Summary");
    dialogBox.setAnimationEnabled(true);
    dialogBox.setWidth("400px");
    dialogBox.setHeight("200px");
    VerticalPanel dialogVPanel = new VerticalPanel();
    dialogVPanel.add(new HTML(result));
    final Button closeButton = new Button(constants.closeButton());
    // We can set the id of a widget by accessing its
    // Element
    closeButton.getElement().setId("closeButton");
    dialogVPanel.add(closeButton);
    dialogBox.setWidget(dialogVPanel);

    closeButton.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
            dialogBox.hide();
        }
    });
    dialogBox.center();
}

From source file:com.appspot.socialinquirer.client.util.UiUtils.java

License:Apache License

/**
 * Show question answer dialog./*from   w ww. jav  a 2s.  c o  m*/
 *
 * @param result the result
 * @param constants the constants
 */
public static void showQuestionAnswerDialog(String result, EverScribeConstants constants) {
    final DialogBox dialogBox = new DialogBox();
    dialogBox.setText("Suggested Answer");
    dialogBox.setAnimationEnabled(true);
    dialogBox.setWidth("400px");
    dialogBox.setHeight("200px");
    VerticalPanel dialogVPanel = new VerticalPanel();
    dialogVPanel.add(new HTML(result));
    final Button closeButton = new Button(constants.closeButton());
    // We can set the id of a widget by accessing its
    // Element
    closeButton.getElement().setId("closeButton");
    dialogVPanel.add(closeButton);
    dialogBox.setWidget(dialogVPanel);

    closeButton.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
            dialogBox.hide();
        }
    });
    dialogBox.center();
}