Example usage for com.google.gwt.dom.client Element getTabIndex

List of usage examples for com.google.gwt.dom.client Element getTabIndex

Introduction

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

Prototype

@Override
    public int getTabIndex() 

Source Link

Usage

From source file:gwt.material.design.client.ui.table.CellBasedWidgetImpl.java

License:Apache License

/**
 * Check if an element is focusable. If an element is focusable, the cell
 * widget should not steal focus from it.
 *
 * @param elem the element//from  w  w w . j a  v a 2  s . com
 * @return true if the element is focusable, false if not
 */
public boolean isFocusable(Element elem) {
    return focusableTypes.contains(elem.getTagName().toLowerCase(Locale.ROOT)) || elem.getTabIndex() >= 0;
}

From source file:org.rstudio.studio.client.workbench.views.history.view.HistoryPane.java

License:Open Source License

private void setVisible(Widget widget, Element focusTarget, boolean visible) {
    //mainPanel_.getWidgetContainerElement(widget).getStyle().setDisplay(
    //      visible ? Display.BLOCK : Display.NONE);
    if (visible) {
        if (focusTarget.getTabIndex() != 0) {
            focusTarget.setTabIndex(0);// w  ww  .ja va2s.com
            mainPanel_.setWidgetLeftRight(widget, 0, Unit.PX, 0, Unit.PX);
        }
    } else {
        if (focusTarget.getTabIndex() != -1) {
            focusTarget.setTabIndex(-1);
            if (DomUtils.hasFocus(focusTarget))
                focusTarget.blur();
            mainPanel_.setWidgetLeftRight(widget, -5000, Unit.PX, 5000, Unit.PX);
        }
    }
    mainPanel_.forceLayout();
}