Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Logging URLs that are loaded with the internal browser
Logging URLs that are loaded with the internal browser [message #836455] Wed, 04 April 2012 13:59 Go to next message
Missing name Missing name is currently offline Missing name Missing nameFriend
Messages: 6
Registered: December 2011
Junior Member
Hi

I use the following code to start an internal browser an load a URL:
IWorkbenchBrowserSupport browserSupport = Activator.getDefault().getWorkbench().getBrowserSupport();
IWebBrowser browser = browserSupport.createBrowser(IWorkbenchBrowserSupport.LOCATION_BAR, null,"Test", "Test");
	
URL url = new URL("www.google.com");
browser.openURL(url);

Now I would like to keep track of every other URLs that are also loaded in this internal browser. Can I somehow hook into it?

For now I created my own browser using SWT widget, following this link:

h**p://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet128.java?view=co

But the problem is, I don't know how to integrate it into my plugin so that it is displayed instead of the editor. How can I do that?

Thanks

[Updated on: Wed, 04 April 2012 14:53]

Report message to a moderator

Re: Logging URLs that are loaded with the internal browser [message #837087 is a reply to message #836455] Thu, 05 April 2012 08:55 Go to previous messageGo to next message
Alexandra Niculai is currently offline Alexandra NiculaiFriend
Messages: 84
Registered: July 2009
Member
You can add a location listener. The Browser class has this method that you can call:

public void addLocationListener (LocationListener listener)


The snippet you mentioned has this listener in it:

		browser.addLocationListener(new LocationListener() {
			public void changed(LocationEvent event) {
				if (event.top) location.setText(event.location);
			}
			public void changing(LocationEvent event) {
			}
		});
Re: Logging URLs that are loaded with the internal browser [message #837660 is a reply to message #837087] Fri, 06 April 2012 00:16 Go to previous message
Missing name Missing name is currently offline Missing name Missing nameFriend
Messages: 6
Registered: December 2011
Junior Member
Thanks that helped me. However, I planned to not hook into the swt Browser, but the internal browser.
Previous Topic:Open JUnit view with a Surefire-report
Next Topic:My buttons are not shown in JFrame Fullscreen
Goto Forum:
  


Current Time: Sun Dec 21 20:51:56 GMT 2014

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

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