List of usage examples for com.google.gwt.dom.client TableCellElement getOffsetHeight
@Override
public int getOffsetHeight()
From source file:org.activityinfo.ui.client.component.table.filter.FilterCellAction.java
License:Open Source License
@Override public void execute(Object object) { final CellTable<Projection> grid = table.getTable(); final TableSectionElement tableHeadElement = grid.getTableHeadElement(); final FilterPanel filterPanel = new FilterPanel(table, column); filterPanel.show(new PopupPanel.PositionCallback() { @Override//ww w . j a v a 2 s. c o m public void setPosition(int offsetWidth, int offsetHeight) { // get second row (first row is header action row) final TableRowElement row = tableHeadElement.getRows().getItem(1); final int columnIndex = grid.getColumnIndex(column); final TableCellElement cellElement = row.getCells().getItem(columnIndex); final int absoluteTop = cellElement.getAbsoluteTop(); final int absoluteLeft = cellElement.getAbsoluteLeft(); final int height = cellElement.getOffsetHeight(); final int width = cellElement.getOffsetWidth(); filterPanel.getPopup().setWidth(width + "px"); filterPanel.getPopup().setPopupPosition(absoluteLeft, absoluteTop + height); } }); }
From source file:org.drools.guvnor.client.widgets.decoratedgrid.MergableGridWidget.java
License:Apache License
/** * Retrieve the extents of a cell// w w w .java2s. co m * * @param cv * The cell for which to retrieve the extents * @return */ CellSelectionDetail getSelectedCellExtents(CellValue<? extends Comparable<?>> cv) { if (cv == null) { throw new IllegalArgumentException("cv cannot be null"); } // Cells in hidden columns do not have extents if (!columns.get(cv.getCoordinate().getCol()).isVisible()) { return null; } Coordinate hc = cv.getHtmlCoordinate(); TableRowElement tre = tbody.getRows().getItem(hc.getRow()).<TableRowElement>cast(); TableCellElement tce = tre.getCells().getItem(hc.getCol()).<TableCellElement>cast(); int offsetX = tce.getOffsetLeft(); int offsetY = tce.getOffsetTop(); int w = tce.getOffsetWidth(); int h = tce.getOffsetHeight(); CellSelectionDetail e = new CellSelectionDetail(cv.getCoordinate(), offsetX, offsetY, h, w); return e; }