Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Select folder dialog box .
Select folder dialog box . [message #480138] Fri, 14 August 2009 06:04 Go to next message
Neha is currently offline NehaFriend
Messages: 52
Registered: July 2009
Member
Hi,
i want to export files from my application to a selected folder on machine.
But i dont know how 2 show a select folder dialog box .
we hav file select dialogbox but no folder select dialogbox .
Plz tell me how 2 show a folder select dialogbox
which also provide way to create new folder if needed

Thanks in Advance
Neha
Re: Select folder dialog box . [message #480153 is a reply to message #480138] Fri, 14 August 2009 07:49 Go to previous messageGo to next message
Derek is currently offline DerekFriend
Messages: 60
Registered: July 2009
Member
On 14/08/2009 07:04, Neha wrote:
> Hi,
> i want to export files from my application to a selected folder on machine.
> But i dont know how 2 show a select folder dialog box .
> we hav file select dialogbox but no folder select dialogbox .
> Plz tell me how 2 show a folder select dialogbox
> which also provide way to create new folder if needed
>
> Thanks in Advance
> Neha
>
>
DirectoryDialog?

--
Derek
Re: Select folder dialog box . [message #490867 is a reply to message #480138] Mon, 12 October 2009 05:48 Go to previous message
Prakash  is currently offline Prakash Friend
Messages: 3
Registered: October 2009
Junior Member
HI Neha,

Use following code snippet, i hope it will work for you.

String fileFilterPath=getProjectPath();
FileDialog fileDialog = new FileDialog(getShell(), SWT.SINGLE);
fileDialog.setFilterPath(fileFilterPath);
fileDialog.setFilterExtensions(new String[]{"*.csv","*.tsv"});
String firstFile = fileDialog.open();

if(firstFile != null) {
fileFilterPath = fileDialog.getFilterPath();
String[] selectedFiles = fileDialog.getFileNames();
String fileName=null;
if(selectedFiles.length>0){
fileName=selectedFiles[0];
}
csvFile.setText(fileFilterPath+"\\"+fileName.toString());
}


Thanks,
Prakash
Previous Topic:How to integrate eclipse help system with own plug-in UI
Next Topic:[MACOSX] Error handling events on GMF diagrams
Goto Forum:
  


Current Time: Sat Dec 14 04:30:54 GMT 2019

Powered by FUDForum. Page generated in 0.02665 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top