Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » How to register a selection service provider
How to register a selection service provider [message #325298] Wed, 13 February 2008 17:52 Go to next message
Eclipse UserFriend
I am curious if there is a straightforward way to register an Editor or a View as a Selection Provider

That is, if I create an Editor and it implements ISelectionProvider, how can register this editor as a Selction Provider for the Selection Service so that, in some view, I can as

getSite().getWorkbenchWindow().getSelectionService().addSele ctionListener(new LocalSelectionListener());

Thanks

Charles
Re: How to register a selection service provider [message #325302 is a reply to message #325298] Wed, 13 February 2008 22:46 Go to previous messageGo to next message
Eclipse UserFriend
In your editor:

@Override
public void init(IEditorSite site, IEditorInput input)
throws PartInitException
{

site.setSelectionProvider(this);

....




Charles Martin wrote:
> I am curious if there is a straightforward way to register an Editor or a View as a Selection Provider
>
> That is, if I create an Editor and it implements ISelectionProvider, how can register this editor as a Selction Provider for the Selection Service so that, in some view, I can as
>
> getSite().getWorkbenchWindow().getSelectionService().addSele ctionListener(new LocalSelectionListener());
>
> Thanks
>
> Charles
Re: How to register a selection service provider [message #325304 is a reply to message #325298] Wed, 13 February 2008 23:29 Go to previous message
Eclipse UserFriend
And as a second question,

How can fire my own properties and have other views pick them up?

For example, in my editor, if I say:

firePropertyChange(MyEditorPart.MY_PROP);

What is the best way to register my view as IPropertyListener?

Should I pull MyEditor from a registry and call

myEditor.addPropertyListener()

or is there a more clever way to do this ?

Thanks
Previous Topic:Re: IExpansionListener not called
Next Topic:Solaris 8 or solaris 10 ?
Goto Forum:
  


Current Time: Fri Apr 25 19:44:19 EDT 2025

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

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

Back to the top