Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Problems using Component Browser
Problems using Component Browser [message #484986] Thu, 10 September 2009 06:59 Go to next message
Markus Oley is currently offline Markus Oley
Messages: 253
Registered: July 2009
Location: Germany
Senior Member
Hi to everyone,

I use an Browser in a class that extends
org.eclipse.jface.dialogs.PopupDialog.

I show an html-text (no url) in this component, in which there are
different links. These links don't link to another site, but I want to
change the html-text (using method setText(..)) when I click one link.
I use the LocationListener to set the new text.
But the component just opens a new window for a very short time, I don't
see whats its content.
Then it closes both windows, the recently opened window and the
PopupDialog himself.

I just want to set a new text in the browser, that is shown and want the
browser to recognize it as new site, so I can call back() and forward(),
if available.

Can you help me?
Thanks in advance

Markus
Re: Problems using Component Browser [message #485928 is a reply to message #484986] Tue, 15 September 2009 14:37 Go to previous messageGo to next message
Grant Gayed is currently offline Grant Gayed
Messages: 2151
Registered: July 2009
Senior Member
Hi Markus,

I see a bug with invoking setText() consecutive times, so I've logged
https://bugs.eclipse.org/bugs/show_bug.cgi?id=289470 . I believe this is at
least part of your problem, but your case seems more complicated if there
are new windows opening, etc. If this report does not capture your case
adequately then you'll need to provide a snippet that shows what you're
doing.

One detail to note about setText() is that this works on all browser
implementations by navigating to about:blank and then setting the page
content from the string. For this reason calling back() and forward()
likely will not do what you want because once you navigate away from a page
whose content came from setText() that page's content is gone. So instead
of calling back() and forward() you'll have to maintain your own page
history and call setText() to navigate between pages in the history. This
is of course dependent on the fix for
https://bugs.eclipse.org/bugs/show_bug.cgi?id=289470 .

Grant


"Markus Oley" <markus.oley@t-online.de> wrote in message
news:0972696746ef2e10bb1af955718cc504$1@www.eclipse.org...
> Hi to everyone,
>
> I use an Browser in a class that extends
> org.eclipse.jface.dialogs.PopupDialog.
>
> I show an html-text (no url) in this component, in which there are
> different links. These links don't link to another site, but I want to
> change the html-text (using method setText(..)) when I click one link.
> I use the LocationListener to set the new text.
> But the component just opens a new window for a very short time, I don't
> see whats its content.
> Then it closes both windows, the recently opened window and the
> PopupDialog himself.
>
> I just want to set a new text in the browser, that is shown and want the
> browser to recognize it as new site, so I can call back() and forward(),
> if available.
>
> Can you help me?
> Thanks in advance
>
> Markus
>
>
>
Re: Problems using Component Browser [message #485995 is a reply to message #485928] Tue, 15 September 2009 20:29 Go to previous messageGo to next message
Markus Oley is currently offline Markus Oley
Messages: 253
Registered: July 2009
Location: Germany
Senior Member
Hi Grant,
thank you for your answer, that's exactly my problem. I even have a
problem layouting the browser-component so I think I want to try another
component.
Can you give me a hint, what SWT-Components can show HTML-text (not the
structured text...)
I will implement the back/forward-functionality for my self, too.

Thanx for your help
Markus

> I see a bug with invoking setText() consecutive times, so I've logged
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=289470 . I believe this is at
> least part of your problem, but your case seems more complicated if there
> are new windows opening, etc. If this report does not capture your case
> adequately then you'll need to provide a snippet that shows what you're
> doing.


> One detail to note about setText() is that this works on all browser
> implementations by navigating to about:blank and then setting the page
> content from the string. For this reason calling back() and forward()
> likely will not do what you want because once you navigate away from a page
> whose content came from setText() that page's content is gone. So instead
> of calling back() and forward() you'll have to maintain your own page
> history and call setText() to navigate between pages in the history. This
> is of course dependent on the fix for
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=289470 .

> Grant


> "Markus Oley" <markus.oley@t-online.de> wrote in message
> news:0972696746ef2e10bb1af955718cc504$1@www.eclipse.org...
>> Hi to everyone,
>>
>> I use an Browser in a class that extends
>> org.eclipse.jface.dialogs.PopupDialog.
>>
>> I show an html-text (no url) in this component, in which there are
>> different links. These links don't link to another site, but I want to
>> change the html-text (using method setText(..)) when I click one link.
>> I use the LocationListener to set the new text.
>> But the component just opens a new window for a very short time, I don't
>> see whats its content.
>> Then it closes both windows, the recently opened window and the
>> PopupDialog himself.
>>
>> I just want to set a new text in the browser, that is shown and want the
>> browser to recognize it as new site, so I can call back() and forward(),
>> if available.
>>
>> Can you help me?
>> Thanks in advance
>>
>> Markus
>>
>>
>>
Re: Problems using Component Browser [message #486150 is a reply to message #485995] Wed, 16 September 2009 14:06 Go to previous message
Grant Gayed is currently offline Grant Gayed
Messages: 2151
Registered: July 2009
Senior Member
The only other SWT control that can show text with varying colours, styles,
etc. is StyledText. However it will not accept an HTML string as input
(existing request for this:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=212829 ).

What layout problem are you having with the Browser? It shouldn't be
different from other controls w.r.t. giving it a size and location. Or is
your problem with the layout of its content? The one thing that a Browser
cannot do is pack() to a preferred size that's ideal for showing its current
content.

Grant


"Markus Oley" <markus.oley@t-online.de> wrote in message
news:6d8dc5aadc0cae7f9f29cb9cf086fbe7$1@www.eclipse.org...
> Hi Grant,
> thank you for your answer, that's exactly my problem. I even have a
> problem layouting the browser-component so I think I want to try another
> component.
> Can you give me a hint, what SWT-Components can show HTML-text (not the
> structured text...)
> I will implement the back/forward-functionality for my self, too.
>
> Thanx for your help
> Markus
>
> > I see a bug with invoking setText() consecutive times, so I've logged
> > https://bugs.eclipse.org/bugs/show_bug.cgi?id=289470 . I believe this
is at
> > least part of your problem, but your case seems more complicated if
there
> > are new windows opening, etc. If this report does not capture your case
> > adequately then you'll need to provide a snippet that shows what you're
> > doing.
>
>
> > One detail to note about setText() is that this works on all browser
> > implementations by navigating to about:blank and then setting the page
> > content from the string. For this reason calling back() and forward()
> > likely will not do what you want because once you navigate away from a
page
> > whose content came from setText() that page's content is gone. So
instead
> > of calling back() and forward() you'll have to maintain your own page
> > history and call setText() to navigate between pages in the history.
This
> > is of course dependent on the fix for
> > https://bugs.eclipse.org/bugs/show_bug.cgi?id=289470 .
>
> > Grant
>
>
> > "Markus Oley" <markus.oley@t-online.de> wrote in message
> > news:0972696746ef2e10bb1af955718cc504$1@www.eclipse.org...
> >> Hi to everyone,
> >>
> >> I use an Browser in a class that extends
> >> org.eclipse.jface.dialogs.PopupDialog.
> >>
> >> I show an html-text (no url) in this component, in which there are
> >> different links. These links don't link to another site, but I want to
> >> change the html-text (using method setText(..)) when I click one link.
> >> I use the LocationListener to set the new text.
> >> But the component just opens a new window for a very short time, I
don't
> >> see whats its content.
> >> Then it closes both windows, the recently opened window and the
> >> PopupDialog himself.
> >>
> >> I just want to set a new text in the browser, that is shown and want
the
> >> browser to recognize it as new site, so I can call back() and
forward(),
> >> if available.
> >>
> >> Can you help me?
> >> Thanks in advance
> >>
> >> Markus
> >>
> >>
> >>
>
>
Previous Topic:Trying to draw Button on top of Sash
Next Topic:limiting tree control height with formlayout
Goto Forum:
  


Current Time: Tue Sep 30 11:55:05 GMT 2014

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

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