Set Selection of the Package Explorer [message #479901] |
Thu, 13 August 2009 00:13 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.02678 seconds