Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » How to set the selection in package explorer(How to set the selection in package explorer)
icon4.gif  How to set the selection in package explorer [message #988869] Mon, 03 December 2012 14:01
Flavius Cerna is currently offline Flavius CernaFriend
Messages: 1
Registered: December 2012
Junior Member
Hi. I also created this post on stackoverflow
but without succes and found about this forum and hope I'll have more luck here.

So basicaly I have a file in my workspace; I know it's location and I know it exists.
All I need to do is set it as the current selected(or focused) file in the package explorer.

I tried this

 file = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(myPath);
if (file != null ) {
            //Select the data file
            IViewReference[] views = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getViewReferences();
            for(IViewReference view:views){
                    IViewPart pExplorer = view.getView(true);

But with the information I have on my file, I couldn't manage to create a structuredSelection or something like that which is required as a param for setSelection().

I hope I'm on the right forum. This is really urgent for me so any help is appreciated. Thanks in advance.
Previous Topic:Contribute to CDT Indexer
Next Topic:Set default start level for p2 enabled product
Goto Forum:

Current Time: Sat May 26 20:03:21 GMT 2018

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

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

Back to the top