Skip to main content



      Home
Home » Eclipse Projects » Remote Application Platform (RAP) » The curious RAP FileDialog
The curious RAP FileDialog [message #838080] Fri, 06 April 2012 10:38 Go to next message
Eclipse UserFriend
Hello Everybody !

I have successfully and easily converted a simple RCP application to a RAP one.

Encouraged by this first success, I started to convert a second simple application of mine which reads an input file from the file-system, encrypts it and writes the encrypted file to the file-system.

The GUI is very simple: a Text widget and a Browse button for the input file; the same couple of widgets for the encrypted output file. I use the FileDialog widget from RAP 1.4 Incubator to specify the input and output files pathnames.

The current FileDialog behavior does not suit my needs: it contains its own Browse button, which means the user has to click two Browse buttons before the file selection dialog pops up. This is the first issue. The second problem is that the dialog only displays the selected file name, not its full pahname on the user's file system. The third issue arises when I update the Text widget with FileDialog.getFileName() which displays a strange file pathname including a \Temp folder and adds a series of numbers to the file name ,like in util.2624504061871153546.jar.

Is there a chance that the RAP FileDialog behavior evolves in the future, making it usable the same way than the regular SWT one, or is my request absolutely ridiculous ?

In others words, should I wait for the June release (or more), or abandon RAP (which would be really disappointing).

Thanks a lot in advance for your time !

Georges
Re: The curious RAP FileDialog [message #838134 is a reply to message #838080] Fri, 06 April 2012 12:06 Go to previous messageGo to next message
Eclipse UserFriend
Hi Georges,
There is a big difference between SWT and RAP FileDialog. This is
basically due to client-server nature of RAP. The RAP FileDialog browse
for a file on the client file system and upload it to the server.
> The current FileDialog behavior does not suit my needs: it contains
> its own Browse button, which means the user has to click two Browse
> buttons before the file selection dialog pops up. This is the first
> issue.
If you want to open a "file selection dialog" directly you have to use
FileUpload RAP widget instead. See
"org.eclipse.rap.rwt.supplemental.filedialog.demo\src\org\eclipse\rap\examples\demo\fileupload\FileUploadExamplePage.java"
from CVS for an example how to use it.

> The second problem is that the dialog only displays the selected file
> name, not its full pahname on the user's file system.
Due to browser security restriction it's not possible to get the full
path on the user's file system.

> The third issue arises when I update the Text widget with
> FileDialog.getFileName() which displays a strange file pathname
> including a \Temp folder and adds a series of numbers to the file name
> ,like in util.2624504061871153546.jar.
The file name returned from the FileDialog.getFileName() is the path
where the file is uploaded on the server (in the temp folder). In CVS
HEAD we changed this path from:
"...\Temp\util.2624504061871153546.jar"
to
"...\Temp\fileupload_2624504061871153546\util.jar"
Thus, we keep the original file name unchanged.
HTH,
Ivan

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: The curious RAP FileDialog [message #840535 is a reply to message #838134] Tue, 10 April 2012 03:52 Go to previous messageGo to next message
Eclipse UserFriend
Hi Ivan!

Thanks a lot for your reply. Everything is perfectly clear now, but I foresee an issue with the file selection mechanism in RAP. In many applications, we save user's entries from dialogs and wizards to a settings file. Settings are then loaded during the next session.

Since I cannot get local files pathnames selected by the user, I am afraid RAP applications cannot fully support saving and reloading user's settings. Am I right? Can you see a workaround to this?

Many thanks in advance for your time,

Georges
Re: The curious RAP FileDialog [message #840579 is a reply to message #840535] Tue, 10 April 2012 05:02 Go to previous message
Eclipse UserFriend
Hi Georges,
save and reload of the user settings is done on the server, not on the
client. See RWT#getSettingsStore for more details.
Best,
Ivan

On 4/10/2012 10:52 AM, Georges Bachelier wrote:
> Hi Ivan!
>
> Thanks a lot for your reply. Everything is perfectly clear now, but I
> foresee an issue with the file selection mechanism in RAP. In many
> applications, we save user's entries from dialogs and wizards to a
> settings file. Settings are then loaded during the next session.
>
> Since I cannot get local files pathnames selected by the user, I am
> afraid RAP applications cannot fully support saving and reloading
> user's settings. Am I right? Can you see a workaround to this?
>
> Many thanks in advance for your time,
>
> Georges

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Previous Topic:GraphicalEditorWithFlyoutPalette & mouse wheel scrolling
Next Topic:Session Timeout Warning
Goto Forum:
  


Current Time: Sun Jun 22 07:26:02 EDT 2025

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

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

Back to the top