Example usage for com.google.gwt.dom.client TableCellElement focus

List of usage examples for com.google.gwt.dom.client TableCellElement focus

Introduction

In this page you can find the example usage for com.google.gwt.dom.client TableCellElement focus.

Prototype

@Override
    public void focus() 

Source Link

Usage

From source file:org.drools.guvnor.client.widgets.decoratedgrid.VerticalMergableGridWidget.java

License:Apache License

@Override
void selectCell(CellValue<? extends Comparable<?>> cell) {
    if (cell == null) {
        throw new IllegalArgumentException("cell cannot be null");
    }/*  w w  w.  ja  v  a 2 s  . com*/

    Coordinate hc = cell.getHtmlCoordinate();
    TableRowElement tre = tbody.getRows().getItem(hc.getRow()).<TableRowElement>cast();
    TableCellElement tce = tre.getCells().getItem(hc.getCol()).<TableCellElement>cast();

    //Cell selected style takes precedence
    String cellSelectedStyle = style.cellTableCellSelected();
    String cellOtherwiseStyle = style.cellTableCellOtherwise();
    String cellMultipleValuesStyle = style.cellTableCellMultipleValues();

    tce.removeClassName(cellMultipleValuesStyle);
    tce.removeClassName(cellOtherwiseStyle);
    tce.addClassName(cellSelectedStyle);
    tce.focus();
}

From source file:org.drools.guvnor.client.widgets.drools.decoratedgrid.AbstractVerticalMergableGridWidget.java

License:Apache License

@Override
void selectCell(CellValue<? extends Comparable<?>> cell) {
    if (cell == null) {
        throw new IllegalArgumentException("cell cannot be null");
    }/*w  w w  . ja v a2 s  .  c  om*/

    Coordinate hc = cell.getHtmlCoordinate();
    TableRowElement tre = tbody.getRows().getItem(hc.getRow()).<TableRowElement>cast();
    TableCellElement tce = tre.getCells().getItem(hc.getCol()).<TableCellElement>cast();

    //Cell selected style takes precedence
    String cellSelectedStyle = resources.cellTableCellSelected();
    String cellOtherwiseStyle = resources.cellTableCellOtherwise();
    String cellMultipleValuesStyle = resources.cellTableCellMultipleValues();

    tce.removeClassName(cellMultipleValuesStyle);
    tce.removeClassName(cellOtherwiseStyle);
    tce.addClassName(cellSelectedStyle);
    tce.focus();
}