Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » ISelectionListener question - how to register?
ISelectionListener question - how to register? [message #460918] Fri, 09 September 2005 22:08 Go to next message
Patrick is currently offline PatrickFriend
Messages: 55
Registered: July 2009
Member
I created a custom ViewPart as a replacement for the PropertySheetPage. It
needs to display properties similar to the way the PropertySheetPage
functions.
I am having trouble getting it to listen for changes in selection. What am
I missing here? The debug statement never gets called.


public class AttributeView extends ViewPart implements ISelectionListener {

....


public void createPartControl(Composite parent) {

Table table = createTable(parent);

getSite().getWorkbenchWindow().getSelectionService().addSele ctionListener(this);
}



public void selectionChanged(IWorkbenchPart part, ISelection selection) {
System.out.println("AttributeView.selectionChanged : part: " +
part.toString()
+ " selection: " + selection.toString());


}


}
Re: ISelectionListener question - how to register? [message #460984 is a reply to message #460918] Tue, 13 September 2005 20:43 Go to previous message
Patrick is currently offline PatrickFriend
Messages: 55
Registered: July 2009
Member
Nevermind. I have this working now.



Patrick wrote:

> I created a custom ViewPart as a replacement for the PropertySheetPage.
> It needs to display properties similar to the way the PropertySheetPage
> functions.
> I am having trouble getting it to listen for changes in selection. What
> am
> I missing here? The debug statement never gets called.
>
>
> public class AttributeView extends ViewPart implements ISelectionListener
> {
>
> ...
>
>
> public void createPartControl(Composite parent) {
>
> Table table = createTable(parent);
>
>
getSite().getWorkbenchWindow().getSelectionService().addSele ctionListener(this);
> }
>
>
>
> public void selectionChanged(IWorkbenchPart part, ISelection selection) {
> System.out.println("AttributeView.selectionChanged : part: " +
> part.toString()
> + " selection: " + selection.toString());
>
>
> }
>
>
> }
Previous Topic:Problem with DefaultUndoManager in Eclipse 3.1
Next Topic:Simple FormLayout question
Goto Forum:
  


Current Time: Mon Sep 16 20:55:11 GMT 2019

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

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

Back to the top