Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Blocking all navigation and events to Browser from interface.
| | | | | | | | |
Re: Blocking all navigation and events to Browser from interface. [message #457158 is a reply to message #457073] |
Mon, 20 June 2005 11:26 |
Mark Diggory Messages: 202 Registered: July 2009 |
Senior Member |
|
|
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@apache.org> wrote in message
>> news:42A6EAFC.50607@apache.org...
>>
>>> 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
>>
>>
>>
>>
>
|
|
|
Re: Blocking all navigation and events to Browser from interface. [message #457199 is a reply to message #457158] |
Tue, 21 June 2005 02:51 |
Mark Diggory Messages: 202 Registered: July 2009 |
Senior Member |
|
|
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@apache.org> wrote in message
>>> news:42A6EAFC.50607@apache.org...
>>>
>>>> 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
>>>
>>>
>>>
>>>
>>>
>>
|
|
|
Re: Blocking all navigation and events to Browser from interface. [message #457216 is a reply to message #457199] |
Tue, 21 June 2005 20:31 |
Steve Northover Messages: 1636 Registered: July 2009 |
Senior Member |
|
|
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.sni ppets/src/org/eclipse/swt/snippets/Snippet46.java?rev=HEAD&a mp;content-type=text/vnd.viewcvs-markup
"Mark Diggory" <mdiggory@apache.org> wrote in message
news:42B780A0.8090903@apache.org...
> 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@apache.org> wrote in message
> >>> news:42A6EAFC.50607@apache.org...
> >>>
> >>>> 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
> >>>
> >>>
> >>>
> >>>
> >>>
> >>
|
|
|
Re: Blocking all navigation and events to Browser from interface. [message #457240 is a reply to message #457216] |
Wed, 22 June 2005 14:08 |
Mark Diggory Messages: 202 Registered: July 2009 |
Senior Member |
|
|
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.sni ppets/src/org/eclipse/swt/snippets/Snippet46.java?rev=HEAD&a mp;content-type=text/vnd.viewcvs-markup
>
> "Mark Diggory" <mdiggory@apache.org> wrote in message
> news:42B780A0.8090903@apache.org...
>
>>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@apache.org> wrote in message
>>>>>news:42A6EAFC.50607@apache.org...
>>>>>
>>>>>
>>>>>>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
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>
>
|
|
|
Goto Forum:
Current Time: Fri Apr 26 07:33:26 GMT 2024
Powered by FUDForum. Page generated in 0.04228 seconds
|