use of com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter in project gerrit by GerritCodeReview.
the class ChangeTable method updateColumnsForLabels.
public void updateColumnsForLabels(ChangeList... lists) {
labelNames = new ArrayList<>();
for (ChangeList list : lists) {
for (int i = 0; i < list.length(); i++) {
for (String name : list.get(i).labels()) {
if (!labelNames.contains(name)) {
labelNames.add(name);
}
}
}
}
Collections.sort(labelNames);
int baseColumns = BASE_COLUMNS;
if (baseColumns + labelNames.size() < columns) {
int n = columns - (baseColumns + labelNames.size());
for (int row = 0; row < table.getRowCount(); row++) {
table.removeCells(row, columns, n);
}
}
columns = baseColumns + labelNames.size();
FlexCellFormatter fmt = table.getFlexCellFormatter();
for (int i = 0; i < labelNames.size(); i++) {
String name = labelNames.get(i);
int col = baseColumns + i;
String abbrev = getAbbreviation(name, "-");
table.setText(0, col, abbrev);
table.getCellFormatter().getElement(0, col).setTitle(name);
fmt.addStyleName(0, col, Gerrit.RESOURCES.css().dataHeader());
}
for (Section s : sections) {
if (s.titleRow >= 0) {
fmt.setColSpan(s.titleRow, 0, columns);
}
}
}
use of com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter in project gerrit by GerritCodeReview.
the class ChangeTable method insertNoneRow.
private void insertNoneRow(final int row) {
insertRow(row);
table.setText(row, 0, Util.C.changeTableNone());
final FlexCellFormatter fmt = table.getFlexCellFormatter();
fmt.setColSpan(row, 0, columns);
fmt.setStyleName(row, 0, Gerrit.RESOURCES.css().emptySection());
}
use of com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter in project gerrit by GerritCodeReview.
the class DashboardsTable method insert.
protected void insert(final int row, final DashboardInfo k) {
table.insertRow(row);
applyDataRowStyle(row);
final FlexCellFormatter fmt = table.getFlexCellFormatter();
fmt.addStyleName(row, 1, Gerrit.RESOURCES.css().dataCell());
fmt.addStyleName(row, 2, Gerrit.RESOURCES.css().dataCell());
fmt.addStyleName(row, 3, Gerrit.RESOURCES.css().dataCell());
fmt.addStyleName(row, 4, Gerrit.RESOURCES.css().dataCell());
fmt.addStyleName(row, 5, Gerrit.RESOURCES.css().dataCell());
populate(row, k);
}
use of com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter in project gerrit by GerritCodeReview.
the class DashboardsTable method initColumnHeaders.
protected void initColumnHeaders() {
final FlexCellFormatter fmt = table.getFlexCellFormatter();
fmt.setColSpan(0, 0, 2);
fmt.addStyleName(0, 1, Gerrit.RESOURCES.css().dataHeader());
fmt.addStyleName(0, 2, Gerrit.RESOURCES.css().dataHeader());
fmt.addStyleName(0, 3, Gerrit.RESOURCES.css().dataHeader());
fmt.addStyleName(0, 4, Gerrit.RESOURCES.css().dataHeader());
table.setText(0, 1, Util.C.dashboardName());
table.setText(0, 2, Util.C.dashboardTitle());
table.setText(0, 3, Util.C.dashboardDescription());
table.setText(0, 4, Util.C.dashboardInherited());
}
use of com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter in project perun by CESNET.
the class FormInputStatusWidget method build.
private void build() {
ft.clear();
FlexCellFormatter ftf = ft.getFlexCellFormatter();
Image img;
String classname = "";
if (status == Status.OK) {
img = new Image(SmallIcons.INSTANCE.acceptIcon());
classname = "input-status-ok";
} else if (status == Status.ERROR) {
img = new Image(SmallIcons.INSTANCE.exclamationIcon());
classname = "input-status-error";
} else {
img = new Image(AjaxLoaderImage.SMALL_IMAGE_URL);
classname = "input-status-loading";
}
Label label = new Label(message);
label.addStyleName(classname);
label.getElement().setId(classname);
ft.setWidget(0, 0, img);
ft.setWidget(0, 1, label);
ftf.setWidth(0, 0, "25px");
ftf.setHeight(0, 0, "25px");
ftf.setVerticalAlignment(0, 0, HasVerticalAlignment.ALIGN_MIDDLE);
ftf.setVerticalAlignment(0, 1, HasVerticalAlignment.ALIGN_MIDDLE);
}
Aggregations