Examples of FlexCellFormatter


Examples of com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter

                        }

                        layout.setWidget( 1,
                                0,
                                history );
                        FlexCellFormatter formatter = layout.getFlexCellFormatter();

                        formatter.setColSpan( 1,
                                0,
                                2 );

                        Button open = new Button( constants.View() );

                        open.addClickHandler( new ClickHandler() {

                            public void onClick( ClickEvent event ) {
                                showVersion( history.getValue( history.getSelectedIndex() ) );
                            }

                        } );

                        layout.setWidget( 2,
                                0,
                                open );
                        formatter.setColSpan( 2,
                                1,
                                3 );
                        formatter.setHorizontalAlignment( 2,
                                1,
                                HasHorizontalAlignment.ALIGN_CENTER );

                        showStaticIcon();
View Full Code Here

Examples of com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter

  public GWT_SNS_Main() {
    //
    FlexTable layout = new FlexTable();
    layout.setCellSpacing(6);
    layout.setWidth(mainWidth+"px");
    FlexCellFormatter cellFormatter = layout.getFlexCellFormatter();
    //layout.setBorderWidth(1);
   
     
      cellFormatter.setColSpan(0, 0, 2);
      //将第一行合并成一行.
      cellFormatter.setHorizontalAlignment(0, 1,
          HasHorizontalAlignment.ALIGN_CENTER);
      //设置第一行的对齐是.中心对齐.
    layout.setWidget(0, 0, new TopPanel());
   
    //设置面板中间的部分.中间的部分是包括一个左菜单.和一个center.
    cellFormatter.setWidth(1, 0, (mainWidth * 0.15 )+"px" );
    cellFormatter.setWidth(1, 1, (mainWidth * 0.85 )+"px" );
    cellFormatter.setHorizontalAlignment(1, 0,
        HasHorizontalAlignment.ALIGN_CENTER);
    cellFormatter.setVerticalAlignment(1, 0,
        HasVerticalAlignment.ALIGN_TOP);
    cellFormatter.setHorizontalAlignment(1, 1,
        HasHorizontalAlignment.ALIGN_CENTER);
    cellFormatter.setVerticalAlignment(1, 1,
        HasVerticalAlignment.ALIGN_TOP);
   
   
    layout.setWidget(1, 0, new LeftPanel());
    layout.setWidget(1, 1, new CenterPanel());
View Full Code Here

Examples of com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter

        layout.setWidget(0, 0, new Image(images.question()));
        break;
    }

    layout.setWidget(0, 1, new HTML(msg));
    FlexCellFormatter cellFormatter = layout.getFlexCellFormatter();
    cellFormatter.setHorizontalAlignment(0, 1,
        HasHorizontalAlignment.ALIGN_CENTER);
    cellFormatter.setColSpan(1, 0, 2);
    cellFormatter.setColSpan(2, 0, 2);
    cellFormatter.setWidth(0, 0, "15%");
    cellFormatter.setWidth(0, 1, "85%");
    cellFormatter.setHorizontalAlignment(1, 0,
        HasHorizontalAlignment.ALIGN_CENTER);
    cellFormatter.setHorizontalAlignment(2, 0,
        HasHorizontalAlignment.ALIGN_CENTER);
    return layout;
  }
View Full Code Here

Examples of com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter

    table.setWidth(cm.getTotalWidth() + "px");

    List<HeaderGroupConfig> configs = cm.getHeaderGroups();

    FlexCellFormatter cf = table.getFlexCellFormatter();
    RowFormatter rf = table.getRowFormatter();

    rows = 0;
    for (HeaderGroupConfig config : configs) {
      rows = Math.max(rows, config.getRow() + 1);
    }
    rows += 1;

    for (int i = 0; i < rows; i++) {
      rf.setStyleName(i, "x-grid3-hd-row");
      rf.getElement(i).setAttribute("role", "presentation");
    }

    int cols = cm.getColumnCount();

    for (HeaderGroupConfig config : cm.getHeaderGroups()) {
      int col = config.getColumn();
      int row = config.getRow();
      int rs = config.getRowspan();
      int cs = config.getColspan();

      Group group = createNewGroup(config);
      group.render(DOM.createDiv());

      boolean hide = true;
      if (rows > 1) {
        for (int i = col; i < (col + cs); i++) {
          if (!cm.isHidden(i)) {
            hide = false;
          }
        }
      }
      if (hide) {
        continue;
      }

      table.setWidget(row, col, group);
      cf.setStyleName(row, col, "x-grid3-header x-grid3-hd x-grid3-cell");

      HorizontalAlignment align = config.getHorizontalAlignment();
      if (align == HorizontalAlignment.RIGHT) {
        cf.setHorizontalAlignment(row, col, HasHorizontalAlignment.ALIGN_RIGHT);
      } else if (align == HorizontalAlignment.LEFT) {
        cf.setHorizontalAlignment(row, col, HasHorizontalAlignment.ALIGN_LEFT);
      } else {
        cf.setHorizontalAlignment(row, col, HasHorizontalAlignment.ALIGN_CENTER);
      }

      int ncs = cs;
      if (cs > 1) {
        for (int i = col; i < (col + cs); i++) {
          if (cm.isHidden(i)) {
            ncs -= 1;
          }
        }
      }

      cf.setRowSpan(row, col, rs);
      cf.setColSpan(row, col, ncs);
    }

    for (int i = 0; i < cols; i++) {
      Head h = createNewHead(cm.getColumn(i));
      if (cm.isHidden(i)) {
        continue;
      }
      int rowspan = 1;
      if (rows > 1) {
        for (int j = rows - 2; j >= 0; j--) {
          if (!cm.hasGroup(j, i)) {
            rowspan += 1;
          }
        }
      }

      h.render(DOM.createDiv());
      int row;
      if (rowspan > 1) {
        row = (rows - 1) - (rowspan - 1);
      } else {
        row = rows - 1;
      }

      h.row = row;

      if (rowspan > 1) {
        table.setWidget(row, i, h);
        table.getFlexCellFormatter().setRowSpan(row, i, rowspan);
      } else {
        table.setWidget(row, i, h);
      }
      cf.setStyleName(row, i, "x-grid3-header x-grid3-hd x-grid3-cell x-grid3-td-" + cm.getColumnId(i));
      cf.getElement(row, i).setAttribute("role", "presentation");

      HorizontalAlignment align = cm.getColumnAlignment(i);
      if (align == HorizontalAlignment.RIGHT) {
        table.getCellFormatter().setHorizontalAlignment(row, i, HasHorizontalAlignment.ALIGN_RIGHT);
        table.getCellFormatter().getElement(row, i).getFirstChildElement().getStyle().setPropertyPx("paddingRight", 16);
View Full Code Here

Examples of com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter

    BranchesTable() {
      table.setWidth("");
      table.setText(0, 2, Util.C.columnBranchName());
      table.setText(0, 3, Util.C.columnBranchRevision());

      final FlexCellFormatter fmt = table.getFlexCellFormatter();
      fmt.addStyleName(0, 1, Gerrit.RESOURCES.css().iconHeader());
      fmt.addStyleName(0, 2, Gerrit.RESOURCES.css().dataHeader());
      fmt.addStyleName(0, 3, Gerrit.RESOURCES.css().dataHeader());
      if (Gerrit.getGitwebLink() != null) {
        fmt.addStyleName(0, 4, Gerrit.RESOURCES.css().dataHeader());
      }
    }
View Full Code Here

Examples of com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter

      if (c != null) {
        table.setWidget(row, 4, new Anchor(c.getLinkName(), false, c.toBranch(k
            .getNameKey())));
      }

      final FlexCellFormatter fmt = table.getFlexCellFormatter();
      String iconCellStyle = Gerrit.RESOURCES.css().iconCell();
      String dataCellStyle = Gerrit.RESOURCES.css().dataCell();
      if ("refs/meta/config".equals(k.getShortName())
          || "HEAD".equals(k.getShortName())) {
        iconCellStyle = Gerrit.RESOURCES.css().specialBranchIconCell();
        dataCellStyle = Gerrit.RESOURCES.css().specialBranchDataCell();
        fmt.setStyleName(row, 0, iconCellStyle);
      }
      fmt.addStyleName(row, 1, iconCellStyle);
      fmt.addStyleName(row, 2, dataCellStyle);
      fmt.addStyleName(row, 3, dataCellStyle);
      if (c != null) {
        fmt.addStyleName(row, 4, dataCellStyle);
      }

      setRowItem(row, k);
    }
View Full Code Here

Examples of com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter

      table.setWidth("");
      table.setText(0, 1, Util.C.agreementStatus());
      table.setText(0, 2, Util.C.agreementName());
      table.setText(0, 3, Util.C.agreementDescription());

      final FlexCellFormatter fmt = table.getFlexCellFormatter();
      for (int c = 1; c < 4; c++) {
        fmt.addStyleName(0, c, Gerrit.RESOURCES.css().dataHeader());
      }
    }
View Full Code Here

Examples of com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter

        } else {
          table.setText(row, 2, cla.getName());
        }
        table.setText(row, 3, cla.getDescription());
      }
      final FlexCellFormatter fmt = table.getFlexCellFormatter();
      for (int c = 1; c < 4; c++) {
        fmt.addStyleName(row, c, Gerrit.RESOURCES.css().dataCell());
      }

      setRowItem(row, cla);
    }
View Full Code Here

Examples of com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter

    }
  }

  void display(final List<Patch> result) {
    all.clear();
    final FlexCellFormatter fmt = table.getFlexCellFormatter();
    table.setText(0, 0, PatchUtil.C.patchHeaderPatchSet());
    fmt.setStyleName(0, 0, Gerrit.RESOURCES.css().dataHeader());
    table.setText(1, 0, PatchUtil.C.patchHeaderOld());
    fmt.setStyleName(1, 0, Gerrit.RESOURCES.css().dataHeader());
    table.setText(2, 0, PatchUtil.C.patchHeaderNew());
    fmt.setStyleName(2, 0, Gerrit.RESOURCES.css().dataHeader());
    table.setText(3, 0, Util.C.patchTableColumnComments());
    fmt.setStyleName(3, 0, Gerrit.RESOURCES.css().dataHeader());

    if (screen.getPatchSetDetail().getInfo().getParents().size() > 1) {
      table.setText(0, 1, PatchUtil.C.patchBaseAutoMerge());
    } else {
      table.setText(0, 1, PatchUtil.C.patchBase());
    }
    fmt.setStyleName(0, 1, Gerrit.RESOURCES.css().dataCell());
    fmt.addStyleName(0, 1, Gerrit.RESOURCES.css().topMostCell());
    fmt.setStyleName(1, 1, Gerrit.RESOURCES.css().dataCell());
    fmt.setStyleName(2, 1, Gerrit.RESOURCES.css().dataCell());
    fmt.setStyleName(3, 1, Gerrit.RESOURCES.css().dataCell());

    installRadio(1, 1, null, screen.idSideA, 0);

    int col=2;
    for (final Patch k : result) {
      final PatchSet.Id psId = k.getKey().getParentKey();
      table.setText(0, col, String.valueOf(psId.get()));
      fmt.setStyleName(0, col, Gerrit.RESOURCES.css().patchHistoryTablePatchSetHeader());
      fmt.addStyleName(0, col, Gerrit.RESOURCES.css().dataCell());
      fmt.addStyleName(0, col, Gerrit.RESOURCES.css().topMostCell());

      installRadio(1, col, psId, screen.idSideA, 0);
      installRadio(2, col, psId, screen.idSideB, 1);

      fmt.setStyleName(3, col, Gerrit.RESOURCES.css().dataCell());
      if (k.getCommentCount() > 0) {
        table.setText(3, col, Integer.toString(k.getCommentCount()));
      }
      col++;
    }
View Full Code Here

Examples of com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter

      final PatchSet.Id cur, final int file) {
    final HistoryRadio b = new HistoryRadio(psId, file);
    b.setValue(eq(cur, psId));

    table.setWidget(row, col, b);
    final FlexCellFormatter fmt = table.getFlexCellFormatter();
    fmt.setHorizontalAlignment(row, col, HasHorizontalAlignment.ALIGN_CENTER);
    fmt.setStyleName(row, col, Gerrit.RESOURCES.css().dataCell());
    all.add(b);
  }
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.