Package com.google.gwt.user.client.ui

Examples of com.google.gwt.user.client.ui.RadioButton


    table.setCellEditor(2, new TextCellEditor<Serializable>(intOnlyTextBox));

    // Gender cell editor
    RadioCellEditor<Serializable> genderEditor = new RadioCellEditor<Serializable>();
    genderEditor.setLabel("Select a gender:");
    genderEditor.addRadioButton(new RadioButton("editorGender", "male"));
    genderEditor.addRadioButton(new RadioButton("editorGender", "female"));
    table.setCellEditor(3, genderEditor);

    // Race cell editor
    ListCellEditor<Serializable> raceEditor = new ListCellEditor<Serializable>();
    ListBox raceBox = raceEditor.getListBox();
    for (int i = 0; i < DataSourceData.races.length; i++) {
      raceBox.addItem(DataSourceData.races[i]);
    }
    table.setCellEditor(4, raceEditor);

    // Color cell editor
    RadioCellEditor<Serializable> colorEditor = new RadioCellEditor<Serializable>() {
      /**
       * An element used to string the HTML portion of the color.
       */
      private HTML html = new HTML();

      @Override
      protected void setValue(Object value) {
        html.setHTML(value.toString());
        super.setValue(html.getText());
      }
    };
    colorEditor.setLabel("Select a color:");
    for (int i = 0; i < DataSourceData.colors.length; i++) {
      String color = DataSourceData.colors[i];
      colorEditor.addRadioButton(new RadioButton("editorColor", color));
    }
    table.setCellEditor(5, colorEditor);

    // Sport cell editor
    ListCellEditor<Serializable> sportEditor = new ListCellEditor<Serializable>();
View Full Code Here


  @Override
  public void editCell(CellEditInfo<R> cellEditInfo, Callback<R> callback) {
    super.editCell(cellEditInfo, callback);
    Iterator<Widget> it = vpanel.iterator();
    while (it.hasNext()) {
      RadioButton radio = (RadioButton) it.next();
      if (radio.isChecked()) {
        radio.setFocus(true);
        return;
      }
    }
  }
View Full Code Here

  @Override
  protected Object getValue() {
    Iterator<Widget> it = vpanel.iterator();
    while (it.hasNext()) {
      RadioButton radio = (RadioButton) it.next();
      if (radio.isChecked()) {
        return radio.getText();
      }
    }
    return null;
  }
View Full Code Here

  @Override
  protected void setValue(Object value) {
    Iterator<Widget> it = vpanel.iterator();
    while (it.hasNext()) {
      RadioButton radio = (RadioButton) it.next();
      if (radio.getText().equals(value)) {
        radio.setChecked(true);
      } else {
        radio.setChecked(false);
      }
    }
  }
View Full Code Here

      };
      for (int i = 0; i < separators.length; i += 2 ) {
        String label = separators[i];
        String separator = separators[i + 1];
        optionSeparatorMap.put(label, separator);
        RadioButton rb = new RadioButton("separator", label);
        if ( i == 0 ) {
          rb.setChecked(true);
          selectedOption = label;
        }
        rb.addClickListener(this);
        this.add(rb);
      }
    }
View Full Code Here

        rb.addClickListener(this);
        this.add(rb);
      }
    }
    public void onClick(Widget sender) {
      RadioButton rb = (RadioButton) sender;
      selectedOption = rb.getText();
    }
View Full Code Here

    FlexTable panel = new FlexTable();
    formPanel.setWidget(panel);
   
   
   
    rb0 = new RadioButton("grp", "Local file:");

   
    final HorizontalPanel uploadContainer = new HorizontalPanel();
    uploadContainer.add(upload);
    rb0.setChecked(true);
View Full Code Here

    FlexTable panel = new FlexTable();
    formPanel.setWidget(panel);
   
   
   
    rb0 = new RadioButton("grp", "Local file:");

   
    final HorizontalPanel uploadContainer = new HorizontalPanel();
    uploadContainer.add(upload);
    rb0.setChecked(true);
View Full Code Here

      position.insertCell(1, 1);
      position.setWidget(0, 0, herePosition);
      position.setWidget(0, 1, topPosition);
      position.setWidget(1, 0, bottomPosition);
      position.setWidget(1, 1, floatPosition);
    oneColumn = new RadioButton("expansion", "One column");
      oneColumn.setValue(true);
    twoColumns = new RadioButton("expansion", "Two columns");
    HorizontalPanel expansion = new HorizontalPanel();
    expansion.add(oneColumn);
    expansion.add(twoColumns);
      addField(image, "Image:");
    addHeader("Caption");
View Full Code Here

     * Builds the Insert LaTeX Header form.
     */
  @Override
  protected void buildForm() {
    content.setWidth("500px");
    alignTop = new RadioButton("alignment", "Align at top line");
    alignCenter = new RadioButton("alignment", "Align at center of table");
    alignCenter.setValue(true);
    alignBottom = new RadioButton("alignment", "Align at bottom line");
    HorizontalPanel alignment = new HorizontalPanel();
    alignment.add(alignTop);
    alignment.add(alignCenter);
    alignment.add(alignBottom);
    centerHorizontal = new CheckBox("Center horizontal");
      centerHorizontal.setValue(true);
    insertAsFloat = new CheckBox("Insert as float");
      insertAsFloat.setValue(true);
      insertAsFloat.addValueChangeHandler(new ValueChangeHandler<Boolean>() {
      @Override
      public void onValueChange(ValueChangeEvent<Boolean> event) {
        boolean value = event.getValue();
        for (int i=7; i<=10; i++) {
          content.getRowFormatter().setVisible(i, value);
        }
        center();
      }
      });
    caption = new TextBox();
    caption.setWidth("250px");
    label = new TextBox();
    label.setWidth("250px");
    herePosition = new CheckBox("Here");
    topPosition = new CheckBox("Top of the page");
      topPosition.setValue(true);
    bottomPosition = new CheckBox("Bottom of the page");
      bottomPosition.setValue(true);
    floatPosition = new CheckBox("Page of floats");
      floatPosition.setValue(true);
      FlexTable position = new FlexTable();
      position.setWidth("100%");
      position.insertRow(0);
      position.insertCell(0, 0);
      position.insertCell(0, 1);
      position.insertRow(1);
      position.insertCell(1, 0);
      position.insertCell(1, 1);
      position.setWidget(0, 0, herePosition);
      position.setWidget(0, 1, topPosition);
      position.setWidget(1, 0, bottomPosition);
      position.setWidget(1, 1, floatPosition);
    oneColumn = new RadioButton("expansion", "One column");
      oneColumn.setValue(true);
    twoColumns = new RadioButton("expansion", "Two columns");
    HorizontalPanel expansion = new HorizontalPanel();
    expansion.add(oneColumn);
    expansion.add(twoColumns);
    addHeader("Caption");
      addField(caption, "Caption:");
View Full Code Here

TOP

Related Classes of com.google.gwt.user.client.ui.RadioButton

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.