Examples of ScrollTable


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

    FixedWidthFlexTable headerTable = createHeaderTable();
    FixedWidthFlexTable footerTable = createFooterTable();
    FixedWidthGrid dataTable = createDataTable();

    // Create the scroll table
    ScrollTable theScrollTable = new ScrollTable(dataTable, headerTable);
    theScrollTable.setFooterTable(footerTable);

    // Setup the formatting
    theScrollTable.setCellPadding(3);
    theScrollTable.setCellSpacing(0);
    theScrollTable.setResizePolicy(ScrollTable.ResizePolicy.FILL_WIDTH);

    // first name
    theScrollTable.setMinimumColumnWidth(0, 50);
    theScrollTable.setPreferredColumnWidth(0, 100);
    theScrollTable.setColumnTruncatable(0, false);

    // last name
    theScrollTable.setMinimumColumnWidth(1, 50);
    theScrollTable.setPreferredColumnWidth(1, 100);
    theScrollTable.setColumnTruncatable(1, false);

    // age
    theScrollTable.setMinimumColumnWidth(2, 35);
    theScrollTable.setPreferredColumnWidth(2, 35);
    theScrollTable.setMaximumColumnWidth(2, 35);

    // gender
    theScrollTable.setMinimumColumnWidth(3, 45);
    theScrollTable.setPreferredColumnWidth(3, 45);
    theScrollTable.setMaximumColumnWidth(3, 45);

    // race
    theScrollTable.setMinimumColumnWidth(4, 45);
    theScrollTable.setPreferredColumnWidth(4, 45);
    theScrollTable.setMaximumColumnWidth(4, 45);

    // color
    theScrollTable.setPreferredColumnWidth(5, 80);

    // sport
    theScrollTable.setMinimumColumnWidth(6, 40);
    theScrollTable.setPreferredColumnWidth(6, 110);

    // college
    theScrollTable.setMinimumColumnWidth(7, 50);
    theScrollTable.setPreferredColumnWidth(7, 180);
    theScrollTable.setMaximumColumnWidth(7, 250);

    // year
    theScrollTable.setPreferredColumnWidth(8, 25);
    theScrollTable.setColumnTruncatable(8, false);

    // gpa
    theScrollTable.setPreferredColumnWidth(9, 35);
    theScrollTable.setColumnTruncatable(9, false);

    // id
    theScrollTable.setPreferredColumnWidth(10, 55);
    theScrollTable.setColumnTruncatable(10, false);

    // pin
    theScrollTable.setPreferredColumnWidth(11, 45);
    theScrollTable.setColumnTruncatable(11, false);

    return theScrollTable;
  }
View Full Code Here

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

    if (PagingScrollTableDemo.get() == null) {
      Button button = new Button("Make Sortable", new ClickHandler() {
        public void onClick(ClickEvent event) {
          try {
            int column = Integer.parseInt(columnBox.getText());
            ScrollTable scrollTable = (ScrollTable) ScrollTableDemo.get().getScrollTable();
            scrollTable.setColumnSortable(column, true);
          } catch (NumberFormatException e) {
            Window.alert("Please enter valid integers for the row and column.");
          }
        }
      });
      form.addButton(button);
    }

    // Add a button to make column unsortable
    if (PagingScrollTableDemo.get() == null) {
      Button button = new Button("Make Unsortable", new ClickHandler() {
        public void onClick(ClickEvent event) {
          try {
            int column = Integer.parseInt(columnBox.getText());
            ScrollTable scrollTable = (ScrollTable) ScrollTableDemo.get().getScrollTable();
            scrollTable.setColumnSortable(column, false);
          } catch (NumberFormatException e) {
            Window.alert("Please enter valid integers for the row and column.");
          }
        }
      });
View Full Code Here

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

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

   * 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

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

   * 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

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

    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

Examples of org.damour.base.client.ui.scrolltable.ScrollTable

    }

    dialogContent.setWidget(1, 0, new Label("E-Mail this to up " + NUM_ADDRESSES + " friends.  Just enter their e-mail addresses in the form below.", true));

    if (emailAddressTable == null) {
      emailAddressTable = new ScrollTable(columnWidths, false);
      emailAddressTable.setHeaderWidget(0, new Label("E-Mail Address"), HasHorizontalAlignment.ALIGN_LEFT);
      emailAddressTable.setHeaderWidget(1, new Label("Name"), HasHorizontalAlignment.ALIGN_LEFT);

      TextBox firstAddressTextBox = null;
      for (int i = 0; i < NUM_ADDRESSES; i++) {
View Full Code Here

Examples of org.damour.base.client.ui.scrolltable.ScrollTable

  }

  public void initUI() {
    String[] columnWidths = new String[] { "600px", "400px", "60px" };

    final ScrollTable table = new ScrollTable(columnWidths, false);
    clear();
    add(table);
    Button refreshButton = new Button("Refresh");
    refreshButton.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent event) {
        fetchReferrals(table);
      }
    });
    add(refreshButton);

    table.setHeaderWidget(0, new Label("Referrer"), HasHorizontalAlignment.ALIGN_LEFT);
    table.setHeaderWidget(1, new Label("Search Term"), HasHorizontalAlignment.ALIGN_LEFT);
    table.setHeaderWidget(2, new Label("Count"), HasHorizontalAlignment.ALIGN_RIGHT);

    // DateTimeFormat dateFormat = DateTimeFormat.getFormat(LocaleInfo.getCurrentLocale().getDateTimeFormatInfo().dateFormatShort());

    fetchReferrals(table);
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.