Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » how to download files with Browser widget
how to download files with Browser widget [message #443548] Mon, 27 September 2004 23:22 Go to next message
Andreas Niemeyer is currently offline Andreas NiemeyerFriend
Messages: 40
Registered: July 2009
Member
Hi all,

I would like to download files inside a Browser widget. Is there a
workaround exists?


I have a problem to understand how the addOpenWindowListener() works:
I want to pass the expected open window link to open it in a new browser
or recall the setURL() method.


Many thanks in advance,
Andreas N.
Re: how to download files with Browser widget [message #443573 is a reply to message #443548] Tue, 28 September 2004 15:22 Go to previous messageGo to next message
Christophe Cornu is currently offline Christophe CornuFriend
Messages: 304
Registered: July 2009
Senior Member
Hi Andreas,

> I would like to download files inside a Browser widget. Is there a
> workaround exists?
What is the problem you are encontering? Which platform are you on?

> I have a problem to understand how the addOpenWindowListener() works:
> I want to pass the expected open window link to open it in a new browser
> or recall the setURL() method.
See the javadoc of WindowEvent for an example on how to handle WindowEvent.

If you can use a recent SWT 3.1 build (M2 for example), you probably want to
reuse or adapt the BrowserExample class at:
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.exa mples/src/org/eclipse/swt/examples/browserexample/BrowserExa mple.java?rev=HEAD&content-type=text/vnd.viewcvs-markup
That example can also be downloaded from the Eclipse download page under
"Example Plug-ins". It provides a convenient wrapper class around the
Browser widget to handle WindowEvent's. All you need to do is:
BrowserExample app = new BrowserExample(shell, true);

OpenWindowListener.open is fired by the underlying native browser whenever
it needs to create a new browser instance - e.g. as a result of javascript
window.open. The application typically create a new Browser widget and pass
it back to that event. This new Browser is used by the underlying native
browser to load an host the new content. That new Browser will fire the
typical notifications LocationListener/ProgressListener/StatusListener etc
as the content gets loaded. You don't call setUrl - it is taken care of by
the HTML engine the Browser widget is embedding when OpenWindowListener.open
returns.

Hope this helps,

Chris
Re: how to download files with Browser widget [message #443623 is a reply to message #443573] Tue, 28 September 2004 17:53 Go to previous messageGo to next message
Andreas Niemeyer is currently offline Andreas NiemeyerFriend
Messages: 40
Registered: July 2009
Member
Christophe Cornu wrote:
> Hi Andreas,
>
>
> Hope this helps,

Hi Chris,

thank you for your detailed explaination and hints. I understand the
code and the use of the OpenWindowListener.

But I miss what I want, the possibility of downloading files from a
webpage within an anchor tag.

I use the Mac OSX version of eclipse, version 3.0.0/build 200406111814

Regards,
Andreas

>
> Chris
>
>
Re: how to download files with Browser widget [message #443766 is a reply to message #443623] Thu, 30 September 2004 14:26 Go to previous message
Christophe Cornu is currently offline Christophe CornuFriend
Messages: 304
Registered: July 2009
Senior Member
Hi Andreas,
I've opened:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=75390

Thanks,
Chris
Previous Topic:dialog box with background image
Next Topic:Single column table possible?
Goto Forum:
  


Current Time: Sat Apr 20 00:28:41 GMT 2024

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

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

Back to the top