Community
Participate
Working Groups
Created attachment 252304 [details] Test project Using Eclipse SDK 4.5-I20150408-1100 For example, I have a plugin in my workspace that depends on o.e.jface. If I open JFaceResources, I cannot navigate to the import "org.eclipse.core.runtime.FileLocator", even if I have the source jar in my target platform. I realize this might be by design but it's not very practical. I have to resort to adding org.eclipse.core.runtime to the required bundle of some dummy plugin in my workspace. I attached an example project. 1. Import the project into the workspace (with no other project opened) 2. Open JFaceResources with Open Type dialog (Ctrl-Shift-T). 4. In the imports, try to navigate to org.eclipse.core.runtime.FileLocator using the hyperlink.
Moving to platform UI for comments
This is not a UI bug, it's PDE (or JDT) not computing the fact that the class can be found on the classpath.
Moving to JDT core for analysis.
I think it could be JDT UI.
Unfortunately target platform doesn't influence the project's build path, which is what JDT relies on to find types. Anyway, JDT UI has nothing to do with it, if the types are made available from Core, there will be hyperlinks. I don't think we have the resources to invest in it at the moment, though.
This is essentially the problem from bug 73957 comment 50. A workaround to at least get FileLocator in the Open Type dialog is to enable Preferences > Plug-in Development > Include all plug-ins from target in Java search. That creates/maintains the dummy "External Plug-in Libraries" project in your workspace.
(In reply to Markus Keller from comment #6) > This is essentially the problem from bug 73957 comment 50. > > A workaround to at least get FileLocator in the Open Type dialog is to > enable Preferences > Plug-in Development > Include all plug-ins from target > in Java search. That creates/maintains the dummy "External Plug-in > Libraries" project in your workspace. Interesting, I tried enabling that but it didn't fix the problem for the hyperlink (at first) but it did work for the Open Type dialog. But after closing and reopening the project it worked for the hyperlink as well. I can reproduce this behavior with the test project. So from my perspective, this is what could be improved: the fact that the project has to be reopened for hyperlink to start working. Restarting Eclipse also doesn't fix it, only closing and reopening the project.
In my experience, opening "JFaceResources" doesn't do something predictable. It opens the class in the context of the "first" project that happens to have that class on its classpath (turn on breadcrumbs to see this). You end up limited to what JFaceResource can see in that arbitrary project. Closing and reopening the project just reshuffles the order of all of the projects, which changes where "JFaceResource" is found. This problem also confuses the debugger when trying to evaluate snippets, use content assist, custom formatters, etc.
(In reply to Randy Hudson from comment #8) > In my experience, opening "JFaceResources" doesn't do something predictable. > It opens the class in the context of the "first" project that happens to > have that class on its classpath (turn on breadcrumbs to see this). Nice trick! (breadcrumbs) > Closing > and reopening the project just reshuffles the order of all of the projects, > which changes where "JFaceResource" is found. OK that makes sense and would explain the behavior I see. So I think if "Include all plug-ins from target in Java search" is enabled, it should always try to find the classes (from a plugin dependency) in the context of External Plug-in Libraries.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.