2013-04-07 92 views
-1

我想創建一個文件瀏覽器,當用戶在我生成的屬性上點擊一個按鈕。 我使用下面的代碼,它獲取我工作區中的整個文件。 但是,我需要瀏覽我的所有電腦。創建文件瀏覽器

IFile[] files = WorkspaceResourceDialog.openFileSelection(null, "File selection", "Please select any file", false, null, null); 

任何想法!

回答

0
 ResourceDialog resourceDialog= 
    new ResourceDialog(Display.getCurrent().getActiveShell(), 
"Select your image", SWT.OPEN); 

     resourceDialog.create(); 
     resourceDialog.open(); 
     String path=resourceDialog.getURIText();