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

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


    // Create a tree with a few items in it.
    FastTreeItem root = new FastTreeItem("root");
    root.addItem("item0");
    root.addItem("item1");
    root.addItem("item2");
    root.addItem(new CheckBox("item3"));
    FastTree t = new FastTree();

    // tree2
    FastTreeItem root2 = new FastTreeItem("child root");
    root2.addItem("child item0");
    root2.addItem("child item1");
    root2.addItem("child item2");
    root2.addItem(new CheckBox("child item3"));

    // nest the trees
    root.addItem(root2);
    t.addItem(root);
    t.addFocusListener(new FocusListener() {
View Full Code Here


    // Create a tree with a few items in it.
    FastTreeItem root = new FastTreeItem("root");
    root.addItem("item0");
    root.addItem("item1");
    root.addItem("item2");
    root.addItem(new CheckBox("item3"));
    FastTree t = new FastTree();

    // tree2
    FastTreeItem root2 = new FastTreeItem("child root");
    root2.addItem("child item0");
    root2.addItem("child item1");
    root2.addItem("child item2");
    root2.addItem(new CheckBox("child item3"));
    FastTree t2 = new FastTree();

    // nest the trees
    t2.addItem(root2);
    FastTreeItem item = new FastTreeItem(t2);
View Full Code Here

    FastTree t = new FastTree();
    FastTreeItem a = t.addItem("A root tree item");
    a.addItem("A child");
    FastTreeItem aXb = a.addItem("Another child");
    aXb.addItem("a grand child");
    FastTreeItem widgetBranch = a.addItem(new CheckBox("A checkbox child"));
    FastTreeItem textBoxParent = widgetBranch.addItem("A TextBox parent");
    textBoxParent.addItem(new TextBox());
    textBoxParent.addItem("and another one...");
    textBoxParent.addItem(new TextArea());
View Full Code Here

    StubbornTree t = new StubbornTree();
    FastTreeItem a = t.addItem("A root tree item");
    a.addItem("A child");
    FastTreeItem aXb = a.addItem("Another child");
    aXb.addItem("a grand child");
    FastTreeItem widgetBranch = a.addItem(new CheckBox("A checkbox child"));
    FastTreeItem textBoxParent = widgetBranch.addItem("A TextBox parent");
    textBoxParent.addItem(new TextBox());
    textBoxParent.addItem("and another one...");
    textBoxParent.addItem(new TextArea());
View Full Code Here

    } else if (type == TreeType.HTML) {
      FastTreeItem item = new FastTreeItem("<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

    } else if (type == TreeType.HTML) {
      TreeItem item = new TreeItem("<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 a = t.addItem("A root tree item");
    a.addItem("A child with different style");
    a.addItem("regular style");
    FastTreeItem aXb = a.addItem("Another child");
    aXb.addItem("a grand child");
    FastTreeItem widgetBranch = a.addItem(new CheckBox("A checkbox child"));
    FastTreeItem textBoxParent = widgetBranch.addItem("A TextBox parent");
    textBoxParent.addItem(new TextBox());
    textBoxParent.addItem("and another one...");
    textBoxParent.addItem(new TextArea());
View Full Code Here

    table.setHTML(1, 0, "Value spinner:");
    // Create a value spinner with initial value=0 that allows values between
    // -1000 and 1000
    final ValueSpinner simpleSpinner = new ValueSpinner(0, -1000, 1000);
    table.setWidget(1, 1, simpleSpinner);
    final CheckBox enableSpinner = new CheckBox("Enable/disable");
    enableSpinner.setChecked(simpleSpinner.isEnabled());
    enableSpinner.addClickListener(new ClickListener() {
      public void onClick(Widget sender) {
        simpleSpinner.setEnabled(enableSpinner.isChecked());
      }
    });
    table.setWidget(1, 2, enableSpinner);

    // Create a value spinner that displays the value as a formatted date
    final ValueSpinner dateSpinner = new ValueSpinner(new Date().getTime()) {
      protected String formatValue(long value) {
        return DateTimeFormat.getLongDateFormat().format(new Date(value));
      }

      protected long parseValue(String value) {
        return DateTimeFormat.getLongDateFormat().parse(value).getTime();
      }
    };
    // Min step = milliseconds per day
    dateSpinner.getSpinner().setMinStep(86400000);
    dateSpinner.setStylePrimaryName("dateSpinner");
    table.setHTML(2, 0, "Date spinner:");
    table.setWidget(2, 1, dateSpinner);
    final CheckBox enableDateSpinner = new CheckBox("Enable/disable");
    enableDateSpinner.setChecked(dateSpinner.isEnabled());
    enableDateSpinner.addClickListener(new ClickListener() {
      public void onClick(Widget sender) {
        dateSpinner.setEnabled(enableDateSpinner.isChecked());
      }
    });
    table.setWidget(2, 2, enableDateSpinner);

    // 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.setChecked(timePicker.isEnabled());
    enableTimePicker.addClickListener(new ClickListener() {
      public void onClick(Widget sender) {
        timePicker.setEnabled(enableTimePicker.isChecked());
      }
    });
    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.addClickListener(new ClickListener() {
      public void onClick(Widget sender) {
        // 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.setChecked(dateTimePicker.isEnabled());
    enableDateTimePicker.addClickListener(new ClickListener() {
      public void onClick(Widget sender) {
        dateTimePicker.setEnabled(enableDateTimePicker.isChecked());
      }
    });
    table.setWidget(4, 2, enableDateTimePicker);

    final VolumeSlider volumeSlider = new VolumeSlider(0, -100, 100);
    volumeSlider.setWidth("250px");
    table.setHTML(7, 0, "Volume slider:");
    table.setWidget(7, 1, volumeSlider);
    final CheckBox enableVolumeSlider = new CheckBox("Enable/disable");
    enableVolumeSlider.setChecked(volumeSlider.isEnabled());
    enableVolumeSlider.addClickListener(new ClickListener() {
      public void onClick(Widget sender) {
        volumeSlider.setEnabled(enableVolumeSlider.isChecked());
      }
    });
    table.setWidget(7, 2, enableVolumeSlider);

    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.setChecked(customTimePicker.isEnabled());
    enable.addClickListener(new ClickListener() {
      public void onClick(Widget sender) {
        customTimePicker.setEnabled(enable.isChecked());
      }
    });
    table.setWidget(8, 2, enable);
    initWidget(table);
  }
View Full Code Here

      HTML colorBand = new HTML("<div style=\"width: 100%; height: " + COLOR_BAND_HEIGHT + "; background-color: " + color + ";\"></div>");
      table.setWidget(0, 0, colorBand);
      table.getFlexCellFormatter().setColSpan(0, 0, 2);

      checkBox = new CheckBox();
      checkBox.setValue(true);
      table.setWidget(1, 0, checkBox);
      table.getCellFormatter().setHorizontalAlignment(1, 0, HasHorizontalAlignment.ALIGN_LEFT);

      m_labelsPanel = new HorizontalPanel();
View Full Code Here

      HTML colorBand = new HTML("<div style=\"width: 100%; height: " + COLOR_BAND_HEIGHT + "; background-color: " + color + ";\"></div>");
      table.setWidget(0, 0, colorBand);
      table.getFlexCellFormatter().setColSpan(0, 0, 2);

      checkBox = new CheckBox();
      checkBox.setValue(true);
      table.setWidget(1, 0, checkBox);
      table.getCellFormatter().setHorizontalAlignment(1, 0, HasHorizontalAlignment.ALIGN_LEFT);

      m_labelsPanel = new HorizontalPanel();
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.