Search in sources :

Example 11 with CellFormatter

use of com.google.gwt.user.client.ui.HTMLTable.CellFormatter in project gerrit by GerritCodeReview.

the class ChangeTable method applyDataRowStyle.

@Override
protected void applyDataRowStyle(final int row) {
    super.applyDataRowStyle(row);
    final CellFormatter fmt = table.getCellFormatter();
    fmt.addStyleName(row, C_STAR, Gerrit.RESOURCES.css().iconCell());
    for (int i = C_ID; i < columns; i++) {
        fmt.addStyleName(row, i, Gerrit.RESOURCES.css().dataCell());
    }
    if (!showLegacyId) {
        fmt.addStyleName(row, C_ID, Gerrit.RESOURCES.css().dataCellHidden());
    }
    fmt.addStyleName(row, C_SUBJECT, Gerrit.RESOURCES.css().cSUBJECT());
    fmt.addStyleName(row, C_STATUS, Gerrit.RESOURCES.css().cSTATUS());
    fmt.addStyleName(row, C_OWNER, Gerrit.RESOURCES.css().cOWNER());
    fmt.addStyleName(row, C_ASSIGNEE, showAssignee ? Gerrit.RESOURCES.css().cASSIGNEE() : Gerrit.RESOURCES.css().dataCellHidden());
    fmt.addStyleName(row, C_LAST_UPDATE, Gerrit.RESOURCES.css().cLastUpdate());
    fmt.addStyleName(row, C_SIZE, Gerrit.RESOURCES.css().cSIZE());
    for (int i = C_SIZE + 1; i < columns; i++) {
        fmt.addStyleName(row, i, Gerrit.RESOURCES.css().cAPPROVAL());
    }
}
Also used : CellFormatter(com.google.gwt.user.client.ui.HTMLTable.CellFormatter) FlexCellFormatter(com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter)

Example 12 with CellFormatter

use of com.google.gwt.user.client.ui.HTMLTable.CellFormatter in project gerrit by GerritCodeReview.

the class DocTable method applyDataRowStyle.

@Override
protected void applyDataRowStyle(int row) {
    super.applyDataRowStyle(row);
    CellFormatter fmt = table.getCellFormatter();
    fmt.addStyleName(row, C_TITLE, Gerrit.RESOURCES.css().dataCell());
    fmt.addStyleName(row, C_TITLE, Gerrit.RESOURCES.css().cSUBJECT());
}
Also used : FlexCellFormatter(com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter) CellFormatter(com.google.gwt.user.client.ui.HTMLTable.CellFormatter)

Example 13 with CellFormatter

use of com.google.gwt.user.client.ui.HTMLTable.CellFormatter in project gerrit by GerritCodeReview.

the class NavigationTable method ensurePointerVisible.

protected void ensurePointerVisible() {
    final int max = table.getRowCount();
    int row = currentRow;
    final int init = row;
    if (row < 0) {
        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 = fmt.getElement(row, C_ARROW).getParentElement();
        final int cTop = cur.getAbsoluteTop();
        final int cEnd = cTop + cur.getOffsetHeight();
        if (cEnd < sTop) {
            row++;
        } else if (sEnd < cTop) {
            row--;
        } else {
            break;
        }
    }
    if (init != row) {
        movePointerTo(row, false);
    }
}
Also used : Element(com.google.gwt.dom.client.Element) CellFormatter(com.google.gwt.user.client.ui.HTMLTable.CellFormatter)

Example 14 with CellFormatter

use of com.google.gwt.user.client.ui.HTMLTable.CellFormatter in project gerrit by GerritCodeReview.

the class MyOAuthTokenScreen method row.

private void row(Grid grid, int row, String name, Widget field) {
    final CellFormatter fmt = grid.getCellFormatter();
    if (LocaleInfo.getCurrentLocale().isRTL()) {
        grid.setText(row, 1, name);
        grid.setWidget(row, 0, field);
        fmt.addStyleName(row, 1, Gerrit.RESOURCES.css().header());
    } else {
        grid.setText(row, 0, name);
        grid.setWidget(row, 1, field);
        fmt.addStyleName(row, 0, Gerrit.RESOURCES.css().header());
    }
}
Also used : CellFormatter(com.google.gwt.user.client.ui.HTMLTable.CellFormatter)

Example 15 with CellFormatter

use of com.google.gwt.user.client.ui.HTMLTable.CellFormatter in project gerrit by GerritCodeReview.

the class MyPasswordScreen method row.

private void row(final Grid info, final int row, final String name, final Widget field) {
    final CellFormatter fmt = info.getCellFormatter();
    if (LocaleInfo.getCurrentLocale().isRTL()) {
        info.setText(row, 1, name);
        info.setWidget(row, 0, field);
        fmt.addStyleName(row, 1, Gerrit.RESOURCES.css().header());
    } else {
        info.setText(row, 0, name);
        info.setWidget(row, 1, field);
        fmt.addStyleName(row, 0, Gerrit.RESOURCES.css().header());
    }
}
Also used : CellFormatter(com.google.gwt.user.client.ui.HTMLTable.CellFormatter)

Aggregations

CellFormatter (com.google.gwt.user.client.ui.HTMLTable.CellFormatter)18 FlowPanel (com.google.gwt.user.client.ui.FlowPanel)6 Grid (com.google.gwt.user.client.ui.Grid)6 Element (com.google.gwt.dom.client.Element)4 FlexCellFormatter (com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter)3 ApprovalInfo (com.google.gerrit.client.info.ChangeInfo.ApprovalInfo)2 JsArrayString (com.google.gwt.core.client.JsArrayString)2 Anchor (com.google.gwt.user.client.ui.Anchor)2 HorizontalPanel (com.google.gwt.user.client.ui.HorizontalPanel)2 CopyableLabel (com.google.gwtexpui.clippy.client.CopyableLabel)2 AvatarImage (com.google.gerrit.client.AvatarImage)1 GerritUiExtensionPoint (com.google.gerrit.client.GerritUiExtensionPoint)1 ProjectScreen (com.google.gerrit.client.admin.ProjectScreen)1 ChangeListScreen (com.google.gerrit.client.changes.ChangeListScreen)1 AccountInfo (com.google.gerrit.client.info.AccountInfo)1 LabelInfo (com.google.gerrit.client.info.ChangeInfo.LabelInfo)1 NativeString (com.google.gerrit.client.rpc.NativeString)1 BranchLink (com.google.gerrit.client.ui.BranchLink)1 InlineHyperlink (com.google.gerrit.client.ui.InlineHyperlink)1 LinkMenuBar (com.google.gerrit.client.ui.LinkMenuBar)1