Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 347128 - [package explorer] Project > Properties is disabled for Java elements without IResource or IProject adapter (in referenced library)
Summary: [package explorer] Project > Properties is disabled for Java elements without...
Status: CLOSED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.7   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on: 39468
Blocks:
  Show dependency tree
 
Reported: 2011-05-25 05:57 EDT by John CLA
Modified: 2020-01-24 19:09 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John CLA 2011-05-25 05:57:31 EDT
Build Identifier: I20110524-1000

When you're looking at a .class file in editor, and you see its source code(due to having specified a `Source attachment` for that .jar file, a .jar file which is used in your project) you find that Project->Properties is grayed out (aka disabled).

To workaround this you must click on any of the project's files (or project itself) in package explorer (it's not enough to just activate/focus package explorer even though that package is the one focused inside it), then Project->Properties is ungrayed and usable

Reproducible: Always

Steps to Reproduce:
read above?

Dani Megert said:
>We need to investigate whether we can register an IProject adapter on those Java elements.
Comment 1 Markus Keller CLA 2011-05-25 06:57:42 EDT
This is not a problem if the .class file is in a JAR or class folder that is stored inside the project.

The problem for elements in referenced package fragment roots (e.g. inside the JRE System Library or in other referenced libraries) is that these elements are shared across projects, so their enclosing project is not always correct.

The fix would have to be tailored specifically to the Package Explorer, where the parent chain is available from the ITreeSelection.
Comment 2 John CLA 2011-05-25 10:23:45 EDT
Usually (I'd guess) you get to the .class viewed as source (in my case) from a project (ie. via F3 open declaration) so maybe the editor or something can keep a reference of the place it came from and thus it would know the project it came from, this way I can open the same .class file from two different projects and each would know the project they were `initiated` from thus project->properties would be different for each.

So to speak it your way(I guess), when elements(in referenced package fragment roots) are opened in editor (or who knows what other kind of actions can be done on them) then they would also have a `parent` reference of some kind  knowing which project(if not more specifically) initiated the editor(in this case), thus a Project->Properties would be applied on this parent.getProject().

Respectfully,
me
Comment 3 Markus Keller CLA 2011-05-25 11:06:50 EDT
This is a long-standing design problem in the Java model, see bug 39468. We won't hack around this on the UI layer.
Comment 4 Eclipse Genie CLA 2020-01-24 19:09:28 EST
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. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. 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.