Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » How to get references to views from an editor
How to get references to views from an editor [message #453792] Sat, 09 April 2005 13:11 Go to next message
Jack Chi is currently offline Jack ChiFriend
Messages: 52
Registered: July 2009
Member
I have a similar question to the recent April 7th posted by Alex titled as
"Linking a view and an editor" on eclipse.platform

I just made two views and they are both JFace TableViewers. I need to have
the behavor so that when a user clicks on a row of the first TableViewer
will highlight a row in a second TableViewer.

The suggestion found in the post mentioned above will require to add a
method to the edtor class and make these 2 views as outline views which is
not the case here. I briefly describe our design below.

We make a plugin and add a event listener in an Action class contributing
to a popup menu for an editor, say a Java editor. But we can not extend
the editor as we can not access the source code or whatever reasons. When
some events occur or a user click the popup menu then invoke a code
analyzer and produce a report. Then dispaly the report in these 2
TableViewer(s). The first TableViewer will display a list of errors found
in the Java files. User can click one of the error in the first
TableViewer to view the detail in another TableViewer.

I have 2 questions here.

1. How can we code so that the event listener can reference to these 2
views and populate their content accordingly?
2. How do these 2 views communocate? eg, click on a row of TableViewer 1
update the content of TableView 2.

If you can point me a reference, that would be just great.

Thanks

Jack
Re: How to get references to views from an editor [message #453810 is a reply to message #453792] Sun, 10 April 2005 17:25 Go to previous message
Eclipse UserFriend
Originally posted by: aaa.domain.invalid

Jack Chi wrote:
> I have a similar question to the recent April 7th posted by Alex titled
> as "Linking a view and an editor" on eclipse.platform
>
> I just made two views and they are both JFace TableViewers. I need to
> have the behavor so that when a user clicks on a row of the first
> TableViewer will highlight a row in a second TableViewer.
>
> The suggestion found in the post mentioned above will require to add a
> method to the edtor class and make these 2 views as outline views which
> is not the case here. I briefly describe our design below.
>
> We make a plugin and add a event listener in an Action class
> contributing to a popup menu for an editor, say a Java editor. But we
> can not extend the editor as we can not access the source code or
> whatever reasons. When some events occur or a user click the popup menu
> then invoke a code analyzer and produce a report. Then dispaly the
> report in these 2 TableViewer(s). The first TableViewer will display a
> list of errors found in the Java files. User can click one of the error
> in the first TableViewer to view the detail in another TableViewer.
>
> I have 2 questions here.
>
> 1. How can we code so that the event listener can reference to these 2
> views and populate their content accordingly?
> 2. How do these 2 views communocate? eg, click on a row of TableViewer 1
> update the content of TableView 2.
>
> If you can point me a reference, that would be just great.
>
> Thanks
>
> Jack
>

Jack,
This tutorial will show you how a create a view can that interact with
other views..its RCP based but you should get an idea on how it can be done
http://www.jarchitect.org/tech/rcp/tutorial4.html

hope it helps...

-Chhil
Previous Topic:Printdialog does not work under Linux
Next Topic:Why do "PreferenceNode" trigger the exception ?
Goto Forum:
  


Current Time: Thu Apr 18 10:43:08 GMT 2024

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

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

Back to the top