Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Using Listeners?
Using Listeners? [message #449816] Fri, 19 May 2006 11:54 Go to next message
Eclipse UserFriend
Originally posted by: ijl708.gmail.com

Hey,

I'm still relatively green in eclipse development. Here's the set up. I
have 2 views. When something is clicked in view 1 I want something to
happen in view 2.

My question is: where does the listener go? I mean if I was extending
ApplicationWindow then I would just put it in the createContents method,
but it's not that simple here. :p

Here's my little listener:

toListen.addSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
IStructuredSelection selection = (IStructuredSelection)
event.getSelection();
Object selected = selection.getFirstElement();
table.setInput(selected);

Thank you.

Ian
Re: Using Listeners? [message #449819 is a reply to message #449816] Fri, 19 May 2006 12:52 Go to previous message
Eclipse UserFriend
Ian Livingston wrote:
> Hey,
>
> I'm still relatively green in eclipse development. Here's the set up.
> I have 2 views. When something is clicked in view 1 I want something to
> happen in view 2.
>
> My question is: where does the listener go? I mean if I was extending
> ApplicationWindow then I would just put it in the createContents method,
> but it's not that simple here. :p
>
> Here's my little listener:
>
> toListen.addSelectionChangedListener(new
> ISelectionChangedListener() {
> public void selectionChanged(SelectionChangedEvent event) {
> IStructuredSelection selection = (IStructuredSelection)
> event.getSelection();
> Object selected = selection.getFirstElement();
> table.setInput(selected);
>
> Thank you.
>
> Ian
>

Check out:
http://www.eclipse.org/articles/Article-WorkbenchSelections/ article.html

Basically, view2 would add a selection listener with a call to
getSite().getPage().addSelectionListener(*), probably in
createPartControl(*).

Later,
PW
Previous Topic:Toolbar contributions from a plugin in a RCP Application
Next Topic:[RCP+Spring] interface org.eclipse.ui.IViewPart is not visible from class loader
Goto Forum:
  


Current Time: Sun Aug 31 00:48:56 EDT 2025

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

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

Back to the top