/** * Get the keyboard selected element from the selected table cell. * * @return the keyboard selected element, or null if there is none */ private Element getKeyboardSelectedElement(TableCellElement td) { if (td == null) { return null; } /* * The TD itself is a cell parent, which means its internal structure * (including the tabIndex that we set) could be modified by its Cell. We * return the TD to be safe. */ if (tableBuilder.isColumn(td)) { return td; } /* * The default table builder adds a focusable div to the table cell because * TDs aren't focusable in all browsers. If the user defines a custom table * builder with a different structure, we must assume the keyboard selected * element is the TD itself. */ Element firstChild = td.getFirstChildElement(); if (firstChild != null && td.getChildCount() == 1 && "div".equalsIgnoreCase(firstChild.getTagName())) { return firstChild; } return td; }
/** * Get the keyboard selected element from the selected table cell. * * @return the keyboard selected element, or null if there is none */ private Element getKeyboardSelectedElement(TableCellElement td) { if (td == null) { return null; } /* * The TD itself is a cell parent, which means its internal structure * (including the tabIndex that we set) could be modified by its Cell. We * return the TD to be safe. */ if (tableBuilder.isColumn(td)) { return td; } /* * The default table builder adds a focusable div to the table cell because * TDs aren't focusable in all browsers. If the user defines a custom table * builder with a different structure, we must assume the keyboard selected * element is the TD itself. */ Element firstChild = td.getFirstChildElement(); if (firstChild != null && td.getChildCount() == 1 && "div".equalsIgnoreCase(firstChild.getTagName())) { return firstChild; } return td; }
/** * Get the keyboard selected element from the selected table cell. * * @return the keyboard selected element, or null if there is none */ private Element getKeyboardSelectedElement(TableCellElement td) { if (td == null) { return null; } /* * The TD itself is a cell parent, which means its internal structure * (including the tabIndex that we set) could be modified by its Cell. We * return the TD to be safe. */ if (tableBuilder.isColumn(td)) { return td; } /* * The default table builder adds a focusable div to the table cell because * TDs aren't focusable in all browsers. If the user defines a custom table * builder with a different structure, we must assume the keyboard selected * element is the TD itself. */ Element firstChild = td.getFirstChildElement(); if (firstChild != null && td.getChildCount() == 1 && "div".equalsIgnoreCase(firstChild.getTagName())) { return firstChild; } return td; }
private void ensureTdOk() { TableCellElement td = getTd(); if( td == null ) return; int count = td.getChildCount(); if( count <= 0 ) { SpanElement treeView = Document.get().createSpanElement(); td.appendChild( treeView ); DOM.sinkEvents( treeView, Event.ONCLICK ); DOM.setEventListener( treeView, this ); } if( count <= 1 ) { SpanElement content = Document.get().createSpanElement(); td.appendChild( content ); } }
private void ensureTdOk() { TableCellElement td = getTd(); if( td == null ) return; int count = td.getChildCount(); if( count <= 0 ) { SpanElement treeView = Document.get().createSpanElement(); td.appendChild( treeView ); DOM.sinkEvents( treeView, Event.ONCLICK ); DOM.setEventListener( treeView, this ); } if( count <= 1 ) { SpanElement content = Document.get().createSpanElement(); td.appendChild( content ); } }