Examples of SelectionGrid


Examples of com.google.gwt.gen2.table.client.SelectionGrid

    // Add button to change policy
    {
      Button button = new Button("Set Selection Policy", new ClickHandler() {
        public void onClick(ClickEvent event) {
          SelectionGrid grid = ScrollTableDemo.get().getDataTable();
          switch (policyBox.getSelectedIndex()) {
            case 0:
              grid.setSelectionPolicy(SelectionPolicy.MULTI_ROW);
              break;
            case 1:
              grid.setSelectionPolicy(SelectionPolicy.ONE_ROW);
              break;
            case 2:
              grid.setSelectionPolicy(SelectionPolicy.CHECKBOX);
              break;
            case 3:
              grid.setSelectionPolicy(SelectionPolicy.RADIO);
              break;
          }
          PagingScrollTableDemo.get().getPagingScrollTable().reloadPage();
        }
      });
      form.addButton(button);
    }

    // Add button to change status
    {
      Button button = new Button("Toggle Status", new ClickHandler() {
        public void onClick(ClickEvent event) {
          SelectionGrid grid = ScrollTableDemo.get().getDataTable();
          grid.setSelectionEnabled(!grid.isSelectionEnabled());
          refreshPolicy();
        }
      });
      form.addButton(button);
    }
View Full Code Here

Examples of com.google.gwt.gen2.table.client.SelectionGrid

  /**
   * Refresh the policy.
   */
  private void refreshPolicy() {
    SelectionGrid grid = ScrollTableDemo.get().getDataTable();

    // Refresh the status
    if (grid.isSelectionEnabled()) {
      statusLabel.setText("enabled");
    } else {
      statusLabel.setText("disabled");
    }

    // Refresh the policy
    SelectionPolicy policy = grid.getSelectionPolicy();
    if (policy == SelectionPolicy.MULTI_ROW) {
      policyBox.setSelectedIndex(0);
    } else if (policy == SelectionPolicy.ONE_ROW) {
      policyBox.setSelectedIndex(1);
    } else if (policy == SelectionPolicy.CHECKBOX) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.