Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » Set Selection of the Package Explorer
Set Selection of the Package Explorer [message #479901] Thu, 13 August 2009 00:13 Go to next message
Eclipse UserFriend
Originally posted by: davmoram.hotmail.com

Hi everyone:

I'm starting the development of a Eclipse Visualization Plugin and I want
to change the current selection of the Package Explorer programmatically
but I haven't been able to figure out how to do this. If there is a
tutorial or something about it, or if anyone knows how to do it, I would
really appreciate that.

Thanks in advance

David
Re: Set Selection of the Package Explorer [message #480351 is a reply to message #479901] Sat, 15 August 2009 19:02 Go to previous message
Eclipse UserFriend
Originally posted by: davmoram.hotmail.com

Hi:

I have figured out a way to do this, I don't know if is the correct way
but worked for me as I expected:

First you have to get the package explorer view:

IViewPart view =
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActi vePage().findView(ID_PACKAGE_EXPLORER);

and then assign the new selection in the selection provider of the view:

view.getSite().getSelectionProvider().setSelection(newSelect ion);

where newSelection is an instance of ISelection in my case I used
StructuredSelection but I think it could work with other like
TreeSelection.

Bye
Re: Set Selection of the Package Explorer [message #600707 is a reply to message #479901] Sat, 15 August 2009 19:02 Go to previous message
Eclipse UserFriend
Originally posted by: davmoram.hotmail.com

Hi:

I have figured out a way to do this, I don't know if is the correct way
but worked for me as I expected:

First you have to get the package explorer view:

IViewPart view =
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActi vePage().findView(ID_PACKAGE_EXPLORER);

and then assign the new selection in the selection provider of the view:

view.getSite().getSelectionProvider().setSelection(newSelect ion);

where newSelection is an instance of ISelection in my case I used
StructuredSelection but I think it could work with other like
TreeSelection.

Bye
Previous Topic:XML editor from wizard can not open files outside project directory
Next Topic:How to checkout files from source control programmatically
Goto Forum:
  


Current Time: Thu Apr 25 22:11:00 GMT 2024

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

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

Back to the top