本文整理汇总了Java中com.google.gwt.dom.builder.shared.TableCellBuilder类的典型用法代码示例。如果您正苦于以下问题:Java TableCellBuilder类的具体用法?Java TableCellBuilder怎么用?Java TableCellBuilder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TableCellBuilder类属于com.google.gwt.dom.builder.shared包,在下文中一共展示了TableCellBuilder类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: buildRowImpl
import com.google.gwt.dom.builder.shared.TableCellBuilder; //导入依赖的package包/类
@SuppressWarnings("deprecation")
@Override
public void buildRowImpl(ContactInfo rowValue, int absRowIndex) {
buildContactRow(rowValue, absRowIndex, false);
// Display information about the user in another row that spans the entire
// table.
Date dob = rowValue.getBirthday();
if (dob.getMonth() == todayMonth) {
TableRowBuilder row = startRow();
TableCellBuilder td = row.startTD().colSpan(7).className(cellStyle);
td.style().trustedBackgroundColor("#ccf").endStyle();
td.text(rowValue.getFirstName() + "'s birthday is this month!").endTD();
row.endTR();
}
// Display list of friends.
if (showingFriends.contains(rowValue.getId())) {
Set<ContactInfo> friends = ContactDatabase.get().queryFriends(rowValue);
for (ContactInfo friend : friends) {
buildContactRow(friend, absRowIndex, true);
}
}
}
开发者ID:Peergos,项目名称:Peergos,代码行数:25,代码来源:CwCustomDataGrid.java
示例2: tdGenerated
import com.google.gwt.dom.builder.shared.TableCellBuilder; //导入依赖的package包/类
@Override
protected void tdGenerated(TableCellBuilder aTd, Cell.Context aContext) {
if (aContext instanceof RenderedCellContext) {
PublishedCell pCell = ((RenderedCellContext) aContext).getPublishedCell();
if (pCell != null && pCell.getBackground() != null) {
aTd.style().trustedBackgroundColor(pCell.getBackground().toStyled());
} else {
super.tdGenerated(aTd, aContext);
}
} else {
super.tdGenerated(aTd, aContext);
}
}
开发者ID:marat-gainullin,项目名称:platypus-js,代码行数:14,代码来源:RenderedTableCellBuilder.java
示例3: buildHeader
import com.google.gwt.dom.builder.shared.TableCellBuilder; //导入依赖的package包/类
/**
* Renders the header of one column, with the given options.
*
* @param out
* the table row to build into
* @param header
* the {@link Header} to render
* @param column
* the column to associate with the header
* @param sortedColumn
* the column that is currently sorted
* @param isSortAscending
* true if the sorted column is in ascending order
* @param isFirst
* true if this the first column
* @param isLast
* true if this the last column
*/
private void buildHeader(TableRowBuilder out, Header<?> header, Column<PasswordCard, ?> column, Column<?, ?> sortedColumn, boolean isSortAscending, boolean isFirst,
boolean isLast) {
// Choose the classes to include with the element.
com.google.gwt.user.cellview.client.AbstractCellTable.Style style = dataGrid.getResources().style();
boolean isSorted = (sortedColumn == column);
StringBuilder classesBuilder = new StringBuilder(style.header());
if (isFirst) {
classesBuilder.append(" " + style.firstColumnHeader());
}
if (isLast) {
classesBuilder.append(" " + style.lastColumnHeader());
}
if (column.isSortable()) {
classesBuilder.append(" " + style.sortableHeader());
}
if (isSorted) {
classesBuilder.append(" " + (isSortAscending ? style.sortedHeaderAscending() : style.sortedHeaderDescending()));
}
// Create the table cell.
TableCellBuilder th = out.startTH().className(classesBuilder.toString());
// Associate the cell with the column to enable sorting of the
// column.
enableColumnHandlers(th, column);
// Render the header.
Context context = new Context(0, 0, header.getKey());
renderSortableHeader(th, context, header, isSorted, isSortAscending);
// End the table cell.
th.endTH();
}
开发者ID:guiguib,项目名称:yaph,代码行数:52,代码来源:PasswordView.java
示例4: buildPasswordCardRow
import com.google.gwt.dom.builder.shared.TableCellBuilder; //导入依赖的package包/类
/**
* Build a row.
*
* @param rowValue
* the contact info
* @param absRowIndex
* the absolute row index
* @param isFriend
* true if this is a subrow, false if a top level row
*/
private void buildPasswordCardRow(PasswordCard rowValue, int absRowIndex) {
// Calculate the row styles.
SelectionModel<? super PasswordCard> selectionModel = dataGrid.getSelectionModel();
boolean isSelected = (selectionModel == null || rowValue == null) ? false : selectionModel.isSelected(rowValue);
StringBuilder trClasses = new StringBuilder(rowStyle);
if (isSelected) {
trClasses.append(selectedRowStyle);
}
// Calculate the cell styles.
String cellStyles = cellStyle;
if (isSelected) {
cellStyles += selectedCellStyle;
}
TableRowBuilder row = startRow();
row.className(trClasses.toString());
// Title column.
TableCellBuilder td = row.startTD();
td.className(cellStyles);
td.style().outlineStyle(OutlineStyle.NONE).endStyle();
renderCell(td, createContext(1), titleColumn, rowValue);
td.endTD();
row.endTR();
}
开发者ID:guiguib,项目名称:yaph,代码行数:38,代码来源:PasswordView.java
示例5: buildDetailRow
import com.google.gwt.dom.builder.shared.TableCellBuilder; //导入依赖的package包/类
private void buildDetailRow(TraceInfo value, int absRowIndex, boolean isSelected, String trClasses) {
TableRowBuilder tr = startRow();
tr.className(trClasses);
tr.startTD().endTD();
TableCellBuilder td = tr.startTD().colSpan(cellTable.getColumnCount()-1);
DivBuilder div = td.startDiv().className(extenderCellStyle);
//div.style().outlineStyle(Style.OutlineStyle.NONE).endStyle();
this.renderCell(div, createContext(1), colDetails, value);
div.endDiv();
td.endTD();
tr.endTR();
}
开发者ID:jitlogic,项目名称:zico,代码行数:13,代码来源:TraceSearchTableBuilder.java
示例6: buildDetailRow
import com.google.gwt.dom.builder.shared.TableCellBuilder; //导入依赖的package包/类
private void buildDetailRow(TraceRecordInfo value, int absRowIndex, boolean isSelected, String trClasses) {
TableRowBuilder tr = startRow();
tr.className(trClasses);
tr.startTD().endTD();
TableCellBuilder td = tr.startTD().colSpan(cellTable.getColumnCount()-1);
DivBuilder div = td.startDiv().className(extenderCellStyle);
//div.style().outlineStyle(Style.OutlineStyle.NONE).endStyle();
this.renderCell(div, createContext(1), colDetails, value);
div.endDiv();
td.endTD();
tr.endTR();
}
开发者ID:jitlogic,项目名称:zico,代码行数:13,代码来源:TraceCallTableBuilder.java
示例7: buildHeader
import com.google.gwt.dom.builder.shared.TableCellBuilder; //导入依赖的package包/类
/**
* Renders the header of one column, with the given options.
*
* @param out the table row to build into
* @param header the {@link Header} to render
* @param column the column to associate with the header
* @param sortedColumn the column that is currently sorted
* @param isSortAscending true if the sorted column is in ascending order
* @param isFirst true if this the first column
* @param isLast true if this the last column
*/
private void buildHeader(TableRowBuilder out, Header<?> header, Column<ContactInfo, ?> column,
Column<?, ?> sortedColumn, boolean isSortAscending, boolean isFirst, boolean isLast) {
// Choose the classes to include with the element.
Style style = dataGrid.getResources().style();
boolean isSorted = (sortedColumn == column);
StringBuilder classesBuilder = new StringBuilder(style.header());
if (isFirst) {
classesBuilder.append(" " + style.firstColumnHeader());
}
if (isLast) {
classesBuilder.append(" " + style.lastColumnHeader());
}
if (column.isSortable()) {
classesBuilder.append(" " + style.sortableHeader());
}
if (isSorted) {
classesBuilder.append(" "
+ (isSortAscending ? style.sortedHeaderAscending() : style.sortedHeaderDescending()));
}
// Create the table cell.
TableCellBuilder th = out.startTH().className(classesBuilder.toString());
// Associate the cell with the column to enable sorting of the column.
enableColumnHandlers(th, column);
// Render the header.
Context context = new Context(0, 2, header.getKey());
renderSortableHeader(th, context, header, isSorted, isSortAscending);
// End the table cell.
th.endTH();
}
开发者ID:Peergos,项目名称:Peergos,代码行数:45,代码来源:CwCustomDataGrid.java
示例8: buildHeaderOrFooterImpl
import com.google.gwt.dom.builder.shared.TableCellBuilder; //导入依赖的package包/类
@Override
protected boolean buildHeaderOrFooterImpl() {
String footerStyle = dataGrid.getResources().style().footer();
// Calculate the age of all visible contacts.
String ageStr = "";
List<ContactInfo> items = dataGrid.getVisibleItems();
if (items.size() > 0) {
int totalAge = 0;
for (ContactInfo item : items) {
totalAge += item.getAge();
}
ageStr = "Avg: " + totalAge / items.size();
}
// Cells before age column.
TableRowBuilder tr = startRow();
tr.startTH().colSpan(4).className(footerStyle).endTH();
// Show the average age of all contacts.
TableCellBuilder th =
tr.startTH().className(footerStyle).align(
HasHorizontalAlignment.ALIGN_CENTER.getTextAlignString());
th.text(ageStr);
th.endTH();
// Cells after age column.
tr.startTH().colSpan(2).className(footerStyle).endTH();
tr.endTR();
return true;
}
开发者ID:Peergos,项目名称:Peergos,代码行数:33,代码来源:CwCustomDataGrid.java
示例9: tdGenerated
import com.google.gwt.dom.builder.shared.TableCellBuilder; //导入依赖的package包/类
protected void tdGenerated(TableCellBuilder aTd, Cell.Context aContext){
}
开发者ID:marat-gainullin,项目名称:platypus-js,代码行数:3,代码来源:ThemedCellTableBuilder.java
示例10: buildNodes
import com.google.gwt.dom.builder.shared.TableCellBuilder; //导入依赖的package包/类
protected void buildNodes(List<HeaderNode<T>> aHeaders, Map<Column<T, ?>, ColumnSortList.ColumnSortInfo> sortedColumns) {
// AbstractCellTable<T> table = getTable();
List<HeaderNode<T>> children = new ArrayList<>();
boolean isFooter = isBuildingFooter();
// Get the common style names.
String className = isBuildingFooter() ? ThemedGridResources.instance.cellTableStyle().cellTableFooter() : ThemedGridResources.instance.cellTableStyle().cellTableHeader();
String sortableStyle = ThemedGridResources.instance.cellTableStyle().cellTableSortableHeader();
String sortedAscStyle = ThemedGridResources.instance.cellTableStyle().cellTableSortedHeaderAscending();
String sortedDescStyle = ThemedGridResources.instance.cellTableStyle().cellTableSortedHeaderDescending();
TableRowBuilder tr = startRow();
// Loop through all column header nodes.
for (int i = 0; i < aHeaders.size(); i++) {
HeaderNode<T> headerNode = aHeaders.get(i);
children.addAll(headerNode.getChildren());
Header<?> headerOrFooter = headerNode.getHeader();
Column<T, ?> column = null;
if (headerOrFooter instanceof HasColumn<?>)
column = ((HasColumn<T>) headerOrFooter).getColumn();
boolean isSortable = !isFooter && column != null && column.isSortable();
ColumnSortList.ColumnSortInfo sortedInfo = sortedColumns.get(column);
boolean isSorted = sortedInfo != null;
StringBuilder classesBuilder = new StringBuilder(className);
boolean isSortAscending = isSortable && sortedInfo != null ? sortedInfo.isAscending() : false;
if (isSortable) {
if (classesBuilder.length() > 0) {
classesBuilder.append(" ");
}
classesBuilder.append(sortableStyle);
if (isSorted) {
if (classesBuilder.length() > 0) {
classesBuilder.append(" ");
}
classesBuilder.append(isSortAscending ? sortedAscStyle : sortedDescStyle);
}
}
// Render the header or footer.
TableCellBuilder th = tr.startTH();
if (headerNode.getDepthRemainder() > 0)
th.rowSpan(headerNode.getDepthRemainder() + 1);
if (headerNode.getLeavesCount() > 1)
th.colSpan(headerNode.getLeavesCount());
th.className(classesBuilder.toString());
StylesBuilder thStyles = th.style();
if (headerNode.getBackground() != null) {
thStyles.trustedBackgroundColor(headerNode.getBackground().toStyled());
}
if (headerNode.getForeground() != null) {
thStyles.trustedColor(headerNode.getForeground().toStyled());
}
if (headerNode.getFont() != null) {
thStyles.trustedProperty("font-family", headerNode.getFont().getFamily());
thStyles.fontSize(headerNode.getFont().getSize(), Style.Unit.PX);
thStyles.fontStyle(headerNode.getFont().isItalic() ? FontStyle.ITALIC : FontStyle.NORMAL);
thStyles.fontWeight(headerNode.getFont().isBold() ? FontWeight.BOLD : FontWeight.NORMAL);
}
if (headerOrFooter != null) {
appendExtraStyles(headerOrFooter, classesBuilder);
if (column != null) {
enableColumnHandlers(th, column);
}
// Build the header.
Cell.Context context = new Cell.Context(0, i, headerOrFooter.getKey());
// Add div element with aria button role
if (isSortable) {
// TODO: Figure out aria-label and translation
// of label text
th.attribute("role", "button");
th.tabIndex(-1);
}
renderSortableHeader(th, context, headerOrFooter, isSorted, isSortAscending);
}
th.endTH();
}
// End the row.
tr.endTR();
if (!children.isEmpty()) {
buildNodes(children, sortedColumns);
}
}
开发者ID:marat-gainullin,项目名称:platypus-js,代码行数:80,代码来源:ThemedHeaderOrFooterBuilder.java
示例11: buildStandardRow
import com.google.gwt.dom.builder.shared.TableCellBuilder; //导入依赖的package包/类
private void buildStandardRow(TraceInfo rowValue, int absRowIndex, boolean isSelected, String trClasses) {
//boolean isEven = absRowIndex % 2 == 0;
// Build the row.
TableRowBuilder tr = startRow();
tr.className(trClasses);
// Build the columns.
int columnCount = cellTable.getColumnCount();
for (int curColumn = 0; curColumn < columnCount; curColumn++) {
Column<TraceInfo, ?> column = cellTable.getColumn(curColumn);
// Create the cell styles.
StringBuilder tdClasses = new StringBuilder(cellStyle);
tdClasses.append(evenCellStyle);
if (curColumn == 0) {
tdClasses.append(firstColumnStyle);
}
if (isSelected) {
tdClasses.append(selectedCellStyle);
}
// The first and last column could be the same column.
if (curColumn == columnCount - 1) {
tdClasses.append(lastColumnStyle);
}
// Add class names specific to the cell.
Cell.Context context = new Cell.Context(absRowIndex, curColumn, cellTable.getValueKey(rowValue));
String cellStyles = column.getCellStyleNames(context, rowValue);
if (cellStyles != null) {
tdClasses.append(" " + cellStyles);
}
// Build the cell.
HasHorizontalAlignment.HorizontalAlignmentConstant hAlign = column.getHorizontalAlignment();
HasVerticalAlignment.VerticalAlignmentConstant vAlign = column.getVerticalAlignment();
TableCellBuilder td = tr.startTD();
td.className(tdClasses.toString());
if (hAlign != null) {
td.align(hAlign.getTextAlignString());
}
if (vAlign != null) {
td.vAlign(vAlign.getVerticalAlignString());
}
// Add the inner div.
DivBuilder div = td.startDiv();
div.style().outlineStyle(Style.OutlineStyle.NONE).height(14, Style.Unit.PX).endStyle();
// Render the cell into the div.
renderCell(div, context, column, rowValue);
// End the cell.
div.endDiv();
td.endTD();
}
// End the row.
tr.endTR();
}
开发者ID:jitlogic,项目名称:zico,代码行数:61,代码来源:TraceSearchTableBuilder.java
示例12: buildStandardRow
import com.google.gwt.dom.builder.shared.TableCellBuilder; //导入依赖的package包/类
private void buildStandardRow(TraceRecordInfo rowValue, int absRowIndex, boolean isSelected, String trClasses) {
//boolean isEven = absRowIndex % 2 == 0;
// Build the row.
TableRowBuilder tr = startRow();
tr.className(trClasses);
// Build the columns.
int columnCount = cellTable.getColumnCount();
for (int curColumn = 0; curColumn < columnCount; curColumn++) {
Column<TraceRecordInfo, ?> column = cellTable.getColumn(curColumn);
// Create the cell styles.
StringBuilder tdClasses = new StringBuilder(cellStyle);
tdClasses.append(evenCellStyle);
if (curColumn == 0) {
tdClasses.append(firstColumnStyle);
}
if (isSelected) {
tdClasses.append(selectedCellStyle);
}
// The first and last column could be the same column.
if (curColumn == columnCount - 1) {
tdClasses.append(lastColumnStyle);
}
// Add class names specific to the cell.
Cell.Context context = new Cell.Context(absRowIndex, curColumn, cellTable.getValueKey(rowValue));
String cellStyles = column.getCellStyleNames(context, rowValue);
if (cellStyles != null) {
tdClasses.append(" " + cellStyles);
}
// Build the cell.
HasHorizontalAlignment.HorizontalAlignmentConstant hAlign = column.getHorizontalAlignment();
HasVerticalAlignment.VerticalAlignmentConstant vAlign = column.getVerticalAlignment();
TableCellBuilder td = tr.startTD();
td.className(tdClasses.toString());
if (hAlign != null) {
td.align(hAlign.getTextAlignString());
}
if (vAlign != null) {
td.vAlign(vAlign.getVerticalAlignString());
}
// Add the inner div.
DivBuilder div = td.startDiv();
div.style().outlineStyle(Style.OutlineStyle.NONE).height(14, Style.Unit.PX).endStyle();
// Render the cell into the div.
renderCell(div, context, column, rowValue);
// End the cell.
div.endDiv();
td.endTD();
}
// End the row.
tr.endTR();
}
开发者ID:jitlogic,项目名称:zico,代码行数:61,代码来源:TraceCallTableBuilder.java
注:本文中的com.google.gwt.dom.builder.shared.TableCellBuilder类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论