// Path: src/com/akjava/gwt/html5/client/file/File.java
// public class File extends Blob{
// 
// 	protected File(){}
// 	
// 	public  final native String getFileName()/*-{
//     return this.name;
//   }-*/;
// 	
// 	public  final native int getFileSize()/*-{
//     return this.size;
//   }-*/;
// 	
// 
// 	
// 	public  final native String getFileType()/*-{
//     return this.type;
//   }-*/;
// 	
// 	public  final native Blob slice(int start,int length)/*-{
//     return this.slice(start,length);
//   }-*/;
// }
// 
// Path: src/com/akjava/gwt/html5/client/file/FileHandler.java
// public interface FileHandler {
// 	public void onLoad();
// }


import com.akjava.gwt.html5.client.file.File;
import com.akjava.gwt.html5.client.file.FileHandler;
import com.akjava.gwt.html5.client.file.FileReader;
import com.google.common.base.Optional;
import com.google.common.base.Predicate;
import com.google.gwt.dom.client.Style.Unit;

package com.akjava.gwt.html5.client.file.ui;


/*
 * this is usefull when do nothing drop rootPanel
 */
public abstract class DropDockDataUrlRootPanel extends DropDockRootPanel{
	public DropDockDataUrlRootPanel(Unit unit,boolean addRootLayoutPanel) {
		super(unit,addRootLayoutPanel);
	}
	
	public DropDockDataUrlRootPanel() {
		super(Unit.PX,false);
	}

	private Predicate<File> filePredicate;
	
	public Predicate<File> getFilePredicate() {
		return filePredicate;
	}

	public void setFilePredicate(Predicate<File> filePredicate) {
		this.filePredicate = filePredicate;
	}

	@Override
	public void callback(final File file, final String parent) {
		if(file==null){
			return;
		}
		if(filePredicate!=null && !filePredicate.apply(file)){
			return;
		}
		
	
		
		final FileReader reader = FileReader.createFileReader();

// Path: src/com/akjava/gwt/html5/client/file/File.java
// public class File extends Blob{
// 
// 	protected File(){}
// 	
// 	public  final native String getFileName()/*-{
//     return this.name;
//   }-*/;
// 	
// 	public  final native int getFileSize()/*-{
//     return this.size;
//   }-*/;
// 	
// 
// 	
// 	public  final native String getFileType()/*-{
//     return this.type;
//   }-*/;
// 	
// 	public  final native Blob slice(int start,int length)/*-{
//     return this.slice(start,length);
//   }-*/;
// }
// 
// Path: src/com/akjava/gwt/html5/client/file/FileHandler.java
// public interface FileHandler {
// 	public void onLoad();
// }


// Path: src/com/akjava/gwt/html5/client/file/ui/DropDockDataUrlRootPanel.java
import com.akjava.gwt.html5.client.file.File;
import com.akjava.gwt.html5.client.file.FileHandler;
import com.akjava.gwt.html5.client.file.FileReader;
import com.google.common.base.Optional;
import com.google.common.base.Predicate;
import com.google.gwt.dom.client.Style.Unit;

package com.akjava.gwt.html5.client.file.ui;


/*
 * this is usefull when do nothing drop rootPanel
 */
public abstract class DropDockDataUrlRootPanel extends DropDockRootPanel{
	public DropDockDataUrlRootPanel(Unit unit,boolean addRootLayoutPanel) {
		super(unit,addRootLayoutPanel);
	}
	
	public DropDockDataUrlRootPanel() {
		super(Unit.PX,false);
	}

	private Predicate<File> filePredicate;
	
	public Predicate<File> getFilePredicate() {
		return filePredicate;
	}

	public void setFilePredicate(Predicate<File> filePredicate) {
		this.filePredicate = filePredicate;
	}

	@Override
	public void callback(final File file, final String parent) {
		if(file==null){
			return;
		}
		if(filePredicate!=null && !filePredicate.apply(file)){
			return;
		}
		
	
		
		final FileReader reader = FileReader.createFileReader();

		reader.setOnLoad(new FileHandler() {
