Package com.google.gwt.user.client.ui.HTMLTable

Examples of com.google.gwt.user.client.ui.HTMLTable.CellFormatter


  private void _updateStyles(int fromRow) {
    HTMLTable.RowFormatter rf = flexTable.getRowFormatter();
    rf.addStyleName(CONTROL_ROW, "TermTable-controlRow");
    rf.addStyleName(HEADER_ROW, "TermTable-header");
    CellFormatter cf = flexTable.getCellFormatter();
   
    for (int row = fromRow, rows = flexTable.getRowCount(); row < rows; ++row) {
     
      if ( SET_EVEN_N_ODD_ROW_STYLE && row >= FIRST_REGULAR_ROW ) {
        rf.setStyleName(row, (row % 2) != 0 ? "TermTable-OddRow" : "TermTable-EvenRow");
      }
      cf.setAlignment(row, 0, ALIGN_CENTER, ALIGN_MIDDLE);
    }
   
    _updateControlColumns(flexTable.getCellCount(0) - 1);
  }
View Full Code Here


  private void _updateStyles(int fromRow) {
    HTMLTable.RowFormatter rf = flexTable.getRowFormatter();
    rf.addStyleName(CONTROL_ROW, "TermTable-controlRow");
    rf.addStyleName(HEADER_ROW, "TermTable-header");
    CellFormatter cf = flexTable.getCellFormatter();
   
    for (int row = fromRow, rows = flexTable.getRowCount(); row < rows; ++row) {
     
      if ( SET_EVEN_N_ODD_ROW_STYLE && row >= FIRST_REGULAR_ROW ) {
        rf.setStyleName(row, (row % 2) != 0 ? "TermTable-OddRow" : "TermTable-EvenRow");
      }
      cf.setAlignment(row, 0, ALIGN_CENTER, ALIGN_MIDDLE);
    }
   
    _updateControlColumns(flexTable.getCellCount(0) - 1);
  }
View Full Code Here

    grid = new Grid(1, 5);
    grid.setWidget(0, previousYearColumn, backwardsYear);
    grid.setWidget(0, previousMonthColumn, backwards);
    grid.setWidget(0, nextMonthColumn, forwards);
    grid.setWidget(0, nextYearColumn, forwardsYear);
    CellFormatter formatter = grid.getCellFormatter();
    formatter.setStyleName(0, monthColumn, BASE_NAME + "Month");
    formatter.setWidth(0, previousYearColumn, "1");
    formatter.setWidth(0, previousMonthColumn, "1");
    formatter.setWidth(0, monthColumn, "100%");
    formatter.setWidth(0, nextMonthColumn, "1");
    formatter.setWidth(0, nextYearColumn, "1");
    grid.setStyleName(BASE_NAME + "MonthSelector");
    initWidget(grid);
  }
View Full Code Here

  
   public void setSelectedIndex(int index)
   {
      if (selectedIndex_ != index)
      {
         CellFormatter cf = grid_.getCellFormatter() ;
         if (selectedIndex_ >= 0)
            cf.removeStyleName(selectedIndex_, 0, styles_.selected()) ;
        
         selectedIndex_ = index ;
        
         if (index >= 0)
         {
            cf.addStyleName(selectedIndex_, 0, styles_.selected()) ;
            com.google.gwt.dom.client.Element el =
                  DomUtils.getTableCell(grid_.getElement(), index, 0) ;
            DomUtils.ensureVisibleVert(scrollPanel_.getElement(), el, 2) ;
            SelectionEvent.fire(this, getSelectedItem()) ;
         }
View Full Code Here

    menuRightPanel.add(menuRight);
    menuRightPanel.add(searchPanel);
    menuLine.setWidget(0, 0, menuLeft);
    menuLine.setWidget(0, 1, new FlowPanel());
    menuLine.setWidget(0, 2, menuRightPanel);
    final CellFormatter fmt = menuLine.getCellFormatter();
    fmt.setStyleName(0, 0, RESOURCES.css().topmenuTDmenu());
    fmt.setStyleName(0, 1, RESOURCES.css().topmenuTDglue());
    fmt.setStyleName(0, 2, RESOURCES.css().topmenuTDmenu());

    siteHeader = RootPanel.get("gerrit_header");
    siteFooter = RootPanel.get("gerrit_footer");

    body = new ViewSite<Screen>() {
View Full Code Here

      final FlowPanel fp = new FlowPanel();
      fp.setStyleName(Gerrit.RESOURCES.css().registerScreenSection());
      fp.add(new SmallHeading(Util.C.welcomeUsernameHeading()));

      final Grid userInfo = new Grid(1, 2);
      final CellFormatter fmt = userInfo.getCellFormatter();
      userInfo.setStyleName(Gerrit.RESOURCES.css().infoBlock());
      userInfo.addStyleName(Gerrit.RESOURCES.css().accountInfoBlock());
      fp.add(userInfo);

      fmt.addStyleName(0, 0, Gerrit.RESOURCES.css().topmost());
      fmt.addStyleName(0, 1, Gerrit.RESOURCES.css().topmost());
      fmt.addStyleName(0, 0, Gerrit.RESOURCES.css().bottomheader());

      UsernameField field = new UsernameField();
      if (LocaleInfo.getCurrentLocale().isRTL()) {
        userInfo.setText(0, 1, Util.C.userName());
        userInfo.setWidget(0, 0, field);
        fmt.addStyleName(0, 1, Gerrit.RESOURCES.css().header());
      } else {
        userInfo.setText(0, 0, Util.C.userName());
        userInfo.setWidget(0, 1, field);
        fmt.addStyleName(0, 0, Gerrit.RESOURCES.css().header());
      }

      formBody.add(fp);
    }
View Full Code Here

      row = 0;
    } else if (max <= row) {
      row = max - 1;
    }

    final CellFormatter fmt = table.getCellFormatter();
    final int sTop = Document.get().getScrollTop();
    final int sEnd = sTop + Document.get().getClientHeight();

    while (0 <= row && row < max) {
      final Element cur = DOM.getParent(fmt.getElement(row, C_ARROW));
      final int cTop = cur.getAbsoluteTop();
      final int cEnd = cTop + cur.getOffsetHeight();

      if (cEnd < sTop) {
        row++;
View Full Code Here

  protected void movePointerTo(final int newRow) {
    movePointerTo(newRow, true);
  }

  protected void movePointerTo(final int newRow, final boolean scroll) {
    final CellFormatter fmt = table.getCellFormatter();
    final boolean clear = 0 <= currentRow && currentRow < table.getRowCount();
    if (clear) {
      final Element tr = DOM.getParent(fmt.getElement(currentRow, C_ARROW));
      UIObject.setStyleName(tr, Gerrit.RESOURCES.css().activeRow(), false);
    }
    if (newRow >= 0) {
      table.setWidget(newRow, C_ARROW, pointer);
      final Element tr = DOM.getParent(fmt.getElement(newRow, C_ARROW));
      UIObject.setStyleName(tr, Gerrit.RESOURCES.css().activeRow(), true);
      if (scroll) {
        scrollIntoView(tr);
      }
    } else if (clear) {
View Full Code Here

    }
    resetHtml(nc);
    initScript(script);

    int row = script.getPatchHeader().size();
    final CellFormatter fmt = table.getCellFormatter();
    final Iterator<PatchLine> iLine = lines.iterator();
    while (iLine.hasNext()) {
      final PatchLine l = iLine.next();
      final String n;
      switch (l.getType()) {
        case CONTEXT:
          n = Gerrit.RESOURCES.css().diffTextCONTEXT();
          break;
        case DELETE:
          n = Gerrit.RESOURCES.css().diffTextDELETE();
          break;
        case INSERT:
          n = Gerrit.RESOURCES.css().diffTextINSERT();
          break;
        default:
          continue;
      }
      while (!fmt.getStyleName(row, PC).contains(n)) {
        row++;
      }
      setRowItem(row++, l);
    }
  }
View Full Code Here


  @Override
  protected void insertRow(final int row) {
    super.insertRow(row);
    final CellFormatter fmt = table.getCellFormatter();
    fmt.addStyleName(row, PC - 2, Gerrit.RESOURCES.css().lineNumber());
    fmt.addStyleName(row, PC - 1, Gerrit.RESOURCES.css().lineNumber());
    fmt.addStyleName(row, PC, Gerrit.RESOURCES.css().diffText());
  }
View Full Code Here

TOP

Related Classes of com.google.gwt.user.client.ui.HTMLTable.CellFormatter

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.