Problems invoking selectReveal() on ProjectExplorer view [message #1767305] |
Tue, 04 July 2017 10:43  |
Eclipse User |
|
|
|
Hey guys,
we want to select a file in the Project Explorer when we are clicking on an certain item in another view.
Therefore, we do the following:
final IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
final IViewPart viewPart = page.findView(IPageLayout.ID_PROJECT_EXPLORER);
((ISetSelectionTarget)viewPart).selectReveal(new StructuredSelection(iResource));
The selectReveal() method works very fine, when the path to the file which has to be selected, was expanded and selected once BEFORE.
When the file is selected and we click the "Collapse All" button and then we click on our item in the other view again, then the file is not selected. The project stays collapsed and the tree is not expanded.
We already opened a topic on Stackoverflow too, but there were no successful solutions:
https://stackoverflow.com/questions/44903291/selecting-a-resource-programatically-in-eclipse-does-not-expand-tree
Are we doing something wrong or is this maybe a known bug?
Kind Regards and thanks in advance!
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04588 seconds