[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.platform.swt] Re: Blocking all navigation and events to Browser from interface.

Yes, that almost meets my needs, I disable the Browser composite and the navigation can still occur but the mouse events are blocked, thanks.

However, there is a shortfall, I loose all event ability including scrolling the page after this.

thanks,
-Mark
Steve Northover wrote:
You can block all mouse events to any widget (including the browser) by
placing it inside a disabled composite.  The following snippet intercepts
mouse events to a button using this approach:

http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet46.java?rev=HEAD&content-type=text/vnd.viewcvs-markup

"Mark Diggory" <mdiggory@xxxxxxxxxx> wrote in message
news:42B780A0.8090903@xxxxxxxxxxxxx

Not only can I not remove mouselisteners, they are never reported any
events from the browser. I click on the widget and no event is generated
in a mouselistener I added to the Browser.

This is frustrating, theres no real solution to getting this granularity
at the moment.

Is it possible that I can layer some transparent widget or label over
the browser component to block any mouse events from getting to the
browser widget?

-Mark

Mark Diggory wrote:

Thats the problem, theres not enough granularity to the location
listener api for what developers would want to do with it.

Another idea I had was to block all Mouse events by removing all the
mouselisteners from my browser instance, but from what I see, theres no
way to get hold of the set and remove them without extending Browser
directly.

-Mark

AL wrote:


Well...The thing about the below solution is that it will veto, that
is, won't display anything, when you do a Browser.setText(String
text), where 'text' contains html text at the beginning.

Grant Gayed wrote:


Mark,

You can veto or modify page changes in the changing event, as shown
below:

browser.addLocationListener(new LocationAdapter() {
   public void changing(LocationEvent event) {
       event.doit = false; /* veto link traversals */
   }
});

Grant

"Mark Diggory" <mdiggory@xxxxxxxxxx> wrote in message
news:42A6EAFC.50607@xxxxxxxxxxxxx


Any takers? I think this has to be a common usecase?

Mark Diggory wrote:


I'm trying to use the Browser widget as a "Preview" of editor

content.

I'd like to block (and possibly override) the users ability to
activate
Links and form submit fields in the Browser so that they cannot
navigate
off of the page. What is the best way to approach this?

thanks,
Mark Diggory