Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » How to get the selected Fileextension in the file dialog
How to get the selected Fileextension in the file dialog [message #436303] Sat, 15 May 2004 21:23 Go to next message
Matthias is currently offline MatthiasFriend
Messages: 9
Registered: July 2009
Junior Member
Hi

when i use the standard file dialog to let the user select a filename
under which the user wants to save a file i encounter the problem, that i
am not able to find out which file extension the user selected.

What did i miss?

Sincerely
Matt
Re: How to get the selected Fileextension in the file dialog [message #436310 is a reply to message #436303] Sun, 16 May 2004 21:41 Go to previous messageGo to next message
Daniel Spiewak is currently offline Daniel SpiewakFriend
Messages: 263
Registered: July 2009
Senior Member
To the best of my knowledge, you're just going to have to use a
iterative character searching loop and look (from right to left) for the
'.' character. Then get the substring from one character right of the
'.' character to the end of the text. That'll give you extension.

Daniel

Matthias wrote:

>Hi
>
>when i use the standard file dialog to let the user select a filename
>under which the user wants to save a file i encounter the problem, that i
>am not able to find out which file extension the user selected.
>
>What did i miss?
>
>Sincerely
>Matt
>
>
>
Re: How to get the selected Fileextension in the file dialog [message #436453 is a reply to message #436310] Tue, 18 May 2004 21:47 Go to previous message
Matthias is currently offline MatthiasFriend
Messages: 9
Registered: July 2009
Junior Member
That would work fine IF the user would have enterd the extension and not
just selects one extension...

As long as he/she dosent do it, getFileName() returns only that whats
entered in the textbox and does not appends the extension if necessary...

Daniel Spiewak wrote:

> To the best of my knowledge, you're just going to have to use a
> iterative character searching loop and look (from right to left) for the
> '.' character. Then get the substring from one character right of the
> '.' character to the end of the text. That'll give you extension.

> Daniel

> Matthias wrote:
Previous Topic:SWT HOWTO Book Recommendation?
Next Topic:Sleak w/ 3.0
Goto Forum:
  


Current Time: Tue Sep 24 07:31:04 GMT 2024

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

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

Back to the top