Skip to main content



      Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » FileDialog as Save As dialog
FileDialog as Save As dialog [message #450890] Sat, 19 February 2005 19: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 05:45 Go to previous messageGo to next message
Eclipse UserFriend
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] Mon, 21 February 2005 19: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 09:04 Go to previous message
Eclipse UserFriend
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: Wed Jul 02 19:29:26 EDT 2025

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

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

Back to the top