Bug 505740 - [render] Icon decoration for packages with restricted access
Summary: [render] Icon decoration for packages with restricted access
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.7   Edit
Hardware: All All
: P5 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-11 15:17 EDT by Andras Kerekes CLA
Modified: 2016-10-13 10:55 EDT (History)
2 users (show)

See Also:


Attachments
icon decoration mock up for discouraged/forbidden packages (25.83 KB, image/png)
2016-10-11 15:17 EDT, Andras Kerekes CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andras Kerekes CLA 2016-10-11 15:17:03 EDT
Created attachment 264786 [details]
icon decoration mock up for discouraged/forbidden packages

When a jar is added to the build path of a project and it has access rules defined that forbid/discourage the usage of some packages inside the jar, it'd be useful to put a decoration on the icon of the package in the package explorer to indicate that those packages are not forbidden/discouraged.

The attached mock-up shows what I'm thinking about.
Comment 1 Dani Megert CLA 2016-10-12 11:50:11 EDT
I don't think this adds much value. More important is that you don't see types that are forbidden. You can also decide to hide discouraged types (see 'Type Filters' preference page).
Comment 2 Stephan Herrmann CLA 2016-10-12 19:25:21 EDT
Could the deprecation strike-through be re-used for discouraged content?
Comment 3 Dani Megert CLA 2016-10-13 06:09:55 EDT
(In reply to Stephan Herrmann from comment #2)
> Could the deprecation strike-through be re-used for discouraged content?

No. Packages can also be deprecated, but we currently don't decorate them in the UI. Plus, there are two access restrictions: discouraged and forbidden.
Comment 4 Stephan Herrmann CLA 2016-10-13 06:18:05 EDT
(In reply to Dani Megert from comment #3)
> (In reply to Stephan Herrmann from comment #2)
> > Could the deprecation strike-through be re-used for discouraged content?
> 
> No. Packages can also be deprecated, but we currently don't decorate them in
> the UI. Plus, there are two access restrictions: discouraged and forbidden.

I was thinking of filtering "forbidden" and decorating "discouraged". But I didn't think of deprecated packages, so that would be ambiguous...

Was it an active decision not to decorate deprecated packages? 
(Does deprecation of packages even happen in real life?)
Comment 5 Dani Megert CLA 2016-10-13 06:22:52 EDT
(In reply to Stephan Herrmann from comment #4)
> (In reply to Dani Megert from comment #3)
> > (In reply to Stephan Herrmann from comment #2)
> > > Could the deprecation strike-through be re-used for discouraged content?
> > 
> > No. Packages can also be deprecated, but we currently don't decorate them in
> > the UI. Plus, there are two access restrictions: discouraged and forbidden.
> 
> I was thinking of filtering "forbidden" and decorating "discouraged". But I
> didn't think of deprecated packages, so that would be ambiguous...
> 
> Was it an active decision not to decorate deprecated packages? 
> (Does deprecation of packages even happen in real life?)

No, I don't think so. There was just no request so far.
Comment 6 Andras Kerekes CLA 2016-10-13 10:55:45 EDT
In my opinion the value of this enhancement is that:
 - if the package/class is forbidden it will not show up in code completion/Open Type/etc., but it's fully visible in the Package Explorer without any indication why it's excluded from the list of suggestions
 - similarly for discouraged packages/classes there's no indication in the Package Explorer about it's status

I often try to figure out which class to use by browsing the jars under project dependencies, and it would be helpful to immediately see which ones are accessible on which level.

Hiding discouraged types does not provide the same experience in my opinion.