@Test
 public void checkText() {
   RadioButton rb = new RadioButton("myRadioGroup", "foo");
   Assert.assertEquals("foo", rb.getText());
   rb.setText("text");
   Assert.assertEquals("text", rb.getText());
 }
 @Override
 public void setText(String text) {
   if (originalText == null) {
     this.originalText = text;
   }
   super.setText(text);
 }
  @Override
  protected void createControls() {
    headerLabel.setText(messages.managingBills());

    // trackOfBillsText.setHTML(messages.doyouwantTrackTime());
    // trackOfBillsList.setHTML(accounterMessages.trackTimeList());
    managingList1.setText(messages.managingList1());
    managingList2.setText(messages.managingList2());
    managingList3.setText(messages.managingList3());
    // trackTimeText.setHTML(messages.doyouwantTrackBills());
    managingYes.setText(messages.yes());
    // trackingTimeYes.setText(messages.yes());
    managingNo.setText(messages.no());
    // trackingNo.setText(messages.no());
    // trackingTimeDes.setHTML(messages.timetrackingdescription());
    managingInfo.setText(messages.billstrackingdescription());
    // track_time_head.setText(accounterMessages.trackingtimehead());

  }
  protected Widget buildButton(RadioGroupField<?> renderable, final Map.Entry<String, ?> entry) {
    RadioButton button =
        new RadioButton(
            renderable.getName(),
            new SafeHtml() {
              @Override
              public String asString() {
                return entry.getKey();
              }
            });

    button.setText(entry.getValue() == null ? "" : String.valueOf(entry.getValue()));
    this.buildAttributes(button, renderable);
    return button;
  }
示例#5
0
  private Widget getRadioGroupPanel() {
    FlowPanel buttonsPanel = new FlowPanel();
    buttonsPanel
        .getElement()
        .getStyle()
        .setProperty("marginLeft", "auto"); // $NON-NLS-1$ //$NON-NLS-2$
    buttonsPanel
        .getElement()
        .getStyle()
        .setProperty("marginRight", "auto"); // $NON-NLS-1$ //$NON-NLS-2$

    for (ViewFilter<K> item : items) {
      RadioButton radioButton = new RadioButton("viewRadioGroup", item.toString()); // $NON-NLS-1$
      radioButton.getElement().getStyle().setMarginRight(20, Unit.PX);
      radioButton.setText(item.getText());
      buttons.put(item.getValue(), radioButton);
      buttonsPanel.add(radioButton);
    }

    setSelectedValue(items.get(0).getValue());

    return buttonsPanel;
  }