All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.googlecode.gwt.test.internal.patchers.dom.TableSectionElementPatcher Maven / Gradle / Ivy

There is a newer version: 0.63
Show newest version
package com.googlecode.gwt.test.internal.patchers.dom;

import com.google.gwt.dom.client.NodeList;
import com.google.gwt.dom.client.TableRowElement;
import com.google.gwt.dom.client.TableSectionElement;
import com.googlecode.gwt.test.patchers.PatchClass;
import com.googlecode.gwt.test.patchers.PatchMethod;

@PatchClass(TableSectionElement.class)
class TableSectionElementPatcher {

    @PatchMethod
    static void deleteRow(TableSectionElement e, int index) {
        NodeList rows = e.getRows();

        if (rows.getLength() < 1) {
            return;
        }

        if (index == -1) {
            index = rows.getLength() - 1;
        }

        TableRowElement rowToDelete = rows.getItem(index);
        e.removeChild(rowToDelete);
    }

    @PatchMethod
    static NodeList getRows(TableSectionElement e) {
        // deep search
        return e.getElementsByTagName("tr").cast();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy