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

com.googlecode.gwt.test.internal.patchers.dom.NodeListPatcher 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.Node;
import com.google.gwt.dom.client.NodeList;
import com.googlecode.gwt.test.internal.utils.JsoUtils;
import com.googlecode.gwt.test.patchers.PatchClass;
import com.googlecode.gwt.test.patchers.PatchMethod;

import java.util.List;

@PatchClass(NodeList.class)
class NodeListPatcher {

    @PatchMethod
    static  T getItem(NodeList nodeList, int index) {
        List innerList = JsoUtils.getChildNodeInnerList(nodeList);
        if (innerList.size() <= index) {
            return null;
        } else {
            return innerList.get(index);
        }
    }

    @PatchMethod
    static  int getLength(NodeList nodeList) {
        List innerList = JsoUtils.getChildNodeInnerList(nodeList);
        return innerList.size();
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy