Search in sources :

Example 1 with FileList

use of com.gargoylesoftware.htmlunit.javascript.host.file.FileList in project htmlunit by HtmlUnit.

the class HTMLInputElement method getFiles.

/**
 * Returns the {@code files} property.
 * @return the {@code files} property
 */
@JsxGetter
public Object getFiles() {
    final HtmlInput htmlInput = getDomNodeOrDie();
    if (htmlInput instanceof HtmlFileInput) {
        final FileList list = new FileList(((HtmlFileInput) htmlInput).getFiles());
        list.setParentScope(getParentScope());
        list.setPrototype(getPrototype(list.getClass()));
        return list;
    }
    if (getBrowserVersion().hasFeature(HTMLINPUT_FILES_UNDEFINED)) {
        return Undefined.instance;
    }
    return null;
}
Also used : FileList(com.gargoylesoftware.htmlunit.javascript.host.file.FileList) HtmlFileInput(com.gargoylesoftware.htmlunit.html.HtmlFileInput) HtmlInput(com.gargoylesoftware.htmlunit.html.HtmlInput) JsxGetter(com.gargoylesoftware.htmlunit.javascript.configuration.JsxGetter)

Aggregations

HtmlFileInput (com.gargoylesoftware.htmlunit.html.HtmlFileInput)1 HtmlInput (com.gargoylesoftware.htmlunit.html.HtmlInput)1 JsxGetter (com.gargoylesoftware.htmlunit.javascript.configuration.JsxGetter)1 FileList (com.gargoylesoftware.htmlunit.javascript.host.file.FileList)1