Example usage for com.google.gwt.user.client.ui Label setText

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

Introduction

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

Prototype

public void setText(String text) 

Source Link

Document

Sets the label's content to the given text.

Usage

From source file:edu.ucsb.eucalyptus.admin.client.extensions.store.ImageWidget.java

License:Open Source License

private void setProvider(String title, String uri) {
    String styleName = "istore-known-provider-title";

    if (title == null) {
        styleName = "istore-unknown-provider-title";
        title = "Unknown";
    }// w w  w  .j a v  a  2  s. co  m

    Widget providerTitleWidget;
    if (uri == null) {
        Label providerLabel = new Label();
        providerLabel.setText(title);
        providerTitleWidget = providerLabel;
    } else {
        Anchor providerAnchor = new Anchor();
        providerAnchor.setText(title);
        providerAnchor.setHref(uri);
        providerTitleWidget = providerAnchor;
    }

    providerTitlePanel.setWidget(providerTitleWidget);
    providerTitleWidget.setStyleName(styleName);
    providerTitleWidget.addStyleName("istore-provider-title");
}

From source file:edu.ucsb.eucalyptus.admin.client.VmTypeTable.java

License:Open Source License

private void addVmTypeEntry(int row, VmTypeWeb VmType) {
    if ((row % 2) == 1) {
        this.grid.getRowFormatter().setStyleName(row, "euca-table-odd-row");
    } else {/*from   ww  w .ja  va2  s . c o m*/
        this.grid.getRowFormatter().setStyleName(row, "euca-table-even-row");
    }

    final CheckBox cb = new CheckBox();
    cb.addClickListener(new ChangeCallback(this, row));
    cb.setChecked(true); // TODO: get this from server
    //this.grid.setWidget( row, 0, cb );

    final Label name_b = new Label();
    name_b.setText(VmType.getName());
    this.grid.setWidget(row, 1, name_b);

    final TextBox cpu_b = new TextBox();
    cpu_b.addChangeListener(new ChangeCallback(this, row));
    cpu_b.setVisibleLength(2);
    cpu_b.setText("" + VmType.getCpu());
    this.grid.setWidget(row, 2, cpu_b);
    this.grid.getCellFormatter().setHorizontalAlignment(row, 2, HasHorizontalAlignment.ALIGN_CENTER); // michael had these three commented out

    final TextBox mem_b = new TextBox();
    mem_b.addChangeListener(new ChangeCallback(this, row));
    mem_b.setVisibleLength(4);
    mem_b.setText("" + VmType.getMemory());
    this.grid.setWidget(row, 3, mem_b);
    this.grid.getCellFormatter().setHorizontalAlignment(row, 3, HasHorizontalAlignment.ALIGN_CENTER);

    final TextBox disk_b = new TextBox();
    disk_b.addChangeListener(new ChangeCallback(this, row));
    disk_b.setVisibleLength(4);
    disk_b.setText("" + VmType.getDisk());
    this.grid.setWidget(row, 4, disk_b);
    this.grid.getCellFormatter().setHorizontalAlignment(row, 4, HasHorizontalAlignment.ALIGN_CENTER);

}

From source file:eml.studio.client.ui.property.PropertyTable.java

License:Open Source License

public void addProperty(Property p, int row) {
    grid.setWidget(row, 0, new Label(p.getName()));

    Label box = new Label();
    box.setText(p.getValue());
    grid.setWidget(row, 1, box);/*from   w  w w.  j  a v  a2  s.  co m*/
    box.setStyleName("propetybox");
    properties.put(p, box);
}

From source file:eml.studio.client.ui.widget.panel.SqlScriptFileConfigTable.java

License:Open Source License

public void deleteRow(int row) {
    this.removeRow(row);
    for (int i = row; i < this.getRowCount() - 1; ++i) {
        Label label = (Label) this.getWidget(i, 0);
        label.setText(name + " " + i);
    }/*from  w  w  w .ja  v  a  2  s  .c o  m*/
    active();
}

From source file:eml.studio.client.ui.widget.panel.SqlScriptFileConfigTable.java

License:Open Source License

protected void addRow(int row, TextBox box) {
    this.insertRow(row);
    this.setWidget(row, 0, new Label(name + " " + row));
    this.setWidget(row, 1, box);

    Label add = new Label();
    add.addStyleName("admin-user-edit");
    Label del = new Label();
    del.addStyleName("admin-user-delete");
    this.setWidget(row, 2, add);
    this.setWidget(row, 3, del);

    for (int i = row + 1; i < this.getRowCount() - 1; ++i) {
        Label label = (Label) this.getWidget(i, 0);
        label.setText(name + " " + i);
    }//  ww w  .  j  a  va  2  s.co  m

    add.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            int i = 0;
            while (i < SqlScriptFileConfigTable.this.getRowCount()
                    && SqlScriptFileConfigTable.this.getWidget(i, 2) != event.getSource())
                i++;
            if (i < SqlScriptFileConfigTable.this.getRowCount()) {
                addRow(i, "");
            }
        }
    });

    del.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            int i = 0;
            while (i < SqlScriptFileConfigTable.this.getRowCount()
                    && SqlScriptFileConfigTable.this.getWidget(i, 3) != event.getSource())
                i++;
            if (i < SqlScriptFileConfigTable.this.getRowCount()) {
                deleteRow(i);
            }
        }
    });

    active();
}

From source file:eolus.client.UI_Elements.HTMLwriter.java

License:EUPL

public static void clearLabel(Label l) {
    l.setText("");
    l.setVisible(false);/*  w  w  w .j a v  a 2 s  .c o  m*/
    l.setStyleName("system");
}

From source file:eolus.client.UI_Elements.MyHandlers.java

License:EUPL

public static void setNegative(Label l, String text) {
    l.setStyleName("system negative");
    l.setText(text);
    l.setVisible(true);/*w  w  w . j a  v  a 2 s . c  o  m*/
}

From source file:eolus.client.UI_Elements.MyHandlers.java

License:EUPL

public static void setPositive(Label l, String text) {
    l.setStyleName("system positive");
    l.setText(text);
    l.setVisible(true);/*from  w  w w . ja v  a  2 s.c om*/

}

From source file:es.deusto.weblab.client.lab.experiments.commands.RequestWebcamCommand.java

License:Open Source License

/**
 * Helper method which creates a RequestWebcamCommands and sends it, 
 * updating by itself the webcam if it is successful or setting an error 
 * message if not.//from  ww  w.j  av a  2 s .c o m
 *
 * @param boardController Reference to the board controller to send
 * the command through.
 * @param webcam Reference to the wecam whose URL should be set.
 * @param messages Reference to the label which will display the 
 * error message, if any. If null, no error message will be set.
 */
public static void createAndSend(IBoardBaseController boardController, final WlWebcam webcam,
        final Label messages) {

    final RequestWebcamCommand command = new RequestWebcamCommand();

    boardController.sendCommand(command, new IResponseCommandCallback() {

        @Override
        public void onSuccess(ResponseCommand responseCommand) {
            final String url = RequestWebcamCommand.retrieveWebcamURL(responseCommand.getCommandString());
            if (url != null && url.length() > 0) {
                webcam.setUrl(url);
            }
        }

        @Override
        public void onFailure(CommException e) {
            if (messages != null)
                messages.setText("Failed to obtain the webcam URL");
        }
    });

}

From source file:es.deusto.weblab.client.lab.ui.themes.es.deusto.weblab.defaultmobile.LoginWindow.java

License:Open Source License

private void showError(Label where, String message) {
    where.setStyleName(".visible-error"); // TODO: the color doesn't work :-S
    where.setText(message);
}