// Path: android/android_ESVMTrainer/src/edu/cmu/cs/cloudlet/application/esvmtrainer/util/FileDialog.java
// public interface FireHandler<L> {
// 	void fireEvent(L listener);
// }


import java.io.File;
import java.io.FilenameFilter;
import java.util.ArrayList;
import java.util.List;
import edu.cmu.cs.cloudlet.application.esvmtrainer.util.ListenerList.FireHandler;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.os.Environment;
import android.util.Log;

	public void addFileListener(FileSelectedListener listener) {
		fileListenerList.add(listener);
	}

	public void removeFileListener(FileSelectedListener listener) {
		fileListenerList.remove(listener);
	}

	public void setSelectDirectoryOption(boolean selectDirectoryOption) {
		this.selectDirectoryOption = selectDirectoryOption;
	}

	public void addDirectoryListener(DirectorySelectedListener listener) {
		dirListenerList.add(listener);
	}

	public void removeDirectoryListener(DirectorySelectedListener listener) {
		dirListenerList.remove(listener);
	}

	/**
	 * Show file dialog
	 */
	public void showDialog() {
		createFileDialog().show();
	}

	private void fireFileSelectedEvent(final File file) {
		fileListenerList
// Path: android/android_ESVMTrainer/src/edu/cmu/cs/cloudlet/application/esvmtrainer/util/FileDialog.java
// public interface FireHandler<L> {
// 	void fireEvent(L listener);
// }


// Path: android/android_ESVMTrainer/src/edu/cmu/cs/cloudlet/application/esvmtrainer/util/FileDialog.java
import java.io.File;
import java.io.FilenameFilter;
import java.util.ArrayList;
import java.util.List;
import edu.cmu.cs.cloudlet.application.esvmtrainer.util.ListenerList.FireHandler;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.os.Environment;
import android.util.Log;


	public void addFileListener(FileSelectedListener listener) {
		fileListenerList.add(listener);
	}

	public void removeFileListener(FileSelectedListener listener) {
		fileListenerList.remove(listener);
	}

	public void setSelectDirectoryOption(boolean selectDirectoryOption) {
		this.selectDirectoryOption = selectDirectoryOption;
	}

	public void addDirectoryListener(DirectorySelectedListener listener) {
		dirListenerList.add(listener);
	}

	public void removeDirectoryListener(DirectorySelectedListener listener) {
		dirListenerList.remove(listener);
	}

	/**
	 * Show file dialog
	 */
	public void showDialog() {
		createFileDialog().show();
	}

	private void fireFileSelectedEvent(final File file) {
		fileListenerList
				.fireEvent(new FireHandler<FileDialog.FileSelectedListener>() {