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

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


    public void onMapInitialized(MapInitializationEvent event) {
      // When the map initializes: add a CheckBox for every layer, so the use can toggle visibility:
      for (int i = 0; i < mapPresenter.getLayersModel().getLayerCount(); i++) {
        final Layer<?> layer = mapPresenter.getLayersModel().getLayer(i);
        CheckBox layerCheck = new CheckBox(layer.getTitle());
        layerCheck.setValue(layer.isMarkedAsVisible());

        // When CheckBox value changes, change the layer's visibility as well:
        layerCheck.addValueChangeHandler(new ValueChangeHandler<Boolean>() {

          public void onValueChange(ValueChangeEvent<Boolean> event) {
            if (event.getValue() != null) {
              layer.setMarkedAsVisible(event.getValue());
            }
View Full Code Here


        return user.isEnabled();
      }
      @Override
      public void render(Context context, UserProxy object, SafeHtmlBuilder sb) {
        boolean isEnabled = object.isEnabled();
        CheckBox checkBox = new CheckBox();
        checkBox.setValue(isEnabled);
        checkBox.setEnabled(false);
        sb.append(SafeHtmlUtils.fromTrustedString(checkBox.toString()));
      };       
    }, i18n.user_enabled());         
        table.setColumnWidth(columnNumber++, "16%");
       
    }
View Full Code Here

    // Set the data in the new row
    int numColumns = dataTable.getColumnCount();
    for (int column = 0; column < numColumns; column++) {
      String label = beforeRow + ":" + column;
      if (column == 0) {
        dataTable.setWidget(beforeRow, column, new CheckBox(label));
      } else if (column == 2) {
        int rand = (int) (Math.random() * 100000);
        dataTable.setHTML(beforeRow, column, rand + "");
      } else {
        dataTable.setHTML(beforeRow, column, label);
View Full Code Here

    return panel;
  }

  private CheckBox toggleHandler(String title, final DatePicker picker,
      final EventHandler handler) {
    final CheckBox select = new CheckBox(title);
    select.addClickListener(new ClickListener() {

      public void onClick(Widget sender) {
        if (select.isChecked()) {
          if (handler instanceof ChangeHandler) {
            picker.addChangeHandler((ChangeHandler<Date>) handler);
          } else if (handler instanceof HighlightHandler) {
            picker.addHighlightHandler((HighlightHandler<Date>) handler);
          } else if (handler instanceof RenderingHandler) {
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

      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

    // 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

    } 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

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.