Home » Eclipse Projects » Rich Client Platform (RCP) » How to communicate with eclipse internal web browser
How to communicate with eclipse internal web browser [message #452896] |
Tue, 18 July 2006 17:00 |
Eclipse User |
|
|
|
Originally posted by: rdias.inescporto.pt
Hi. I'm new to RCP, and here's what I'm trying to do:
I have my main perspective, with a tree view on the left and a view on the
right which uses the internal web browser (org.eclipse.ui.browser.view). The
thing is I want my tree view to serve as a favorites link tree view, so that
when a user double-clicks on that element of the tree view, the web browser
loads the URL associated to that element. Also, I have my preferences page,
where I want an option for setting the home page of this web browser, which
will open automatically every time the RCP is run.
So the question applies for both tree view and preferences page: how to
communicate with the eclipse web browser? how to user its setURL(...) method
from the treeview or the preferences page?
Can you help me?
Thanks a lot.
RDias
|
|
|
Re: How to communicate with eclipse internal web browser [message #452899 is a reply to message #452896] |
Tue, 18 July 2006 17:07 |
Wayne Beaton Messages: 554 Registered: December 2017 |
Senior Member |
|
|
Ricardo Dias wrote:
> Hi. I'm new to RCP, and here's what I'm trying to do:
>
> I have my main perspective, with a tree view on the left and a view on the
> right which uses the internal web browser (org.eclipse.ui.browser.view). The
> thing is I want my tree view to serve as a favorites link tree view, so that
> when a user double-clicks on that element of the tree view, the web browser
> loads the URL associated to that element. Also, I have my preferences page,
> where I want an option for setting the home page of this web browser, which
> will open automatically every time the RCP is run.
>
> So the question applies for both tree view and preferences page: how to
> communicate with the eclipse web browser? how to user its setURL(...) method
> from the treeview or the preferences page?
>
> Can you help me?
>
> Thanks a lot.
>
> RDias
>
>
BrowserViewer is an internal class, so you should probably not use it
(it's not part of the API and may change in the future). Your best bet
is to create your own view with an org.eclipse.swt.browser.Browser on
it. You can then manipulate that browser to your heart's content.
You could, if you wanted to, include the browser and the tree on the
same view. Or you could put them on separate views and use the selection
service to communicate between then. Set up your tree viewer to set the
workbench selection:
public void createPartControl(Composite parent) {
viewer = new TreeViewer(parent, SWT.WHATEVER);
getSite().setSelectionProvider(viewer);
...
}
Then setup the "Browser" view as a selection listener. If the selection
is one of the objects you're displaying in your tree view, get the URL
from it and direct the browser to that address. Just a thought (if
you're curious, I can probably hack a quick example together).
Wayne
|
|
|
Re: How to communicate with eclipse internal web browser [message #452936 is a reply to message #452899] |
Wed, 19 July 2006 09:13 |
Eclipse User |
|
|
|
Originally posted by: rdias.inescporto.pt
Yes, if you could provide me a quick example it would be great. As I'm new
to this RCP arquitecture, I do not understand it completely yet. But your
suggestions seem very good.
thks.
RDias
"Wayne Beaton" <wayne.beaton@_NOSPAM_eclipse.org> wrote in message
news:44BD1564.6050506@_NOSPAM_eclipse.org...
> Ricardo Dias wrote:
>> Hi. I'm new to RCP, and here's what I'm trying to do:
>>
>> I have my main perspective, with a tree view on the left and a view on
>> the right which uses the internal web browser
>> (org.eclipse.ui.browser.view). The thing is I want my tree view to serve
>> as a favorites link tree view, so that when a user double-clicks on that
>> element of the tree view, the web browser loads the URL associated to
>> that element. Also, I have my preferences page, where I want an option
>> for setting the home page of this web browser, which will open
>> automatically every time the RCP is run.
>>
>> So the question applies for both tree view and preferences page: how to
>> communicate with the eclipse web browser? how to user its setURL(...)
>> method from the treeview or the preferences page?
>>
>> Can you help me?
>>
>> Thanks a lot.
>>
>> RDias
>
> BrowserViewer is an internal class, so you should probably not use it
> (it's not part of the API and may change in the future). Your best bet is
> to create your own view with an org.eclipse.swt.browser.Browser on it. You
> can then manipulate that browser to your heart's content.
>
> You could, if you wanted to, include the browser and the tree on the same
> view. Or you could put them on separate views and use the selection
> service to communicate between then. Set up your tree viewer to set the
> workbench selection:
>
> public void createPartControl(Composite parent) {
> viewer = new TreeViewer(parent, SWT.WHATEVER);
> getSite().setSelectionProvider(viewer);
> ...
> }
>
> Then setup the "Browser" view as a selection listener. If the selection is
> one of the objects you're displaying in your tree view, get the URL from
> it and direct the browser to that address. Just a thought (if you're
> curious, I can probably hack a quick example together).
>
> Wayne
|
|
|
Re: How to communicate with eclipse internal web browser [message #452946 is a reply to message #452936] |
Wed, 19 July 2006 11:20 |
Eclipse User |
|
|
|
Originally posted by: rdias.inescporto.pt
BTW, I was able to create a Browser view using swt's browser, and
communicate with the tree view through a singleton class, the only problem
now, is that this browser is too limited. I do not know how to set the
progress indicator regarding the loading of the web pages, for instance.
Thks. Rdias
"Ricardo Dias" <rdias@inescporto.pt> wrote in message
news:e9kst9$35q$1@utils.eclipse.org...
> Yes, if you could provide me a quick example it would be great. As I'm new
> to this RCP arquitecture, I do not understand it completely yet. But your
> suggestions seem very good.
>
> thks.
>
> RDias
>
> "Wayne Beaton" <wayne.beaton@_NOSPAM_eclipse.org> wrote in message
> news:44BD1564.6050506@_NOSPAM_eclipse.org...
>> Ricardo Dias wrote:
>>> Hi. I'm new to RCP, and here's what I'm trying to do:
>>>
>>> I have my main perspective, with a tree view on the left and a view on
>>> the right which uses the internal web browser
>>> (org.eclipse.ui.browser.view). The thing is I want my tree view to serve
>>> as a favorites link tree view, so that when a user double-clicks on that
>>> element of the tree view, the web browser loads the URL associated to
>>> that element. Also, I have my preferences page, where I want an option
>>> for setting the home page of this web browser, which will open
>>> automatically every time the RCP is run.
>>>
>>> So the question applies for both tree view and preferences page: how to
>>> communicate with the eclipse web browser? how to user its setURL(...)
>>> method from the treeview or the preferences page?
>>>
>>> Can you help me?
>>>
>>> Thanks a lot.
>>>
>>> RDias
>>
>> BrowserViewer is an internal class, so you should probably not use it
>> (it's not part of the API and may change in the future). Your best bet is
>> to create your own view with an org.eclipse.swt.browser.Browser on it.
>> You can then manipulate that browser to your heart's content.
>>
>> You could, if you wanted to, include the browser and the tree on the same
>> view. Or you could put them on separate views and use the selection
>> service to communicate between then. Set up your tree viewer to set the
>> workbench selection:
>>
>> public void createPartControl(Composite parent) {
>> viewer = new TreeViewer(parent, SWT.WHATEVER);
>> getSite().setSelectionProvider(viewer);
>> ...
>> }
>>
>> Then setup the "Browser" view as a selection listener. If the selection
>> is one of the objects you're displaying in your tree view, get the URL
>> from it and direct the browser to that address. Just a thought (if you're
>> curious, I can probably hack a quick example together).
>>
>> Wayne
>
>
|
|
|
Goto Forum:
Current Time: Wed Oct 09 16:40:30 GMT 2024
Powered by FUDForum. Page generated in 0.04333 seconds
|