Package org.gwtlib.client.table

Examples of org.gwtlib.client.table.Row


    Column[] columns = {
      new Column(0, false, "First column", "50%"),
      new Column(1, false, "Second column", "50%")
    };
    final Row[] rows = {
      new Row(0, new Object[] { "First row, first column" , "First row, second column" }),
      new Row(1, new Object[] { "Second row, first column", "Second row, second column" }),
      new Row(2, new Object[] { "Third row, first column" , "Third row, second column" })
    };
    ColumnLayout layout = new ColumnLayout(columns);
    final Table table = new Table(layout);
    ContentProvider provider = new ContentProvider() {
      public void load(int begin, int end, final int sortId, boolean ascending) {
View Full Code Here


      Boolean check = new Boolean(false);
      StringBuffer label = new StringBuffer();
      for(int j = 0; j < 25; ++j) label.append((char)('a' + i));
      Date date = new Date(NOW.getTime() + Random.nextInt(365 * 24 * 3600 * 1000));
      Integer number = new Integer(Random.nextInt(10000));
      rows[i] = new Row(i, new Object[] {
          check, label.toString(), date, number, date, number, "One", number.toString(),
          number.toString(), "Hyperlink", "img/down.gif"
      });
    }
    // Now configure the table
View Full Code Here

    }
   
    private Rows transform(Person[] persons) {
      Row[] rows = new Row[persons.length];
      for(int i = 0; i < persons.length; ++i) {
        rows[i] = new Row(i, new Object[] { persons[i].getFirst(), persons[i].getLast() });
      }
      return new Rows(rows, 0);
    }
View Full Code Here

          if(row == 0) {
            if(column.isSortable()) {
              sort(c, column.getSortDirection() != Column.Sort.ASCENDING);
            }
          } else {
            Row r = _cache.getRow(_begin + row - 1);
            if(r != null) {
              fireCellClickedEvent(r, column);
              fireRowClickedEvent(r);
            }
          }
View Full Code Here

  public void refreshRowState() {
    Rows rows = getRows(_begin);
    int r = 1;
    for(int i = 0; i < rows.size(); ++i, ++r) {
      Row row = rows.getRow(i);
      _table.getRowFormatter().setStyleName(r, STYLE_ROW);
      _table.getRowFormatter().addStyleName(r, i % 2 == 0 ? STYLE_ROW_EVEN : STYLE_ROW_ODD);
      if(row.hasState(Row.State.SELECT)) _table.getRowFormatter().addStyleName(r, STYLE_ROW_SELECT);
      for(int j = 0, c = 0; j < _layout.getTotalColumnCount(); ++j) {
        Column column = _layout.getColumn(j);
        if(column.isVisible()) {
          _table.getCellFormatter().removeStyleName(r, c, STYLE_COLUMN_SELECT);
          _table.getCellFormatter().removeStyleName(r, c, STYLE_CELL_SELECT);
          if(column.hasState(Column.State.SELECT)) {
            _table.getCellFormatter().addStyleName(r, c, STYLE_COLUMN_SELECT);
            if(row.hasState(Row.State.SELECT)) _table.getCellFormatter().addStyleName(r, c, STYLE_CELL_SELECT);
          }
          c++;
        }
      }
    }
View Full Code Here

  protected void render(int pos) {
    Rows rows = getRows(pos);
    GWT.log("Rendering " + rows.size() + " rows", null);
    int r = 1;
    for(int i = 0; i < rows.size(); ++i, ++r) {
      final Row row = rows.getRow(i);
      for(int j = 0, c = 0; j < _layout.getTotalColumnCount(); ++j) {
        final Column column = _layout.getColumn(j);
        if(column.isVisible()) {
          final Widget widget = column.getRenderer().render(row, column, row.getValue(j));
          if(widget instanceof HasClickHandlers) {
            ((HasClickHandlers)widget).addClickHandler(new ClickHandler() {
              @Override
              public void onClick(ClickEvent event) {
                fireClickEvent(row, column, widget);       
View Full Code Here

TOP

Related Classes of org.gwtlib.client.table.Row

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.