Package com.google.gwt.gen2.datepicker.client

Examples of com.google.gwt.gen2.datepicker.client.DatePicker


    return DESC_RESIZE_CHECKING;
  }

  @Override
  protected Widget onInitialize() {
    CustomForm form = new CustomForm();

    // Add the current status
    statusLabel = new Label();
    form.addLabeledWidget("Current Status:", statusLabel);
    refreshStatus();

    // Add button to change status
    {
      Button button = new Button("Toggle Resize Checking", new ClickHandler() {
        public void onClick(ClickEvent event) {
          ResizableWidgetCollection.get().setResizeCheckingEnabled(
              !ResizableWidgetCollection.get().isResizeCheckingEnabled());
          refreshStatus();
        }
      });
      form.addButton(button);
    }

    // Add a button to resize the table now
    {
      Button button = new Button("Redraw Now", new ClickHandler() {
        public void onClick(ClickEvent event) {
          ScrollTableDemo.get().getScrollTable().redraw();
        }
      });
      form.addButton(button);
    }

    return form;
  }
View Full Code Here


    return "Specify how users can resize columns.";
  }

  @Override
  protected Widget onInitialize() {
    CustomForm form = new CustomForm();

    // Add the current policy
    policyBox = new ListBox();
    policyBox.addItem("Disabled");
    policyBox.addItem("Single Cell");
    policyBox.addItem("Multi Cell");
    form.addLabeledWidget("Column Resize Policy:", policyBox);
    refreshPolicy();

    // Add button to change status
    {
      Button button = new Button("Set Resize Policy", new ClickHandler() {
        public void onClick(ClickEvent event) {
          AbstractScrollTable scrollTable = ScrollTableDemo.get().getScrollTable();
          switch (policyBox.getSelectedIndex()) {
            case 0:
              scrollTable.setColumnResizePolicy(ScrollTable.ColumnResizePolicy.DISABLED);
              break;
            case 1:
              scrollTable.setColumnResizePolicy(ScrollTable.ColumnResizePolicy.SINGLE_CELL);
              break;
            case 2:
              scrollTable.setColumnResizePolicy(ScrollTable.ColumnResizePolicy.MULTI_CELL);
              break;
          }
        }
      });
      form.addButton(button);
    }

    // Add button to reset column widths
    {
      Button button = new Button("Reset Column Widths", new ClickHandler() {
        public void onClick(ClickEvent event) {
          AbstractScrollTable scrollTable = ScrollTableDemo.get().getScrollTable();
          scrollTable.resetColumnWidths();
        }
      });
      form.addButton(button);
    }

    return form;
  }
View Full Code Here

    return "Set the overall size of the table";
  }

  @Override
  protected Widget onInitialize() {
    CustomForm form = new CustomForm();

    // Height selection
    final TextBox heightBox = new TextBox();
    heightBox.setText("400px");
    heightBox.setWidth("50px");
    form.addLabeledWidget("Height:", heightBox);

    // Width selection
    final TextBox widthBox = new TextBox();
    widthBox.setText("95%");
    widthBox.setWidth("50px");
    form.addLabeledWidget("Width:", widthBox);

    // Add button to change status
    {
      Button button = new Button("Set Table Size", new ClickHandler() {
        public void onClick(ClickEvent event) {
          String height = heightBox.getText();
          String width = widthBox.getText();
          ScrollTableDemo.get().getScrollTable().setSize(width, height);
        }
      });
      form.addButton(button);
    }

    // Add button to get minimum offset width
    {
      Button button = new Button("Get Minimum Offset Width",
          new ClickHandler() {
            public void onClick(ClickEvent event) {
              int width = ScrollTableDemo.get().getScrollTable().getMinimumOffsetWidth();
              Window.alert("Minimum Offset Width: " + width);
            }
          });
      form.addButton(button);
    }

    return form;
  }
View Full Code Here

    return "Hide or show columns";
  }

  @Override
  protected Widget onInitialize() {
    CustomForm form = new CustomForm();

    final DefaultTableDefinition<Student> tableDef = PagingScrollTableDemo.get().getTableDefinition();
    int numColumns = tableDef.getColumnDefinitionCount();
    for (int i = 0; i < numColumns; i++) {
      final StudentColumnDefinition<?> colDef = (StudentColumnDefinition<?>) tableDef.getColumnDefinition(i);
      final Button button = new Button("Hide Column");
      button.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
          if (tableDef.isColumnVisible(colDef)) {
            tableDef.setColumnVisible(colDef, false);
            button.setText("Show Column");
          } else {
            tableDef.setColumnVisible(colDef, true);
            button.setText("Hide Column");
          }
          PagingScrollTableDemo.get().getPagingScrollTable().reloadPage();
        }
      });
      form.addLabeledWidget(colDef.getHeader(0).toString(), button);
    }

    // Add the description
    return form;
  }
View Full Code Here

    return "Manually set the absolute, min, max, and preferred size of a column.";
  }

  @Override
  protected Widget onInitialize() {
    CustomForm form = new CustomForm();

    // Column selection
    final TextBox columnBox = new TextBox();
    columnBox.setText("3");
    columnBox.setWidth("50px");
    form.addLabeledWidget("Column Index:", columnBox);

    // Width selection
    final TextBox widthBox = new TextBox();
    widthBox.setText("25");
    widthBox.setWidth("50px");
    form.addLabeledWidget("Width (pixels):", widthBox);

    // Add button to set column size
    {
      Button button = new Button("Set Actual Column Width", new ClickHandler() {
        public void onClick(ClickEvent event) {
          try {
            int column = Integer.parseInt(columnBox.getText());
            int width = Integer.parseInt(widthBox.getText());
            if (column >= 0) {
              ScrollTableDemo.get().getScrollTable().setColumnWidth(column,
                  width);
            }
          } catch (NumberFormatException e) {
            Window.alert("Please enter valid integers for the row and column.");
          } catch (IndexOutOfBoundsException e) {
            Window.alert("The row or column index you entered is out of bounds.");
          }
        }
      });
      form.addButton(button);
    }

    // Add button to set preferred column size
    if (PagingScrollTableDemo.get() == null) {
      Button button = new Button("Set Preferred Column Width",
          new ClickHandler() {
            public void onClick(ClickEvent event) {
              try {
                int column = Integer.parseInt(columnBox.getText());
                int width = Integer.parseInt(widthBox.getText());
                if (column >= 0) {
                  ((ScrollTable) ScrollTableDemo.get().getScrollTable()).setPreferredColumnWidth(
                      column, width);
                }
              } catch (NumberFormatException e) {
                Window.alert("Please enter valid integers for the row and column.");
              } catch (IndexOutOfBoundsException e) {
                Window.alert("The row or column index you entered is out of bounds.");
              }
            }
          });
      form.addButton(button);
    }

    // Add button to set min column size
    if (PagingScrollTableDemo.get() == null) {
      Button button = new Button("Set Minimum Column Width",
          new ClickHandler() {
            public void onClick(ClickEvent event) {
              try {
                int column = Integer.parseInt(columnBox.getText());
                int width = Integer.parseInt(widthBox.getText());
                if (column >= 0) {
                  ((ScrollTable) ScrollTableDemo.get().getScrollTable()).setMinimumColumnWidth(
                      column, width);
                }
              } catch (NumberFormatException e) {
                Window.alert("Please enter valid integers for the row and column.");
              } catch (IndexOutOfBoundsException e) {
                Window.alert("The row or column index you entered is out of bounds.");
              }
            }
          });
      form.addButton(button);
    }

    // Add button to set max column size
    if (PagingScrollTableDemo.get() == null) {
      Button button = new Button("Set Maximum Column Width",
          new ClickHandler() {
            public void onClick(ClickEvent event) {
              try {
                int column = Integer.parseInt(columnBox.getText());
                int width = Integer.parseInt(widthBox.getText());
                if (column >= 0) {
                  ((ScrollTable) ScrollTableDemo.get().getScrollTable()).setMaximumColumnWidth(
                      column, width);
                }
              } catch (NumberFormatException e) {
                Window.alert("Please enter valid integers for the row and column.");
              } catch (IndexOutOfBoundsException e) {
                Window.alert("The row or column index you entered is out of bounds.");
              }
            }
          });
      form.addButton(button);
    }

    return form;
  }
View Full Code Here

        + "across pages.";
  }

  @Override
  protected Widget onInitialize() {
    CustomForm form = new CustomForm();

    // Add the current status
    statusLabel = new Label();
    form.addLabeledWidget("Current Status:", statusLabel);
    refreshStatus();

    // Add button to change status
    {
      Button button = new Button("Toggle Cross Page Selection",
          new ClickHandler() {
            public void onClick(ClickEvent event) {
              boolean enabled = PagingScrollTableDemo.get().getPagingScrollTable().isCrossPageSelectionEnabled();
              PagingScrollTableDemo.get().getPagingScrollTable().setCrossPageSelectionEnabled(
                  !enabled);
              refreshStatus();
            }
          });
      form.addButton(button);
    }

    return form;
  }
View Full Code Here

    return "Insert a row at a specified index";
  }

  @Override
  protected Widget onInitialize() {
    CustomForm form = new CustomForm();

    // Row selection
    final TextBox rowBox = new TextBox();
    rowBox.setText("3");
    rowBox.setWidth("50px");
    form.addLabeledWidget("Row Index:", rowBox);

    // Add button to insert one row
    {
      Button button = new Button("Insert 1 Row", new ClickHandler() {
        public void onClick(ClickEvent event) {
          try {
            int row = Integer.parseInt(rowBox.getText());
            insertDataRows(row, 1);
          } catch (NumberFormatException e) {
            Window.alert("Please enter valid integers for the row and column.");
          } catch (IndexOutOfBoundsException e) {
            Window.alert("The row or column index you entered is out of bounds.");
          }
        }
      });
      form.addButton(button);
    }

    // Add button to insert 10 rows
    {
      Button button = new Button("Insert 10 Rows", new ClickHandler() {
        public void onClick(ClickEvent event) {
          try {
            int row = Integer.parseInt(rowBox.getText());
            insertDataRows(row, 10);
          } catch (NumberFormatException e) {
            Window.alert("Please enter valid integers for the row and column.");
          } catch (IndexOutOfBoundsException e) {
            Window.alert("The row or column index you entered is out of bounds.");
          }
        }
      });
      form.addButton(button);
    }

    // Add button to insert 100 rows
    {
      Button button = new Button("Insert 100 Rows", new ClickHandler() {
        public void onClick(ClickEvent event) {
          try {
            int row = Integer.parseInt(rowBox.getText());
            insertDataRows(row, 100);
          } catch (NumberFormatException e) {
            Window.alert("Please enter valid integers for the row and column.");
          } catch (IndexOutOfBoundsException e) {
            Window.alert("The row or column index you entered is out of bounds.");
          }
        }
      });
      form.addButton(button);
    }

    // Add button to remove a row
    {
      Button button = new Button("Remove Row", new ClickHandler() {
        public void onClick(ClickEvent event) {
          try {
            int row = Integer.parseInt(rowBox.getText());
            ScrollTableDemo.get().getDataTable().removeRow(row);
          } catch (NumberFormatException e) {
            Window.alert("Please enter valid integers for the row and column.");
          } catch (IndexOutOfBoundsException e) {
            Window.alert("The row or column index you entered is out of bounds.");
          }
        }
      });
      form.addButton(button);
    }

    return form;
  }
View Full Code Here

    return DESC_SCROLLING;
  }

  @Override
  protected Widget onInitialize() {
    CustomForm form = new CustomForm();

    // Add the policy
    scrollPolicyBox = new ListBox();
    scrollPolicyBox.addItem("both");
    scrollPolicyBox.addItem("horizontal");
    scrollPolicyBox.addItem("disabled");
    form.addLabeledWidget("Scroll Policy:", scrollPolicyBox);
    refreshPolicy();

    // Add button to change status
    {
      Button button = new Button("Set Scroll Policy", new ClickHandler() {
        public void onClick(ClickEvent event) {
          AbstractScrollTable scrollTable = ScrollTableDemo.get().getScrollTable();
          switch (scrollPolicyBox.getSelectedIndex()) {
            case 0:
              scrollTable.setScrollPolicy(ScrollTable.ScrollPolicy.BOTH);
              break;
            case 1:
              scrollTable.setScrollPolicy(ScrollTable.ScrollPolicy.HORIZONTAL);
              break;
            case 2:
              scrollTable.setScrollPolicy(ScrollTable.ScrollPolicy.DISABLED);
              break;
          }
        }
      });
      form.addButton(button);
    }

    return form;
  }
View Full Code Here

    return DESC_CACHE;
  }

  @Override
  protected Widget onInitialize() {
    CustomForm form = new CustomForm();

    // Pre cache size
    final TextBox preCacheBox = new TextBox();
    preCacheBox.setText("50");
    preCacheBox.setWidth("50px");
    form.addLabeledWidget("Pre Cache Size:", preCacheBox);

    // Post cache size
    final TextBox postCacheBox = new TextBox();
    postCacheBox.setText("50");
    postCacheBox.setWidth("50px");
    form.addLabeledWidget("Post Cache Size:", postCacheBox);

    // Add button to set the row count
    {
      Button button = new Button("Set Cache Size", new ClickHandler() {
        public void onClick(ClickEvent event) {
          try {
            int preCache = Integer.parseInt(preCacheBox.getText());
            int postCache = Integer.parseInt(postCacheBox.getText());
            PagingScrollTableDemo.get().getCachedTableModel().setPreCachedRowCount(
                preCache);
            PagingScrollTableDemo.get().getCachedTableModel().setPostCachedRowCount(
                postCache);
          } catch (NumberFormatException e) {
            Window.alert("Please enter valid integers for the row and column.");
          }
        }
      });
      form.addButton(button);
    }

    return form;
  }
View Full Code Here

    return DESC_RESIZING;
  }

  @Override
  protected Widget onInitialize() {
    CustomForm form = new CustomForm();

    // Add the current policy
    policyBox = new ListBox();
    policyBox.addItem("Unconstrained");
    policyBox.addItem("Flow");
    policyBox.addItem("Fixed");
    policyBox.addItem("Fill");
    form.addLabeledWidget("Resize Policy:", policyBox);
    refreshPolicy();

    // Add button to change status
    {
      Button button = new Button("Set Resize Policy", new ClickHandler() {
        public void onClick(ClickEvent event) {
          AbstractScrollTable scrollTable = ScrollTableDemo.get().getScrollTable();
          switch (policyBox.getSelectedIndex()) {
            case 0:
              scrollTable.setResizePolicy(ScrollTable.ResizePolicy.UNCONSTRAINED);
              break;
            case 1:
              scrollTable.setResizePolicy(ScrollTable.ResizePolicy.FLOW);
              break;
            case 2:
              scrollTable.setResizePolicy(ScrollTable.ResizePolicy.FIXED_WIDTH);
              break;
            case 3:
              scrollTable.setResizePolicy(ScrollTable.ResizePolicy.FILL_WIDTH);
              break;
          }
        }
      });
      form.addButton(button);
    }

    return form;
  }
View Full Code Here

TOP

Related Classes of com.google.gwt.gen2.datepicker.client.DatePicker

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.