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

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

Introduction

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

Prototype

public String getHTML() 

Source Link

Usage

From source file:org.uberfire.ext.widgets.common.client.tables.popup.NewFilterPopup.java

License:Apache License

public void addListBoxToFilter(String label, String fieldName, boolean multiselect,
        HashMap<String, String> listBoxInfo) {
    FormGroup controlGroup = new FormGroup();

    FormLabel controlLabel = new FormLabel();
    controlLabel.setTitle(label);/*w ww  .  j  a  va 2s  .c  o  m*/
    HTML lab = new HTML("<span style=\"margin-right:10px\">" + label + "</span>");
    controlLabel.setHTML(lab.getHTML());

    ListBox listBox = new ListBox(multiselect);
    if (listBoxInfo != null) {
        Set listBoxKeys = listBoxInfo.keySet();
        Iterator it = listBoxKeys.iterator();
        String key;
        while (it.hasNext()) {
            key = (String) it.next();
            listBox.addItem(listBoxInfo.get(key), key);
        }
    }
    listBox.setName(fieldName);

    controlGroup.add(controlLabel);
    controlGroup.add(listBox);

    filterControlGroups.add(controlGroup);
    horizontalForm.add(controlGroup);
}

From source file:org.uberfire.ext.widgets.common.client.tables.popup.NewFilterPopup.java

License:Apache License

public void addTextBoxToFilter(String label, String fieldName, String defaultValue) {
    FormGroup controlGroup = new FormGroup();

    FormLabel controlLabel = new FormLabel();
    controlLabel.setTitle(label);//w  w w . j  av a2 s  . co m
    HTML lab = new HTML("<span style=\"margin-right:10px\">" + label + "</span>");
    controlLabel.setHTML(lab.getHTML());

    TextBox textBox = new TextBox();
    textBox.setName(fieldName);
    if (defaultValue != null && defaultValue.trim().length() > 0) {
        textBox.setText(defaultValue);
    }

    controlGroup.add(controlLabel);
    controlGroup.add(textBox);

    filterControlGroups.add(controlGroup);
    horizontalForm.add(controlGroup);
}

From source file:org.uberfire.ext.widgets.common.client.tables.popup.NewTabFilterPopup.java

License:Apache License

public void init() {
    basicTabPanel.clear();/*  ww  w.j a va  2  s .  co m*/
    filterControlGroups.clear();
    filterForm.clear();

    FormGroup controlGroup = new FormGroup();

    FormLabel controlLabel = new FormLabel();
    controlLabel.setTitle(CommonConstants.INSTANCE.Filter_Name());
    HTML lab = new HTML("<span style=\"color:red\"> * </span>" + "<span style=\"margin-right:10px\">"
            + CommonConstants.INSTANCE.Filter_Name() + "</span>");
    controlLabel.setHTML(lab.getHTML());

    TextBox fieldTextBox = new TextBox();
    fieldTextBox.setName(FILTER_TAB_NAME_PARAM);

    controlGroup.add(controlLabel);
    controlGroup.add(fieldTextBox);

    filterControlGroups.add(controlGroup);
    basicTabPanel.add(controlGroup);

    controlGroup = new FormGroup();

    controlLabel = new FormLabel();
    controlLabel.setTitle("Filter description");
    lab = new HTML("<span style=\"color:red\"> * </span>" + "<span style=\"margin-right:10px\">"
            + "Filter description" + "</span>");
    controlLabel.setHTML(lab.getHTML());

    fieldTextBox = new TextBox();
    fieldTextBox.setName(FILTER_TAB_DESC_PARAM);

    controlGroup.add(controlLabel);
    controlGroup.add(fieldTextBox);

    filterControlGroups.add(controlGroup);

    basicTabPanel.add(controlGroup);
}

From source file:org.uberfire.ext.widgets.common.client.tables.popup.NewTabFilterPopup.java

License:Apache License

public void addListBoxToFilter(String label, String fieldName, boolean multiselect,
        HashMap<String, String> listBoxInfo) {
    FormGroup controlGroup = new FormGroup();

    FormLabel controlLabel = new FormLabel();
    controlLabel.setTitle(label);/*from  ww  w .  jav  a  2 s .co m*/
    HTML lab = new HTML("<span style=\"margin-right:10px\">" + label + "</span>");
    controlLabel.setHTML(lab.getHTML());

    ListBox listBox = new ListBox(multiselect);
    if (listBoxInfo != null) {
        Set listBoxKeys = listBoxInfo.keySet();
        Iterator it = listBoxKeys.iterator();
        String key;
        while (it.hasNext()) {
            key = (String) it.next();
            listBox.addItem(listBoxInfo.get(key), key);
        }
    }
    listBox.setName(fieldName);

    controlGroup.add(controlLabel);
    controlGroup.add(listBox);

    filterControlGroups.add(controlGroup);
    filterForm.add(controlGroup);
}

From source file:org.uberfire.ext.widgets.common.client.tables.popup.NewTabFilterPopup.java

License:Apache License

public void addTextBoxToFilter(String label, String fieldName, String defaultValue) {
    FormGroup controlGroup = new FormGroup();

    FormLabel controlLabel = new FormLabel();
    controlLabel.setTitle(label);/*from w  w w  .  j a v a 2 s.  c  o  m*/
    HTML lab = new HTML("<span style=\"margin-right:10px\">" + label + "</span>");
    controlLabel.setHTML(lab.getHTML());

    TextBox textBox = new TextBox();
    textBox.setName(fieldName);
    if (defaultValue != null && defaultValue.trim().length() > 0) {
        textBox.setText(defaultValue);
    }

    controlGroup.add(controlLabel);
    controlGroup.add(textBox);

    filterControlGroups.add(controlGroup);
    filterForm.add(controlGroup);
}

From source file:strat.mining.multipool.stats.client.mvp.view.coinsolver.component.GlobalChartPanel.java

License:Open Source License

public Widget createLastStatsPanel(GlobalStatsDTO lastStats) {
    HtmlLayoutContainerTemplate templates = GWT.create(HtmlLayoutContainerTemplate.class);

    // Remove the last panel
    if (lastStatsPanel != null) {
        contentPanel.remove(lastStatsPanel);
    }/*from   ww  w. ja  v a2 s.c  om*/

    lastStatsPanel = new HtmlLayoutContainer(templates.getTemplate());
    lastStatsPanel.setWidth(460);

    final DateTimeFormat dtf = DateTimeFormat.getFormat("EEE d MMM HH:mm:ss");

    // Name labels
    Label balanceLabel = new Label("Balance: ");
    Label unexchangedLabel = new Label("Unexchanged: ");
    Label immatureLabel = new Label("Immature: ");
    Label totalLabel = new Label("Total: ");
    Label acceptedMegaHashLabel = new Label("MH/s: ");
    Label nbMinersLabel = new Label("Workers: ");
    Label lastUpdateTimeLabel = new Label("Last update: ");
    Label currentCoinsLabel = new Label("Current coins: ");

    // Values label
    Label balanceValue = new Label(lastStats != null ? formatBTCValue(lastStats.getTotalBalance()) : "");
    Label unexchangedValue = new Label(
            lastStats != null ? formatBTCValue(lastStats.getTotalUnexchanged()) : "");
    Label immatureValue = new Label(lastStats != null ? formatBTCValue(lastStats.getTotalImmature()) : "");
    Label totalValue = new Label(lastStats != null ? formatBTCValue(
            lastStats.getTotalBalance() + lastStats.getTotalUnexchanged() + lastStats.getTotalImmature()) : "");
    Label acceptedMegaHashValue = new Label(
            lastStats != null ? formatPowerValue(lastStats.getTotalMegahashesPerSecond()) : "");
    Label nbMinersValue = new Label(
            lastStats != null && lastStats.getNbMiners() != null ? lastStats.getNbMiners().toString() : "");
    Label lastUpdateTimeValue = new Label(lastStats != null ? dtf.format(lastStats.getRefreshTime()) : "");
    HTML currentCoinsValue = new HTML("");

    if (lastStats.getMiningCoins() != null) {
        NumberFormat nf = NumberFormat.getFormat("#.##");
        String coinsValue = "<ul class=\"miningCoinList\">";
        for (CoinInfoDTO coin : lastStats.getMiningCoins()) {
            coinsValue += "<li><b>" + coin.getFullname() + ":</b> " + formatPowerValue(coin.getPoolHashrate())
                    + " MH/s, "
                    + nf.format((coin.getPoolHashrate() / lastStats.getTotalMegahashesPerSecond() * 100))
                    + " %</li>";
        }
        coinsValue += "</ul>";
        currentCoinsValue.setHTML(coinsValue);
    }

    lastStatsPanel.add(balanceLabel, new HtmlData(".label1"));
    lastStatsPanel.add(unexchangedLabel, new HtmlData(".label2"));
    lastStatsPanel.add(immatureLabel, new HtmlData(".label3"));
    lastStatsPanel.add(totalLabel, new HtmlData(".label4"));
    lastStatsPanel.add(acceptedMegaHashLabel, new HtmlData(".label5"));
    lastStatsPanel.add(nbMinersLabel, new HtmlData(".label6"));
    lastStatsPanel.add(lastUpdateTimeLabel, new HtmlData(".label7"));
    lastStatsPanel.add(currentCoinsLabel, new HtmlData(".coinLabel"));

    lastStatsPanel.add(balanceValue, new HtmlData(".value1"));
    lastStatsPanel.add(unexchangedValue, new HtmlData(".value2"));
    lastStatsPanel.add(immatureValue, new HtmlData(".value3"));
    lastStatsPanel.add(totalValue, new HtmlData(".value4"));
    lastStatsPanel.add(acceptedMegaHashValue, new HtmlData(".value5"));
    lastStatsPanel.add(nbMinersValue, new HtmlData(".value6"));
    lastStatsPanel.add(lastUpdateTimeValue, new HtmlData(".value7"));
    lastStatsPanel.add(currentCoinsValue, new HtmlData(".coinValue"));

    ToolTipConfig config = new ToolTipConfig();
    String tooltip = "<b>" + balanceLabel.getText() + "</b>" + balanceValue.getText();
    tooltip += "<br/><b>" + unexchangedLabel.getText() + "</b>" + unexchangedValue.getText();
    tooltip += "<br/><b>" + totalLabel.getText() + "</b>" + totalValue.getText();
    tooltip += "<br/><b>" + acceptedMegaHashLabel.getText() + "</b>" + acceptedMegaHashValue.getText();
    tooltip += "<br/><b>" + currentCoinsLabel.getText() + "</b>" + currentCoinsValue.getHTML();
    tooltip += "<br/><b>" + nbMinersLabel.getText() + "</b>" + nbMinersValue.getText();
    tooltip += "<br/><b>" + lastUpdateTimeLabel.getText() + "</b>" + lastUpdateTimeValue.getText();
    config.setBodyHtml(tooltip);
    config.setTrackMouse(true);
    config.setDismissDelay(0);
    config.setHideDelay(0);
    lastStatsPanel.setToolTipConfig(config);

    return lastStatsPanel;
}

From source file:thothbot.parallax.demo.client.ContentWidgetView.java

License:Open Source License

public void setDescription(HTML html) {
    this.descriptionField.setInnerHTML(html.getHTML());
}