Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » FileDialog as Save As dialog
FileDialog as Save As dialog [message #450890] Sun, 20 February 2005 00:06 Go to next message
Eclipse UserFriend
Originally posted by: bob.objfac.com

This came up in the rcp group. Thought someone here might have some advice.

David Beers wrote:

> What about using org.eclipse.swt.widgets.FileDialog?

A great suggestion. The only problem with FileDialog when used for Save
As is it doesn't complain if the file already exists, so if you want
confirmation you have to do it when the dialog is dismissed and put it
up again if the user Cancels. Minor, but UI is all about attention to
detail. Anyone know a way to get FileDialog to cooperate?

Bob Foster
Re: FileDialog as Save As dialog [message #451007 is a reply to message #450890] Mon, 21 February 2005 10:45 Go to previous messageGo to next message
Tiberiu Caprita is currently offline Tiberiu CapritaFriend
Messages: 68
Registered: July 2009
Member
Bob Foster wrote:

> This came up in the rcp group. Thought someone here might have some advice.

> David Beers wrote:

> > What about using org.eclipse.swt.widgets.FileDialog?

> A great suggestion. The only problem with FileDialog when used for Save
> As is it doesn't complain if the file already exists, so if you want
> confirmation you have to do it when the dialog is dismissed and put it
> up again if the user Cancels. Minor, but UI is all about attention to
> detail. Anyone know a way to get FileDialog to cooperate?

> Bob Foster
Hi Bob,
according to MSDN, the behaviour you want is obtained when OPENFILENAME
has the following style set:
"
OFN_OVERWRITEPROMPT
Causes the Save As dialog box to generate a message box if the selected
file already exists. The user must confirm whether to overwrite the file.
"

It seems SWT doesn't give you much flexibility here. You have to hack the
FileDialog in a way. Take a look of FileDialog code and choose the better
place to change it...

Regards,
Tiberiu
Re: FileDialog as Save As dialog [message #451030 is a reply to message #451007] Tue, 22 February 2005 00:43 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: bob.objfac.com

Thanks. I guess I should put in a feature request. Hopefully, there is a
way to do this on every platform.

Bob

Tiberiu Caprita wrote:
> Bob Foster wrote:
>
>> This came up in the rcp group. Thought someone here might have some
>> advice.
>
>
>> David Beers wrote:
>
>
>> > What about using org.eclipse.swt.widgets.FileDialog?
>
>
>> A great suggestion. The only problem with FileDialog when used for
>> Save As is it doesn't complain if the file already exists, so if you
>> want confirmation you have to do it when the dialog is dismissed and
>> put it up again if the user Cancels. Minor, but UI is all about
>> attention to detail. Anyone know a way to get FileDialog to cooperate?
>
>
>> Bob Foster
>
> Hi Bob,
> according to MSDN, the behaviour you want is obtained when OPENFILENAME
> has the following style set:
> "
> OFN_OVERWRITEPROMPT
> Causes the Save As dialog box to generate a message box if the selected
> file already exists. The user must confirm whether to overwrite the file.
> "
>
> It seems SWT doesn't give you much flexibility here. You have to hack
> the FileDialog in a way. Take a look of FileDialog code and choose the
> better place to change it...
>
> Regards,
> Tiberiu
>
>
>
Re: FileDialog as Save As dialog [message #451064 is a reply to message #451030] Tue, 22 February 2005 14:04 Go to previous message
Steve Northover is currently offline Steve NorthoverFriend
Messages: 1636
Registered: July 2009
Senior Member
It's an old feature request that might need to be revisited.

https://bugs.eclipse.org/bugs/show_bug.cgi?id=4727

"Bob Foster" <bob@objfac.com> wrote in message
news:421A803C.9040109@objfac.com...
> Thanks. I guess I should put in a feature request. Hopefully, there is a
> way to do this on every platform.
>
> Bob
>
> Tiberiu Caprita wrote:
> > Bob Foster wrote:
> >
> >> This came up in the rcp group. Thought someone here might have some
> >> advice.
> >
> >
> >> David Beers wrote:
> >
> >
> >> > What about using org.eclipse.swt.widgets.FileDialog?
> >
> >
> >> A great suggestion. The only problem with FileDialog when used for
> >> Save As is it doesn't complain if the file already exists, so if you
> >> want confirmation you have to do it when the dialog is dismissed and
> >> put it up again if the user Cancels. Minor, but UI is all about
> >> attention to detail. Anyone know a way to get FileDialog to cooperate?
> >
> >
> >> Bob Foster
> >
> > Hi Bob,
> > according to MSDN, the behaviour you want is obtained when OPENFILENAME
> > has the following style set:
> > "
> > OFN_OVERWRITEPROMPT
> > Causes the Save As dialog box to generate a message box if the selected
> > file already exists. The user must confirm whether to overwrite the
file.
> > "
> >
> > It seems SWT doesn't give you much flexibility here. You have to hack
> > the FileDialog in a way. Take a look of FileDialog code and choose the
> > better place to change it...
> >
> > Regards,
> > Tiberiu
> >
> >
> >
Previous Topic:How to get labels to resize themselves in a composite?
Next Topic:SWT slowing doing after a couple of hour
Goto Forum:
  


Current Time: Tue Sep 29 21:36:14 GMT 2020

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

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

Back to the top