Bug 215729 - [common navigator] ISetSelectionTarget.selectReveal(..) does not work unless element has been previously revealed
Summary: [common navigator] ISetSelectionTarget.selectReveal(..) does not work unless ...
Status: RESOLVED DUPLICATE of bug 275847
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.5   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 262097
  Show dependency tree
 
Reported: 2008-01-17 18:11 EST by Vikas Trivedi CLA
Modified: 2009-06-15 05:44 EDT (History)
2 users (show)

See Also:


Attachments
Suggested patch (713 bytes, patch)
2009-02-05 17:17 EST, Francis Upton IV CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Vikas Trivedi CLA 2008-01-17 18:11:14 EST
Build ID: 3.3.2

Steps To Reproduce:
1. Create a Java Class Ca in package pa in Java Project JP
2. Ensure that the Project Explorer has either not been activated or at the very least, the JP node has not been expanded to reveal Ca. 
3. Execute code indicated below using the IType handle representing Ca as the selection
RESULT: Project Explorer view is created / given focus but JP is not expanded to reveal Ca.
4. Now manually expand JP to reveal Ca. Select any element on the Project Explorer.
5. Re-execute Step 3.
RESULT: Ca is now selected.

*Requires an Action / client code that uses ISetSelectionTarget.selectReveal(<selection containing JDT IType>) on the Project Explorer view (org.eclipse.ui.navigator.ProjectExplorer). 

More information:
The problem appears to be in AbstractTreeViewer.internalExpand(Object elementOrPath, boolean expand) where after recursively going up the parent path to Workspace root ... it is unable to obtain a widget for the project (JP in this example).
Comment 1 Vikas Trivedi CLA 2008-03-20 13:30:09 EDT
Any estimate on when this would be resolved? This is blocking customer requested functionality for us.
Comment 2 Francis Upton IV CLA 2008-08-26 03:31:46 EDT
Can you verify this is still happening in 3.4?  I tried link with editor using the project exlorer in 3.4 and closed the Java project and selected the file contained in that project in the editor and it worked fine.  It uses a similar method calling selectReveal() on the CommonNavigator.  If it's still a problem and you really want it fixed quickly, submit a patch for a test case for this in org.eclipse.ui.tests.navigator.
Comment 3 Francis Upton IV CLA 2009-02-05 17:17:55 EST
Created attachment 124895 [details]
Suggested patch

The problem is the CNF cannot resolve the parent of the java element because of a mis configuration.  The possibleChildren need to include anything for which a parent is sought.
Comment 4 Dani Megert CLA 2009-05-25 06:15:17 EDT

*** This bug has been marked as a duplicate of bug 275847 ***