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

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


   *
   * @return the footer table.
   */
  public static FixedWidthFlexTable getFooterTable() {
    if (footerTable == null) {
      footerTable = new FixedWidthFlexTable();
    }
    return footerTable;
  }
View Full Code Here


   *
   * @return the header table.
   */
  public static FixedWidthFlexTable getHeaderTable() {
    if (headerTable == null) {
      headerTable = new FixedWidthFlexTable();
    }
    return headerTable;
  }
View Full Code Here

   * Handle click events from the buttons in this panel.
   *
   * @param sender
   */
  public void onClick(Widget sender) {
    FixedWidthFlexTable headerTable = ScrollTableDemo.getHeaderTable();
    try {
      if (sender == setTextButton) {
        // Set Text
        int cell = Integer.parseInt(cellIndexBox.getText());
        int row = Integer.parseInt(rowIndexBox.getText());
        headerTable.setText(row, cell, textBox.getText());
      } else if (sender == setHtmlButton) {
        // Set HTML
        int cell = Integer.parseInt(cellIndexBox.getText());
        int row = Integer.parseInt(rowIndexBox.getText());
        headerTable.setHTML(row, cell, textBox.getText());
      } else if (sender == insertRowButton) {
        // Insert Row
        int row = Integer.parseInt(rowIndexBox.getText());
        headerTable.insertRow(row);
      } else if (sender == insertCellButton) {
        // Insert Cell
        int cell = Integer.parseInt(cellIndexBox.getText());
        int row = Integer.parseInt(rowIndexBox.getText());
        headerTable.insertCell(row, cell);
      } else if (sender == removeRowButton) {
        // Remove Row
        int row = Integer.parseInt(rowIndexBox.getText());
        headerTable.removeRow(row);
      } else if (sender == removeCellButton) {
        // Remove Cell
        int cell = Integer.parseInt(cellIndexBox.getText());
        int row = Integer.parseInt(rowIndexBox.getText());
        headerTable.removeCell(row, cell);
      } else if (sender == setRowSpanButton) {
        // Set RowSpan
        int cell = Integer.parseInt(cellIndexBox.getText());
        int row = Integer.parseInt(rowIndexBox.getText());
        int rowSpan = Integer.parseInt(rowSpanBox.getText());
        headerTable.getFlexCellFormatter().setRowSpan(row, cell, rowSpan);
      } else if (sender == setColSpanButton) {
        // Set ColSpan
        int cell = Integer.parseInt(cellIndexBox.getText());
        int row = Integer.parseInt(rowIndexBox.getText());
        int colSpan = Integer.parseInt(colSpanBox.getText());
        headerTable.getFlexCellFormatter().setColSpan(row, cell, colSpan);
      }
    } catch (IndexOutOfBoundsException e) {
      // Invalid cell index
      Window.alert("The column or row indexes you entered is out of bounds.");
    } catch (NumberFormatException e) {
View Full Code Here

  @Override
  public Widget createIssue() {

    final VerticalPanel p = new VerticalPanel();
    FixedWidthFlexTable header = new FixedWidthFlexTable();
    for (int i = 0; i < numColumns; i++) {
      header.setText(0, i, "column" + i);
    }

    model.setNumColumns(numColumns);
    model.setNumRows(numRows);
    ResizableWidgetCollection.get().setResizeCheckingEnabled(false);
View Full Code Here

  public ListBox(String[] columns) {
    super(impl.createFocusable());

    if (columns != null && columns.length > 0) {
      headerTable = new FixedWidthFlexTable();
      for (int column = 0; column < columns.length; ++column) {
        headerTable.setHTML(0, column, columns[column]);
      }
      setColumnsCount(columns.length);
    } else {
View Full Code Here

  public ListBox(String[] columns) {
    super(impl.createFocusable());

    if (columns != null && columns.length > 0) {
      headerTable = new FixedWidthFlexTable();
      for (int column = 0; column < columns.length; ++column) {
        headerTable.setHTML(0, column, columns[column]);
      }
      setColumnsCount(columns.length);
    } else {
View Full Code Here

    this.columnModel = columnModel;
    this.columnModel.addColumnModelListener(this);

    setModel(tableModel);

    FixedWidthFlexTable headerTable = table.getHeaderTable();

    for (int i = 0, n = columnModel.getColumnCount(); i < n; ++i) {
      headerTable.setHTML(0, i, columnModel.getColumn(i).getLabel());
      table.setColumnWidth(i, columnModel.getColumn(i).getWidth());
      table.setCellEditor(i,
          (AbstractCellEditor<T>) columnModel.getColumn(i).getCellEditor());
    }
View Full Code Here

      cachedTableModel.setPreCachedRowCount(50);
      cachedTableModel.setPostCachedRowCount(50);

      final LayoutPanel layoutPanel = getLayoutPanel();
      table = new PagingScrollTable<T>(cachedTableModel, new DataGrid(),
          new FixedWidthFlexTable());
      layoutPanel.clear();
      layoutPanel.add(table);
    }
  }
View Full Code Here

   * {@inheritDoc}
   *
   * @see org.gwt.mosaic.ui.client.table.TableColumnModelListener#columnAdded(org.gwt.mosaic.ui.client.table.TableColumnModelEvent)
   */
  public void columnAdded(TableColumnModelEvent event) {
    final FixedWidthFlexTable headerTable = table.getHeaderTable();
    for (int i = 0, n = columnModel.getColumnCount(); i < n; ++i) {
      headerTable.setHTML(0, i, columnModel.getColumn(i).getLabel());
      table.setColumnWidth(i, columnModel.getColumn(i).getWidth());
      table.setCellEditor(i,
          (AbstractCellEditor<T>) columnModel.getColumn(i).getCellEditor());
    }
    //table.
View Full Code Here

   * {@inheritDoc}
   *
   * @see org.gwt.mosaic.ui.client.table.TableColumnModelListener#columnRemoved(org.gwt.mosaic.ui.client.table.TableColumnModelEvent)
   */
  public void columnRemoved(TableColumnModelEvent event) {
    final FixedWidthFlexTable headerTable = table.getHeaderTable();
    for (int i = 0, n = columnModel.getColumnCount(); i < n; ++i) {
      headerTable.setHTML(0, i, columnModel.getColumn(i).getLabel());
      table.setColumnWidth(i, columnModel.getColumn(i).getWidth());
      table.setCellEditor(i,
          (AbstractCellEditor<T>) columnModel.getColumn(i).getCellEditor());
    }
    table.reloadPage();
View Full Code Here

TOP

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

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.