Package com.google.gwt.widgetideas.table.client

Examples of com.google.gwt.widgetideas.table.client.ScrollTable


   *
   * @param sender
   */
  public void onClick(Widget sender) {
    try {
      ScrollTable scrollTable = ScrollTableDemo.getScrollTable();
      if (sender == resizeButton) {
        // Resize the column
        int column = Integer.parseInt(columnIndexBox.getText());
        int width = Integer.parseInt(columnWidthBox.getText());
        if (guaranteedCheck.isChecked()) {
          scrollTable.setGuaranteedColumnWidth(column, width);
        } else {
          scrollTable.setColumnWidth(column, width);
        }
      } else if (sender == stretchButton) {
        // Stretch to fit contents
        int column = Integer.parseInt(columnIndexBox.getText());
        scrollTable.autoFitColumnWidth(column);
      } else if (sender == hideButton) {
        // Hide a column
        Window.alert("Feature not available");
      } else if (sender == showButton) {
        // Show a column
        Window.alert("Feature not available");
      } else if (sender == resizePolicyButton) {
        // Set the resize policy
        String selection = resizePolicyBox.getValue(resizePolicyBox.getSelectedIndex());
        if (selection.equals("Disabled")) {
          scrollTable.setResizePolicy(ScrollTable.ResizePolicy.DISABLED);
        } else if (selection.equals("Unconstrained")) {
          scrollTable.setResizePolicy(ScrollTable.ResizePolicy.UNCONSTRAINED);
        } else if (selection.equals("Flow")) {
          scrollTable.setResizePolicy(ScrollTable.ResizePolicy.FLOW);
        } else if (selection.equals("Fixed")) {
          scrollTable.setResizePolicy(ScrollTable.ResizePolicy.FIXED_WIDTH);
        } else if (selection.equals("Fill")) {
          scrollTable.setResizePolicy(ScrollTable.ResizePolicy.FILL_WIDTH);
        } else if (selection.equals("Fill Disabled")) {
          scrollTable.setResizePolicy(ScrollTable.ResizePolicy.FILL_WIDTH_DISABLED);
        }
      }
    } catch (IndexOutOfBoundsException e) {
      Window.alert("The column index you entered is out of bounds.");
    } catch (NumberFormatException e) {
View Full Code Here


   * Handle click events from the buttons in this panel.
   *
   * @param sender
   */
  public void onClick(Widget sender) {
    ScrollTable scrollTable = ScrollTableDemo.getScrollTable();
    if (sender == toggleStaticCheckingButton) {
      if (ResizableWidgetCollection.get().isResizeCheckingEnabled()) {
        ResizableWidgetCollection.get().setResizeCheckingEnabled(false);
        toggleButtonGrid.setHTML(0, 1, "disabled");
      } else {
        ResizableWidgetCollection.get().setResizeCheckingEnabled(true);
        toggleButtonGrid.setHTML(0, 1, "enabled");
      }
    } else if (sender == scrollingButton) {
      String policy = scrollingBox.getValue(scrollingBox.getSelectedIndex());
      if (policy.equals("horizontal")) {
        scrollTable.setScrollPolicy(ScrollPolicy.HORIZONTAL);
      } else if (policy.equals("both")) {
        scrollTable.setScrollPolicy(ScrollPolicy.BOTH);
      }
    } else if (sender == redrawButton) {
      scrollTable.redraw();
    } else if (sender == heightWidthButton) {
      DOM.setStyleAttribute(scrollTable.getElement(),
          heightWidthBox.getValue(heightWidthBox.getSelectedIndex()),
          heightWidthText.getText());
    } else if (sender == minWidthButton) {
      int minWidth = Integer.parseInt(minWidthText.getText());
      scrollTable.setMinWidth(minWidth);
    }
  }
View Full Code Here

   * Handle click events from the buttons in this panel.
   *
   * @param sender
   */
  public void onClick(Widget sender) {
    ScrollTable scrollTable = ScrollTableDemo.getScrollTable();
    SortableGrid dataTable = ScrollTableDemo.getDataTable();

    try {
      if (sender == moveRowUpButton) {
        // Move row up
        int row1 = Integer.parseInt(rowIndexBox1.getText());
        dataTable.moveRowUp(row1);
        rowIndexBox1.setText((row1 - 1) + "");
      } else if (sender == moveRowDownButton) {
        // Move row down
        int row1 = Integer.parseInt(rowIndexBox1.getText());
        dataTable.moveRowDown(row1);
        rowIndexBox1.setText((row1 + 1) + "");
      } else if (sender == swapRowsButton) {
        // Swap two rows
        int row1 = Integer.parseInt(rowIndexBox1.getText());
        int row2 = Integer.parseInt(rowIndexBox2.getText());
        dataTable.swapRows(row1, row2);
      } else if (sender == reverseRowsButton) {
        // Reverse all rows
        dataTable.reverseRows();
      } else if (sender == sortColumnButton) {
        // Sort a column
        int column = Integer.parseInt(columnIndexBox.getText());
        dataTable.sortColumn(column);
      } else if (sender == makeSortableButton) {
        // Make column sortable
        int column = Integer.parseInt(columnIndexBox.getText());
        scrollTable.setColumnSortable(column, true);
      } else if (sender == makeUnsortableButton) {
        // Make column unsortable
        int column = Integer.parseInt(columnIndexBox.getText());
        scrollTable.setColumnSortable(column, false);
      } else if (sender == toggleSortingButton) {
        if (scrollTable.isSortingEnabled()) {
          scrollTable.setSortingEnabled(false);
          grid.setHTML(3, 1, "disabled");
        } else {
          scrollTable.setSortingEnabled(true);
          grid.setHTML(3, 1, "enabled");
        }
      }
    } catch (IndexOutOfBoundsException e) {
      Window.alert("The row or column index you entered is out of bounds.");
View Full Code Here

    getHeaderTable();
    getFooterTable();
    getDataTable();
   
    // Add the scroll table to the page
    scrollTable = new ScrollTable(dataTable, headerTable);
    scrollTable.setFooterTable(footerTable);

    // Setup the header
    setupScrollTable();
   
View Full Code Here

TOP

Related Classes of com.google.gwt.widgetideas.table.client.ScrollTable

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.