本文整理了Java中com.google.gwt.user.cellview.client.Header
类的一些代码示例,展示了Header
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Header
类的具体详情如下:
包路径:com.google.gwt.user.cellview.client.Header
类名称:Header
[英]A table column header or footer.
[中]表列的页眉或页脚。
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Get the key for the header value. By default, the key is the same as the
* value. Override this method to return a custom key.
*
* @return the key associated with the value
*/
public Object getKey() {
return getValue();
}
代码示例来源:origin: com.google.gwt/gwt-servlet
Set<String> headerEvents = header.getCell().getConsumedEvents();
if (headerEvents != null) {
consumedEvents.addAll(headerEvents);
Set<String> footerEvents = footer.getCell().getConsumedEvents();
if (footerEvents != null) {
consumedEvents.addAll(footerEvents);
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Append the extra style names for the header.
* @param header the header that may contain extra styles, it can be null
* @param classesBuilder the string builder for the TD classes
*/
private <H> void appendExtraStyles(Header<H> header, StringBuilder classesBuilder) {
if (header == null) {
return;
}
String headerStyleNames = header.getHeaderStyleNames();
if (headerStyleNames != null) {
classesBuilder.append(" ");
classesBuilder.append(headerStyleNames);
}
}
}
代码示例来源:origin: com.google.gwt/gwt-servlet
int headerIndex = isHeader ? headerBuilder.getRowIndex(targetTableRow) :
footerBuilder.getRowIndex(targetTableRow);
Context context = new Context(headerIndex, col, header.getKey());
if (cellConsumesEventType(header.getCell(), eventType)) {
header.onBrowserEvent(context, headerParent, event);
shouldSortColumn = header.onPreviewColumnSortEvent(context, headerParent, event);
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Renders a given Header into a given ElementBuilderBase. This method ensures
* that the CellTable widget will handle events events originating in the
* Header.
*
* @param <H> the data type of the header
* @param out the {@link ElementBuilderBase} to render into. The builder
* should be a child element of a row returned by {@link #startRow}
* and must be in a state that allows both attributes and elements to
* be added
* @param context the {@link Context} of the header being rendered
* @param header the {@link Header} to render
*/
protected final <H> void renderHeader(ElementBuilderBase<?> out, Context context, Header<H> header) {
// Generate a unique ID for the header.
String headerId = idToHeaderMap.getKey(header);
if (headerId == null) {
headerId = "header-" + Document.get().createUniqueId();
idToHeaderMap.put(headerId, header);
}
out.attribute(HEADER_ATTRIBUTE, headerId);
// Render the cell into the builder.
SafeHtmlBuilder sb = new SafeHtmlBuilder();
header.render(context, sb);
out.html(sb.toSafeHtml());
}
代码示例来源:origin: stephenh/tessell
/** Instead of passing the event to the cell directly, give the header a chance to run it's event logic. */
@Override
public void onBrowserEvent(Context context, Element parent, X value, NativeEvent event, ValueUpdater<X> valueUpdater) {
header.asHeader().onBrowserEvent(context, parent, event);
}
};
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Build the table header for the column.
*/
private void buildTableHeader(TableRowBuilder tr, Column<T, ?> column, Header<?> header,
boolean isSortable, boolean isSorted, boolean isSortAscending, StringBuilder classesBuilder,
String sortableStyle, String sortedStyle, int prevColspan, int curColumn) {
if (isSortable) {
classesBuilder.append(sortableStyle);
}
if (isSorted) {
classesBuilder.append(sortedStyle);
}
appendExtraStyles(header, classesBuilder);
TableCellBuilder th = tr.startTH().colSpan(prevColspan).className(classesBuilder.toString());
enableColumnHandlers(th, column);
if (header != null) {
// Build the header.
Context context = new Context(0, curColumn - prevColspan, header.getKey());
if (isSortable) {
// TODO: Figure out aria-label and translation of label text
th.attribute("role", "button");
th.tabIndex(-1);
}
renderSortableHeader(th, context, header, isSorted, isSortAscending);
}
th.endTH();
}
代码示例来源:origin: bedatadriven/activityinfo
private void onColumnSelectionChanged() {
// ensure the column is scrolled into view
int newColumnIndex = columnSelectionModel.getSelectedObject().getIndex();
scrollColumnIntoView(newColumnIndex);
// clear the selection styles from the old column
if (lastSelectedColumn != -1) {
removeHeaderStyleName(lastSelectedColumn, ColumnMappingStyles.INSTANCE.selected());
this.removeColumnStyleName(lastSelectedColumn, ColumnMappingStyles.INSTANCE.selected());
}
// add the bg to the new selection
this.getHeader(newColumnIndex).setHeaderStyleNames(ColumnMappingStyles.INSTANCE.selected());
this.addColumnStyleName(newColumnIndex, ColumnMappingStyles.INSTANCE.selected());
lastSelectedColumn = newColumnIndex;
}
代码示例来源:origin: kiegroup/jbpm-wb
selectPageHeader.setUpdater(value -> {
if (value) {
extendedPagedTable.selectAllItems();
selectPageHeader.setHeaderStyleNames("kie-datatable-select");
代码示例来源:origin: stephenh/tessell
@Override
public void setUpdater(final ValueUpdater<C> updater) {
// still do the super call for the base class onBrowserEvent method
super.setUpdater(updater);
this.updater = updater;
}
代码示例来源:origin: net.wetheinter/gwt-user
int headerIndex = isHeader ? headerBuilder.getRowIndex(targetTableRow) :
footerBuilder.getRowIndex(targetTableRow);
Context context = new Context(headerIndex, col, header.getKey());
if (cellConsumesEventType(header.getCell(), eventType)) {
header.onBrowserEvent(context, headerParent, event);
shouldSortColumn = header.onPreviewColumnSortEvent(context, headerParent, event);
代码示例来源:origin: stephenh/tessell
/** Instead of rendering the cell directly, give the header a chance to run it's render logic. */
@Override
public void render(Cell.Context context, X value, SafeHtmlBuilder sb) {
header.asHeader().render(context, sb);
}
代码示例来源:origin: oVirt/ovirt-engine
/**
* Override to inject the tooltip content into the cell.
*/
@Override
public void onBrowserEvent(Context context, Element elem, NativeEvent event) {
super.onBrowserEvent(context, elem, event);
if (BrowserEvents.CONTEXTMENU.equals(event.getType()) && contextMenuHandler != null) {
contextMenuHandler.onContextMenu(event);
}
}
代码示例来源:origin: com.vaadin.external.gwt/gwt-user
if (prevHeader != null) {
Context context = new Context(0, curColumn - prevColspan, prevHeader.getKey());
enableColumnHandlers(th, column);
if (prevHeader != null) {
Context context = new Context(0, curColumn - prevColspan, prevHeader.getKey());
renderSortableHeader(th, context, prevHeader, isSorted, isSortAscending);
代码示例来源:origin: kiegroup/jbpm-wb
protected ColumnMeta<T> initActionsColumn() {
final ConditionalKebabActionCell<T> cell = conditionalKebabActionCell.get();
cell.setActions(getConditionalActions());
Column<T, T> actionsColumn = new Column<T, T>(cell) {
@Override
public T getValue(T object) {
return object;
}
};
actionsColumn.setDataStoreName(COL_ID_ACTIONS);
actionsColumn.setCellStyleNames("kie-table-view-pf-actions text-center");
Header header = new TextHeader(Constants.INSTANCE.Actions());
header.setHeaderStyleNames("text-center");
final ColumnMeta<T> actionsColMeta = new ColumnMeta<T>(actionsColumn,
"");
actionsColMeta.setHeader(header);
actionsColMeta.setVisibleIndex(false);
return actionsColMeta;
}
代码示例来源:origin: com.vaadin.external.gwt/gwt-user
int headerIndex = isHeader ? headerBuilder.getRowIndex(targetTableRow) :
footerBuilder.getRowIndex(targetTableRow);
Context context = new Context(headerIndex, col, header.getKey());
if (cellConsumesEventType(header.getCell(), eventType)) {
header.onBrowserEvent(context, headerParent, event);
shouldSortColumn = header.onPreviewColumnSortEvent(context, headerParent, event);
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Handle a browser event that took place within the header.
*
* @param context the context of the header
* @param elem the parent Element
* @param event the native browser event
*/
public void onBrowserEvent(Context context, Element elem, NativeEvent event) {
cell.onBrowserEvent(context, elem, getValue(), event, updater);
}
代码示例来源:origin: com.vaadin.external.gwt/gwt-user
/**
* Renders a given Header into a given ElementBuilderBase. This method ensures
* that the CellTable widget will handle events events originating in the
* Header.
*
* @param <H> the data type of the header
* @param out the {@link ElementBuilderBase} to render into. The builder
* should be a child element of a row returned by {@link #startRow}
* and must be in a state that allows both attributes and elements to
* be added
* @param context the {@link Context} of the header being rendered
* @param header the {@link Header} to render
*/
protected final <H> void renderHeader(ElementBuilderBase<?> out, Context context, Header<H> header) {
// Generate a unique ID for the header.
String headerId = idToHeaderMap.getKey(header);
if (headerId == null) {
headerId = "header-" + Document.get().createUniqueId();
idToHeaderMap.put(headerId, header);
}
out.attribute(HEADER_ATTRIBUTE, headerId);
// Render the cell into the builder.
SafeHtmlBuilder sb = new SafeHtmlBuilder();
header.render(context, sb);
out.html(sb.toSafeHtml());
}
代码示例来源:origin: oVirt/ovirt-engine
@Override
public Cell<H> getCell() {
return (Cell<H>) super.getCell();
}
代码示例来源:origin: net.wetheinter/gwt-user
/**
* Append the extra style names for the header.
* @param header the header that may contain extra styles, it can be null
* @param classesBuilder the string builder for the TD classes
*/
private <H> void appendExtraStyles(Header<H> header, StringBuilder classesBuilder) {
if (header == null) {
return;
}
String headerStyleNames = header.getHeaderStyleNames();
if (headerStyleNames != null) {
classesBuilder.append(" ");
classesBuilder.append(headerStyleNames);
}
}
}
内容来源于网络,如有侵权,请联系作者删除!