Bug 320473 - [CommonNavigator] Project Explorer Link with Editor
Summary: [CommonNavigator] Project Explorer Link with Editor
Status: NEW
Alias: None
Product: WTP Java EE Tools
Classification: WebTools
Component: jst.j2ee (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 minor with 1 vote (vote)
Target Milestone: Future   Edit
Assignee: Carl Anderson CLA
QA Contact: Chuck Bridgham CLA
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2010-07-21 05:11 EDT by Hajo Thelen CLA
Modified: 2012-05-02 03:37 EDT (History)
6 users (show)

See Also:


Attachments
situation after startup with different tree views (121.64 KB, image/png)
2010-11-10 04:33 EST, Hajo Thelen CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Hajo Thelen CLA 2010-07-21 05:11:03 EDT
The "Link With Editor" function often fails to synchronize selected file with the one currently opend in the editor.

The Navigator Tree works fine.

-- Configuration Details --
Product: Eclipse 1.3.0.20100617-0521 (org.eclipse.epp.package.jee.product)
Installed Features:
 org.eclipse.jdt 3.6.0.v20100526-0800-7z8XFUJFMTfCWGoVuHImpms9H155
Comment 1 Remy Suen CLA 2010-07-21 06:37:14 EDT
(In reply to comment #0)
> The "Link With Editor" function often fails to synchronize selected file with
> the one currently opend in the editor.

Do you have some steps to reproduce the problem?
Comment 2 Hajo Thelen CLA 2010-07-21 06:58:40 EDT
Ok! Some more Details :

Im using the Java EE Perpectie.

 0. Eclipse is closed with some open files.
 1. Now Eclipse is started again.
 2.a Some file (tab) is activated and should be highlighted in the Project Explorer.
 2.b If another file is selcted (by tab) an this one should be highlighted in the Project Explorer.
 3. Toggle "Link with Editor" has no effect

2.a and 2.b somtimes fail. 

It seems to me that this issue depends on the project type. If the project is a plain Java project highlighting works. If the project is is a "Dynamic Web Project" it fails.

If I once have selected a file from the Project Explorer highlighting works fine.
Comment 3 Francis Upton IV CLA 2010-08-11 11:41:50 EDT
Moving this to webtools since it seems to be specific to their types of projects. Perhaps there is a link helper that is handling these?
Comment 4 David Williams CLA 2010-09-27 10:19:26 EDT
what editors are open? And, what is the file type of what's in the editor? 

(html open in a web browser never seems to work ... but sounds like this is something else).
Comment 5 Nitin Dahyabhai CLA 2010-09-27 11:25:28 EDT
Like Francis said, this requires the contribution of a LinkHelper, which doesn't happen anywhere in SSE.  Without information about what kind of file, the kind of project, and where in the project the file is located, there's really nothing we can do.
Comment 6 Hajo Thelen CLA 2010-09-29 04:42:56 EDT
(In reply to comment #4)
> what editors are open? And, what is the file type of what's in the editor?
> 
> (html open in a web browser never seems to work ... but sounds like this is
> something else).

I've seen this with the Java Editor.
Comment 7 Nitin Dahyabhai CLA 2010-10-31 22:55:51 EDT
Can you attach the project in which this is happening?
Comment 8 Hajo Thelen CLA 2010-11-10 04:33:23 EST
Created attachment 182794 [details]
situation after startup with different tree views
Comment 9 Hajo Thelen CLA 2010-11-10 04:33:52 EST
Ok, I think it seems there is an important information missing.

 * The problem occurs in the *Project Explorer*. 
 * Navigator and Java Package Explorer working fine.

 It can be seen with a simple *Dynamic Web Project* (for instance)
 
 The screenshot shows how it looks like after startup.
Comment 10 Nitin Dahyabhai CLA 2010-11-10 16:56:00 EST
Moving to Java EE.
Comment 11 Carl Anderson CLA 2010-11-12 14:44:44 EST
Hajo, we have one other report of an unreproducible scenario where the Java Resources node is missing from the Project Explorer.

We also do not provide any sorts of link helpers - the JDT link helper is used to do this synchronization.

Can you reproduce this scenario, and then expand the project in the Project Explorer to see if the Java Resources node exists and has children?

I am assigning this bug to myself for the initial investigation/follow through, but this is temporary until I find the correct home for this bug.
Comment 12 Hajo Thelen CLA 2010-11-17 04:33:45 EST
If I expand the node everything exists : file, class and functions. 

One more detail : 
If the node is expanded in Project Explorer and the file (MT1.java) becomes active the file node is highlighted (!). 

If another open (which was also open at startup) file is activated the node is still not expanded.

-> It seems linking (or the JDT link hepler) as such works but the tree expansion fails.
Comment 13 Dani Megert CLA 2010-11-17 04:43:39 EST
Can you also reproduce in the 'Java' perspective and a simple Java project?
Comment 14 Axel Mueller CLA 2011-08-31 02:59:24 EDT
I have got an identical problem with C/C++ projects after upgrading from Helios to Indigo.
"Link to editor" works in Navigator but fails in Project Explorer and C/C++ Explorer.
As described in comment #12 it seems that the tree expansion does not work. When I expand the tree manually "Link to editor" works flawlessly for every file in a completely expanded folder but still fails for files in unexpanded folders. Interestingly, once "Link to editor" is working for a specific file I can unexpanded the tree and it will be expanded as soon as I refocus it in the editor.
Comment 15 Axel Mueller CLA 2011-08-31 03:06:49 EDT
(In reply to comment #14)
> "Link to editor" works in Navigator but fails in Project Explorer and C/C++
> Explorer.
Bug only happens for C/C++ projects. No problem with simple resource projects. Therefore, I opened a new bug request #356275 for CDT.
Comment 16 Mauro Molinari CLA 2011-11-25 03:08:36 EST
I provided a simple test case that demonstrates this issue in a particular case (Java file located outside the Java Build Path) in bug #364789.

However, in the past I saw this problem occur with other file types, too, like XMLs or WSDLs. Maybe the problem was again they were outside of the Java Build Path, but I couldn't remember well, so the problem reported here might (or might not) be more general than the one reported in bug #364789.