本文整理汇总了Java中com.google.gwt.dom.client.TableCellElement.getCellIndex方法的典型用法代码示例。如果您正苦于以下问题:Java TableCellElement.getCellIndex方法的具体用法?Java TableCellElement.getCellIndex怎么用?Java TableCellElement.getCellIndex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.dom.client.TableCellElement
的用法示例。
在下文中一共展示了TableCellElement.getCellIndex方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onBrowserEvent2
import com.google.gwt.dom.client.TableCellElement; //导入方法依赖的package包/类
@Override
protected void onBrowserEvent2(Event event) {
if (hasFilterHeaders()) {
EventTarget eventTarget = event.getEventTarget();
if (!Element.is(eventTarget)) {
return;
}
final Element target = event.getEventTarget().cast();
TableSectionElement thead = getTableHeadElement();
TableSectionElement targetTableSection = null;
TableCellElement targetTableCell = null;
Element headerParent = null;
Element maybeTableCell = null;
Element cur = target;
while (cur != null && targetTableSection == null) {
if (cur == thead) {
targetTableSection = cur.cast();
if (maybeTableCell != null) {
targetTableCell = maybeTableCell.cast();
break;
}
}
String tagName = cur.getTagName();
if (TableCellElement.TAG_TD.equalsIgnoreCase(tagName)
|| TableCellElement.TAG_TH.equalsIgnoreCase(tagName)) {
maybeTableCell = cur;
}
if (headerParent == null && getHeaderBuilder().isHeader(cur)) {
headerParent = cur;
}
cur = cur.getParentElement();
}
if (targetTableCell != null) {
String eventType = event.getType();
TableRowElement targetTableRow = targetTableCell.getParentElement().cast();
int col = targetTableCell.getCellIndex();
if (targetTableSection == thead) {
if (headerParent != null) {
Header<?> header =
getHeaderBuilder().getHeader(headerParent);
if (header != null) {
int headerIndex = getHeaderBuilder().getRowIndex(targetTableRow);
if (header instanceof StringFilterHeader) {
if (StringFilterHeader.isFilterFocusEvent(eventType)) {
filterFocusedCellColumn = col;
filterFocusedCellRow = headerIndex;
} else {
filterFocusedCellColumn = -1;
filterFocusedCellRow = -1;
}
}
}
}
}
}
}
super.onBrowserEvent2(event);
}