FileDialog

Introduction

A Programmatic-only dialog for interacting with the File System. Not implemented in GWT as there's no logical peer on the browser.

Properties

None.

Methods

showOpenDialog()
showOpenDialog(Object f) - open with the passed-in file shown.
showSaveDialog()
showSaveDialog(Object f)
getFile()
getFiles()
setSelectionMode(SEL_TYPE type) - SINGLE, MULTIPLE
setViewType(VIEW_TYPE type) - FILES_DIRECTORIES, DIRECTORIES
setModalParent(Object parent) - parent dialog/window to parent too.

Sample Usage

XulFileDialog fc = (XulFileDialog) document.createElement("filedialog");
fc.setModalParent(((XulDialog)document.getElementById("parent_id")).getRootObject());
    
RETURN_CODE retVal = fc.showSaveDialog();
File selectedFile = null;
if (retVal == RETURN_CODE.OK) {
      File selectedFile = (File) fc.getFile();
}