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:org.jboss.overview.client.Overview.java

License:sencha.com license

@Override
public void onModuleLoad() {
    // State manager, initialize the state options
    StateManager.get().setProvider(new CookieProvider("/", null, null, GXT.isSecure()));

    //page intialization
    rootPanel.setStyleName("rootPanel");

    Label heading = new Label();
    heading.setText("Pull Request Bugzilla overview");
    heading.setStyleName("appHeading");

    rootPanel.add(heading);/* w  ww. ja  v a  2 s  .com*/
    rootPanel.add(new OverviewTable());

    //        RootPanel.get().add(asWidget());

}

From source file:org.jbpm.form.builder.ng.model.client.form.items.LabelFormItem.java

License:Apache License

@Override
public Widget cloneDisplay(Map<String, Object> data) {
    Label lb = new Label();
    populate(lb);//  w ww.  j av  a2  s  .c  o  m
    String value = (String) getInputValue(data);
    if (value != null) {
        lb.setText(value);
    } else {
        String locale = (String) data.get(CommonGlobals.BASE_LOCALE);
        lb.setText(this.label.getText());
        if (locale != null) {
            String i18nText = getI18n(locale);
            if (i18nText != null && !"".equals(i18nText)) {
                lb.setText(i18nText);
            }
        }
    }
    super.populateActions(lb.getElement());
    return lb;
}

From source file:org.jbpm.formbuilder.client.form.items.LabelFormItem.java

License:Apache License

@Override
public Widget cloneDisplay(Map<String, Object> data) {
    Label lb = new Label();
    populate(lb);//from   w  w w  .  ja  v a2 s.  c o  m
    String value = (String) getInputValue(data);
    if (value != null) {
        lb.setText(value);
    } else {
        String locale = (String) data.get(FormBuilderGlobals.BASE_LOCALE);
        lb.setText(this.label.getText());
        if (locale != null) {
            String i18nText = getI18n(locale);
            if (i18nText != null && !"".equals(i18nText)) {
                lb.setText(i18nText);
            }
        }
    }
    super.populateActions(lb.getElement());
    return lb;
}

From source file:org.kaaproject.avro.ui.gwt.client.widget.BusyPopup.java

License:Apache License

public BusyPopup() {
    glass = Document.get().createDivElement();
    glass.setClassName(Utils.avroUiStyle.busyGlass());

    glass.getStyle().setPosition(Position.ABSOLUTE);
    glass.getStyle().setLeft(0, Unit.PX);
    glass.getStyle().setTop(0, Unit.PX);
    glass.getStyle().setZIndex(GLASS_Z_INDEX);

    getElement().getStyle().setZIndex(POPUP_Z_INDEX);

    HorizontalPanel panel = new HorizontalPanel();
    panel.setSize("320px", "70px");
    panel.addStyleName(Utils.avroUiStyle.busyPopup());
    Image image = new Image();
    image.setResource(Utils.resources.busyIndicator());
    panel.add(image);/*from  w  w  w . j  a v  a 2s .  c  om*/
    panel.setCellWidth(image, "60px");
    panel.setCellHorizontalAlignment(image, HasHorizontalAlignment.ALIGN_CENTER);
    panel.setCellVerticalAlignment(image, HasVerticalAlignment.ALIGN_MIDDLE);
    Label label = new Label();
    label.setText(Utils.constants.busyPopupText());
    label.getElement().getStyle().setPaddingRight(15, Unit.PX);
    panel.add(label);
    panel.setCellHorizontalAlignment(label, HasHorizontalAlignment.ALIGN_CENTER);
    panel.setCellVerticalAlignment(label, HasVerticalAlignment.ALIGN_MIDDLE);
    setWidget(panel);

}

From source file:org.kaaproject.kaa.server.admin.client.layout.AppLayout.java

License:Apache License

private void init() {
    final SimplePanel emptyPanel = new SimplePanel();
    navContent = new CustomDeckLayoutPanel();
    navContent.setAnimationVertical(false);

    navContent.setAnimationDuration(0);//from  w  ww .  ja va 2s.co  m
    navContent.setStyleName(kaaAdminStyle.bNavContent());
    navContent.setSize("200px", "100%");

    navPanel.add(navContent);
    final Label back = new Label(OPEN);
    back.setStyleName(kaaAdminStyle.bNavLabel());

    navPanel.add(back);
    appHeader.setSize("100%", "60px");

    appContent.setStyleName(avroUiStyle.bAppContent());
    navPanel.setStyleName(kaaAdminStyle.bNavPanel());

    footerPanel.getElement().setInnerHTML(Utils.messages.footerMessage(Version.PROJECT_VERSION));

    back.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            if (clickCount == 1) {
                navContent.add(emptyPanel);
                navContent.setAnimationDuration(100);
                navContent.showWidget(clickCount, new CustomAnimationCallback(true));
                back.setText(CLOSE);
            } else if (clickCount % 2 == 0) {
                navContent.showWidget(0, new CustomAnimationCallback(false));
                back.setText(OPEN);
            } else {
                navContent.showWidget(1, new CustomAnimationCallback(true));
                back.setText(CLOSE);
            }
            incr();
        }
    });
}

From source file:org.kuali.student.common.ui.client.widgets.KSTextArea.java

License:Educational Community License

public KSTextArea(final Label countLabel) {
    super();/*from  w  ww  .j a  va  2  s . co  m*/
    setupDefaultStyle();
    countLabel.setText(this.maxLength + " characters left");
    this.addKeyUpHandler(new KeyUpHandler() {

        @Override
        public void onKeyUp(KeyUpEvent event) {
            setLabel(countLabel);
        }
    });

    this.addValueChangeHandler(new ValueChangeHandler<String>() {

        @Override
        public void onValueChange(ValueChangeEvent<String> event) {
            setLabel(countLabel);
        }
    });

}

From source file:org.kuali.student.common.ui.client.widgets.KSTextArea.java

License:Educational Community License

public void setLabel(final Label countLabel) {
    left = this.maxLength - KSTextArea.this.getText().length();
    if (KSTextArea.this.getText().length() > this.maxLength) {
        countLabel.setText("Please remove " + left * -1 + " characters");
    } else {//from w  ww .  j  a  v a  2s  . co  m
        countLabel.setText(left + " characters left");
    }
    if ((left <= (this.maxLength * 0.1)) || (left <= 10)) {
        countLabel.getElement().setAttribute("style", "color: red;");
    } else {
        countLabel.getElement().removeAttribute("style");
    }
}

From source file:org.metawidget.gwt.client.ui.layout.LabelLayoutDecorator.java

License:LGPL

@Override
protected void addSectionWidget(String section, int level, Panel container, GwtMetawidget metawidget) {

    Label label = new Label();
    label.setStyleName(mStyleName);/*w w w  . ja v a  2 s.c  o m*/

    // Section name (possibly localized)

    String localizedSection = metawidget.getLocalizedKey(StringUtils.camelCase(section));

    if (localizedSection == null) {
        localizedSection = section;
    }

    label.setText(localizedSection);

    // Add to parent container

    Map<String, String> attributes = new HashMap<String, String>();
    attributes.put(LABEL, "");
    attributes.put(WIDE, TRUE);

    getDelegate().layoutWidget(label, PROPERTY, attributes, container, metawidget);
}

From source file:org.mobicents.servlet.sip.conference.client.ui.AddAnnouncementForm.java

License:Open Source License

public AddAnnouncementForm(final String confName) {
    final Label status = new Label("");
    final TextBox urlText = new TextBox();
    urlText.setText(/*from   w  w  w .j a va 2 s  . c  o  m*/
            "http://mobicents.googlecode.com/svn/branches/servers/media/1.x.y/examples/mms-demo/web/src/main/webapp/audio/cnfannouncement.wav");
    add(urlText);
    Button addButton = new Button("Play file");
    addButton.addClickListener(new ClickListener() {

        public void onClick(Widget sender) {
            //String url = "file:///home/vralev/control/mobicents/servers/media/examples/mms-demo/web/src/main/webapp/audio/cuckoo.wav";//urlText.getText();
            String url = urlText.getText();

            String name = makeShort(url, 25);
            ServerConnection.Util.getInstance().joinAnnouncement(

                    name, confName, url, new AsyncCallback<Void>() {

                        public void onFailure(Throwable caught) {
                            status.setText("Failure");

                        }

                        public void onSuccess(Void result) {

                        }

                    });

        }

    });
    add(addButton);
    add(status);
}

From source file:org.mobicents.servlet.sip.conference.client.ui.AddSipPhoneForm.java

License:Open Source License

public AddSipPhoneForm(final String confName) {
    final Label status = new Label("");
    final TextBox urlText = new TextBox();
    add(urlText);/*from   w w w  . j  a  va  2  s .  c o m*/
    Button addButton = new Button("Dial Sip Phone");
    addButton.addClickListener(new ClickListener() {

        public void onClick(Widget sender) {
            String uri = urlText.getText();

            String name = makeShort(uri, 25);
            ServerConnection.Util.getInstance().joinSipPhone(

                    name, confName, uri, new AsyncCallback<Void>() {

                        public void onFailure(Throwable caught) {
                            status.setText("Failure");

                        }

                        public void onSuccess(Void result) {

                        }

                    });

        }

    });
    add(addButton);
    add(status);
}