当前位置: 首页>>代码示例>>Java>>正文


Java TableCellElement.getCellIndex方法代码示例

本文整理汇总了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);
}
 
开发者ID:kaaproject,项目名称:avro-ui,代码行数:64,代码来源:AvroUiDataGrid.java


注:本文中的com.google.gwt.dom.client.TableCellElement.getCellIndex方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。