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

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

Introduction

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

Prototype

protected Label(Element element) 

Source Link

Document

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

Usage

From source file:com.bramosystems.oss.player.showcase.client.PlayerLogPane.java

License:Apache License

private void log(String message) {
    Label l = new Label("+ " + message);
    l.setWordWrap(true);
    list.add(l);
}

From source file:com.briceducardonnoy.artistshowcase.client.application.widgets.ImageButton.java

License:Open Source License

@Override
public void setText(final String text) {
    Label lbl = new Label(text);
    getElement().appendChild(lbl.getElement());
}

From source file:com.calclab.emite.example.chat.client.ExampleIMChat.java

License:Open Source License

private void log(final String text) {
    output.add(new Label(text));
}

From source file:com.calclab.emite.example.pingpong.client.PingPongWidget.java

License:Open Source License

public PingPongWidget() {
    maxOutput = 500;/*from  w  ww. j  a  v a2s. c  o  m*/
    hideEvents = true;
    header = new VerticalPanel();
    add(header);
    currentUser = new Label("no user yet.");
    sessionStatus = new Label("no session status yet.");
    final FlowPanel status = new FlowPanel();
    status.add(currentUser);
    status.add(sessionStatus);
    add(status);
    login = new Button("Login");
    logout = new Button("Logout");
    clear = new Button("Clear");
    final CheckBox hideEventsCheck = new CheckBox("Hide events");
    buttons = new FlowPanel();
    buttons.add(login);
    buttons.add(logout);
    buttons.add(clear);
    buttons.add(hideEventsCheck);
    add(buttons);
    output = new VerticalPanel();
    add(output);

    hideEventsCheck.addValueChangeHandler(new ValueChangeHandler<Boolean>() {
        @Override
        public void onValueChange(final ValueChangeEvent<Boolean> event) {
            hideEvents = event.getValue();
            final int widgetCount = output.getWidgetCount();
            for (int index = 0; index < widgetCount; index++) {
                final Widget w = output.getWidget(index);
                if (isEventWidget(w)) {
                    w.setVisible(!hideEvents);
                }
            }
        }
    });
    hideEventsCheck.setValue(hideEvents);
}

From source file:com.calclab.emite.example.pingpong.client.PingPongWidget.java

License:Open Source License

@Override
public void print(final String text, final String style) {
    final int widgetCount = output.getWidgetCount();
    if (widgetCount == maxOutput) {
        output.remove(widgetCount - 1);// w w  w. j a v a 2  s. c  o  m
    }
    final Label label = new Label(text);
    label.addStyleName(style);
    if (isEventWidget(label)) {
        label.setVisible(!hideEvents);
    }
    output.insert(label, 0);
}

From source file:com.calclab.emite.example.pingpong.client.PingPongWidget.java

License:Open Source License

@Override
public void printHeader(final String text, final String style) {
    final Label label = new Label(text);
    label.addStyleName(style);/*from   w  ww.  j av a  2 s  .c  o  m*/
    header.add(label);

}

From source file:com.calclab.emite.example.session.client.ExampleXmppSession.java

License:Open Source License

private void log(final String text) {
    panel.add(new Label(text));
}

From source file:com.calclab.emite.hablar.client.pages.roster.SubscriptionRequestedPanel.java

License:Open Source License

public SubscriptionRequestedPanel(final XmppURI jid, final String nick,
        final SubscriptionRequestedListener listener) {
    setStyleName("notification");

    add(new Label(nick + " (" + jid.toString() + ") wants to subscribe to your presence."));
    final FlowPanel flow = new FlowPanel();
    final Button btnAccept = new Button("Accept", new ClickHandler() {
        public void onClick(final ClickEvent event) {
            listener.accepted(SubscriptionRequestedPanel.this, jid, nick);
        }/* www.jav  a 2s.c o m*/
    });
    flow.add(btnAccept);
    final Button btnReject = new Button("Reject", new ClickHandler() {
        public void onClick(final ClickEvent event) {
            listener.rejected(SubscriptionRequestedPanel.this, jid);
        }
    });
    flow.add(btnReject);
    add(flow);
}

From source file:com.calclab.emite.widgets.client.logger.LoggerWidget.java

License:Open Source License

public void write(final String color, final String message) {
    final Label label = new Label(message);
    label.addStyleName(color);/* w w w .j  a va2s. co  m*/
    content.add(label);
    scroll.ensureVisible(label);
}

From source file:com.calclab.emite.widgets.client.roster.GWTRosterWidget.java

License:Open Source License

public void addItem(final XmppURI jid) {
    final Label label = new Label(jid.toString());
    add(label);
}