Example usage for com.google.gwt.core.client JsDate getMilliseconds

List of usage examples for com.google.gwt.core.client JsDate getMilliseconds

Introduction

In this page you can find the example usage for com.google.gwt.core.client JsDate getMilliseconds.

Prototype

public final native int getMilliseconds() ;

Source Link

Document

Returns the milliseconds, between 0 and 999.

Usage

From source file:org.cellang.clwt.commons.client.widget.impl.FileUrlDataEditorSupport.java

/**
 * see:http://www.html5rocks.com/en/tutorials/file/dndfiles/
 *///ww  w .  ja  v  a 2s .c  o m
protected void onChange(com.google.gwt.event.dom.client.ChangeEvent evt) {

    JsArray<FileRefJSO> flist = FileRefJSO.getFileList(this.input.getElement());//

    if (flist.length() > 1) {
        throw new UiException("multiple files is not supported");
    }
    if (flist.length() == 0) {
        this.setData(null, true);//
        return;// TODO null

    }
    FileRefJSO file = flist.get(0);
    if (file.getSize() > this.maxSize) {
        throw new UiException("not supported size:" + file.getSize() + ",max size:" + this.maxSize);
    }
    String name = file.getName();//
    JsDate jsd = file.getLastModifiedDate();

    long last = jsd == null ? 0L : (long) jsd.getMilliseconds();// TODO
    // int
    // to
    // long?
    final FileReaderJSO fr = FileReaderJSO.newInstance();

    fr.onLoadEnd(new Handler<JavaScriptObject>() {

        @Override
        public void handle(JavaScriptObject t) {
            FileUrlDataEditorSupport.this.onLoadEnd(fr, t);
        }
    }).readAsDataURL(file);
}