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

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


            tr.addStyleName("rr");

            final TableDataCell cb = tr.newTableDataCell();
            cb.setHorizontalAlignment(HasAlignment.ALIGN_RIGHT);
            cb.setWidth("31px");
            cb.add(new CheckBox());

            final TableDataCell star = tr.newTableDataCell();
            star.setWidth("20px");
            star.addStyleName("sc");
            star.addStyleName("t");
View Full Code Here


            final TableDataCell cb = tr.newTableDataCell();
            cb.setHorizontalAlignment(HasAlignment.ALIGN_RIGHT);
            //cb.setWidth("31px");
            cb.addStyleName("w31px");
            cb.add(new CheckBox());

            final TableDataCell star = tr.newTableDataCell();
            //star.setWidth("20px");
            star.addStyleName("w20px");
            star.addStyleName("sc");
View Full Code Here

            final Person person = (Person)obj;

            final TableRow tr = rowGroup.newTableRow();

            final TableCell a = tr.newTableDataCell();
            final CheckBox checkBox = new CheckBox();
            checkBox.setEnabled(false);
            checkBox.setTitle("Doesn't do anything.");
            a.add(checkBox);
            a.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
            a.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
            a.setRowSpan(2);
            tr.add(a);
View Full Code Here

            final Container layout = Util.getLayout((Widget) paintable);

            VerticalPanel errorDetails = new VerticalPanel();
            errorDetails.add(new Label("" + Util.getSimpleName(paintable)
                    + " inside " + Util.getSimpleName(layout)));
            final CheckBox emphasisInUi = new CheckBox(
                    "Emphasize components parent in UI (the actual component is not visible)");
            emphasisInUi.addClickHandler(new ClickHandler() {
                public void onClick(ClickEvent event) {
                    if (paintable != null) {
                        Element element2 = ((Widget) layout).getElement();
                        Widget.setStyleName(element2, "invalidlayout",
                                emphasisInUi.getValue());
                    }
                }
            });
            errorDetails.add(emphasisInUi);
            panel.add(errorDetails);
View Full Code Here

        }
        if (valueMap.containsKey("widthMsg")) {
            errorDetails.add(new Label("Width problem: "
                    + valueMap.getString("widthMsg")));
        }
        final CheckBox emphasisInUi = new CheckBox("Emphasize component in UI");
        emphasisInUi.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                if (paintable != null) {
                    Element element2 = ((Widget) paintable).getElement();
                    Widget.setStyleName(element2, "invalidlayout",
                            emphasisInUi.getValue());
                }
            }
        });
        errorDetails.add(emphasisInUi);
        errorNode.add(errorDetails);
View Full Code Here

    FlexCellFormatter headerFormatter = headerTable.getFlexCellFormatter();
    headerTable.setHTML(0, 0, "User Information");
    headerFormatter.setColSpan(0, 0, 13);

    // Create the select all checkbox
    final CheckBox selectAll = new CheckBox();
    selectAll.addClickHandler(new ClickHandler() {
      public void onClick(ClickEvent event) {
        if (selectAll.getValue()) {
          getDataTable().selectAllRows();
        } else {
          getDataTable().deselectAllRows();
        }
      }
View Full Code Here

    // A TimePicker using AM/PM 12h format
    final TimePicker timePicker = new TimePicker(false);
    table.setHTML(3, 0, "Time picker:");
    table.setWidget(3, 1, timePicker);
    final CheckBox enableTimePicker = new CheckBox("Enable/disable");
    enableTimePicker.setValue(timePicker.isEnabled());
    enableTimePicker.addClickHandler(new ClickHandler() {
      public void onClick(ClickEvent source) {
        timePicker.setEnabled(enableTimePicker.getValue());
      }
    });
    table.setWidget(3, 2, enableTimePicker);

    // Creating a date time picker with AM/PM 12h TimePicker
    final DateTimePicker dateTimePicker = new DateTimePicker(false);
    dateTimePicker.setWidth("200px");
    // Create a label to display the selected date
    final Label dateLabel = new Label();
    Button getDate = new Button("Show date");
    getDate.addClickHandler(new ClickHandler() {
      public void onClick(ClickEvent source) {
        // Display the selected date/time using DateTimeFormat
        dateLabel.setText(DateTimeFormat.getMediumDateTimeFormat().format(
            dateTimePicker.getDate()));
      }
    });
    dateLabel.setStyleName("sandbox-Date");
    table.setHTML(4, 0, "Date time picker:");

    table.setWidget(4, 1, dateTimePicker);
    table.setWidget(5, 0, getDate);
    table.setWidget(5, 1, dateLabel);
    final CheckBox enableDateTimePicker = new CheckBox("Enable/disable");
    enableDateTimePicker.setValue(dateTimePicker.isEnabled());
    enableDateTimePicker.addClickHandler(new ClickHandler() {
      public void onClick(ClickEvent event) {
        dateTimePicker.setEnabled(enableDateTimePicker.getValue());
      }
    });
    table.setWidget(4, 2, enableDateTimePicker);

    final TimePicker customTimePicker = new TimePicker(new Date(), null,
        DateTimeFormat.getFormat("HH"), DateTimeFormat.getFormat("mm"), null);
    table.setHTML(8, 0, "Another time picker (24h):");
    table.setWidget(8, 1, customTimePicker);
    final CheckBox enable = new CheckBox("Enable/disable");
    enable.setValue(customTimePicker.isEnabled());
    enable.addClickHandler(new ClickHandler() {
      public void onClick(ClickEvent sender) {
        customTimePicker.setEnabled(enable.getValue());
      }

    });
    table.setWidget(8, 2, enable);
View Full Code Here

    ballRadiusBox.setText(ballRadius + "");
    angleBox.setText(String.valueOf(angle));

    final TextBox incre = new TextBox();
    incre.setText("2");
    randomOrEqual = new CheckBox(
        "random if checked/ otherwise equally spaced");

    angleBox.addKeyDownHandler(new KeyDownHandler() {

      public void onKeyDown(KeyDownEvent event) {
        if (event.isUpArrow()) {
          angle += Double.valueOf(incre.getText());
          angleBox.setText(angle + "");
          if (validate()) {
            run(angle);
          }
        } else if (event.isDownArrow()) {
          angle -= Double.valueOf(incre.getText());
          angleBox.setText(angle + "");
          if (validate()) {
            run(angle);
          }
        } else if (event.isRightArrow()) {
          incre.setText((Double.valueOf(incre.getText()) * (1 / 2d))
              + "");
          //angleBox.setText(angleBox.getText().replace(oldChar, newChar)

        } else if (event.isLeftArrow()) {
          incre.setText((Double.valueOf(incre.getText()) * 2d) + "");

        } else if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {

          if (validate()) {
            reset();
            run(angle);
          }
        }

      }
    });

    vp.add(new Label("Pinball Project"));
    vp.add(new Label("Created by"));
    vp.add(new Label("Kefu Zhou"));
    vp.add(new Label("Angle in degrees (0-360)"));
    vp.add(angleBox);
    vp.add(new Label("Triangle side length"));
    vp.add(sideBox);
    vp.add(new Label("Circle radius"));
    vp.add(circleRadiusBox);
    vp.add(new Label("Ball radius (still a point)"));
    vp.add(ballRadiusBox);
    vp.add(new Label("Increment"));
    vp.add(incre);
    HorizontalPanel hp = new HorizontalPanel();
    hp.add(start);
    hp.add(reset);
    hp.add(clear);
    vp.add(hp);

    HorizontalPanel hp2 = new HorizontalPanel();
    hp2.add(special);
    numTrials = new TextBox();
    hp2.add(numTrials);
    vp.add(hp2);
    vp.add(randomOrEqual);

    final ToggleButton showFreq = new ToggleButton("Show Freq Table",
        "Hide Freq Table");
    showFreq.addClickHandler(new ClickHandler() {

      private FreqPopup fp;

      public void onClick(ClickEvent event) {
        if (showFreq.isDown()) {
          if (fp == null) {
            fp = new FreqPopup(freq);
            // fp.setAutoHideEnabled(true);
          } else {
            fp.update(freq);
          }
          // fp.setHeight("100%");
          fp.show();
          fp.center();
        } else {
          fp.hide();
        }
      }
    });

    vp.add(showFreq);

    Button topTen = new Button("Show top 10");
    vp.add(topTen);
    topTen.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent event) {
        Grid g = null;
        PopupPanel pop = null;
        if (g == null) {
          pop = new PopupPanel();
          pop.setAutoHideEnabled(true);
          g = new Grid(11, 3);
          g.setText(0, 0, "Top");
          g.setText(0, 1, "Initial Angle");
          g.setText(0, 2, "Circles hit");
          pop.add(g);
        }
        for (int i = 0; i < results.size(); i++) {
          g.setText(i + 1, 0, i + 1 + "");
          g.setText(i + 1, 1, results.get(i).getInitialAngle() + "");
          g.setText(i + 1, 2, results.get(i).printHitSequence());
        }
        pop.show();
        pop.center();

      }
    });

    final CheckBox angleLimitBox = new CheckBox("0-120 instead of 0-360");
    angleLimitBox.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent event) {
        if (angleLimitBox.getValue()) {
          angleLimit = 120d;
        } else
          angleLimit = 360d;
      }
    });
View Full Code Here

      TreeItem item = new TreeItem();
      item.setHTML("<h1>html</h1>");
      parent.addItem(item);
      return item;
    } else if (type == TreeType.CHECKBOX) {
      return parent.addItem(new CheckBox("myBox"));
    } else {
      throw new RuntimeException("What?");
    }
  }
View Full Code Here

      FastTreeItem item = new FastTreeItem();
      item.setHTML("<a>" + value + "</a>");
      parent.addItem(item);
      return item;
    } else if (type == TreeType.CHECKBOX) {
      return parent.addItem(new CheckBox(value));
    } else {
      throw new RuntimeException("What?");
    }
  }
View Full Code Here

TOP

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

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.