Bug 314283 - [package explorer][render] Decorator on CUs for deprecated and package-visible
Summary: [package explorer][render] Decorator on CUs for deprecated and package-visible
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.6   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 3.7 M1   Edit
Assignee: Markus Keller CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 318224
  Show dependency tree
 
Reported: 2010-05-25 10:40 EDT by Ivan CLA
Modified: 2016-10-19 05:15 EDT (History)
6 users (show)

See Also:


Attachments
First try (4.65 KB, patch)
2010-05-28 08:23 EDT, Markus Keller CLA
no flags Details | Diff
Screenshots (87.38 KB, image/bmp)
2010-05-31 09:12 EDT, Markus Keller CLA
no flags Details
Fix (9.78 KB, patch)
2010-06-23 12:31 EDT, Markus Keller CLA
no flags Details | Diff
Scrambled icon (10.85 KB, image/png)
2010-07-07 09:38 EDT, Dani Megert CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ivan CLA 2010-05-25 10:40:38 EDT
Build Identifier: 20100318-1801

In the Preferences window (General->Appearance->Label Decorations) user can set a check-box "Java Type Indicator". If the box is checked, small icons appear in the Package Explorer: I (interface), A (abstract), E (enum).
I propose the following extensions:
1) (more important). Add check-box "Java Deprecated Decorator" which means that deprecated classes will be highlighted somehow in Package Explorer. At once I can imagine 3 variants a) strike-out; b) italic; c) diagonal line like in Outline. As for me, (a) strike-out is the best variant (if the name of a class remains readable).
2) (less important). Add the check-box "Java Throwable Indicator/Decorator"  for Throwable and possibly for abstract Throwable (because Throwable can be abstract also). It can be a) Indicator, so small icon will be shown for Throwable (maybe letter "T" and letters "AT" for abstract one). Or b) Decorator and the name of the class become italic for example (if deprecated decorator is not italic) or something like this.

Reproducible: Always

Steps to Reproduce:
1. Open Package Explorer.
Comment 1 Markus Keller CLA 2010-05-28 08:23:35 EDT
I once started to experiment with a "deprecated" overlay, but gave up after the first tries. In the Outline view, the diagonal line is painted behind the icon, but that doesn't work for the compilation unit icon, since that one is too big.

Next try was to paint the line on top of the icon, but that also draws on top of the problem indicator in the lower left. Could try it again with redrawing the problem overlay in the decorator.
Comment 2 Markus Keller CLA 2010-05-28 08:23:55 EDT
Created attachment 170333 [details]
First try
Comment 3 Ivan CLA 2010-05-31 03:30:03 EDT
Hi Markus.
Thanks for your reply.

Unfortunately I am not very familiar with Eclipse internal structure, so I cannot try this patch by myself.
Btw, what about striking-out the name (not icon) of deprecated class?
Comment 4 Markus Keller CLA 2010-05-31 09:12:49 EDT
Created attachment 170519 [details]
Screenshots

I've tried it with drawing the problem overlay again in the decorator, see the screenshot on the left. But that way, the deprecation is hardly visible unless the type is a class.

I guess we better take the right hand side, where the "deprecated" bar is drawn on top of the problem overlay.

We once considered rendering deprecated with a strikeout text, but we also didn't do this in other places because it make the text hard to read. We won't use a different rendering for "deprecated" than the well-known diagonal line. But of course, you're free to write your own plug-in that does it differently (take the a look at the InterfaceIndicatorLabelDecorator for how to implement this).
Comment 5 Ivan CLA 2010-06-01 08:24:14 EDT
Thanks Markus.

As for me, the right variant (on the screenshot) fits my needs and I think many developers want it too.
Btw, this decorator is generally useful for *.class files from jars rather than for own code, so problem-decorator (warnings, errors etc) will be rarely mixed with deprecated-decorator.

Is there any chance to include this decorator into official release? Or where it can be downloaded separately?

Maybe I will also do some manipulations with it, but not earlier that in a couple of months.
Comment 6 Markus Keller CLA 2010-06-01 09:27:20 EDT
OK, I'll do that for 3.7. The attached patch already implements this, but needs some polish to make it understandable.

And I'll probably also include bug 168520.
Comment 7 Ivan CLA 2010-06-01 13:04:08 EDT
(In reply to comment #6)
> OK, I'll do that for 3.7. The attached patch already implements this, but needs
> some polish to make it understandable.
> 
> And I'll probably also include bug 168520.

Btw, why not to include it into 3.6 RC3?
Comment 8 Markus Keller CLA 2010-06-01 13:42:25 EDT
(In reply to comment #7)
First, because RC3 has already been shipped, and second, because we're in the stabilization phase and only fix serious defects (i.e. don't add new features):
http://www.eclipse.org/eclipse/development/plans/freeze_plan_3.6.php#FixPassAfterRC3
Comment 9 Markus Keller CLA 2010-06-23 12:31:20 EDT
Created attachment 172530 [details]
Fix

Adds 'deprecated' and 'package visible' overlays (the latter is for bug 168520). Also needs /org.eclipse.jdt.ui/icons/full/ovr16/default_tsk.gif.
Comment 10 Markus Keller CLA 2010-06-23 12:32:51 EDT
Fixed in HEAD.
Comment 11 Dani Megert CLA 2010-07-07 09:35:23 EDT
Sorry, but this looks too ugly/scrambled, e.g. the deprecation line is drawn over the icon hiding the 'J' and also problem decorators. We either need to find a better way or leave it.
Comment 12 Dani Megert CLA 2010-07-07 09:38:37 EDT
Created attachment 173650 [details]
Scrambled icon
Comment 13 Markus Keller CLA 2010-07-08 08:03:27 EDT
It's always a tradeoff, and that's the best solution I found. What do you propose?

I don't want to drop this useful feature just because it doesn't look perfect in some cases. I actually think it looks fine, and I don't think users will have a problem understanding what's going on. Also remember that the case with a single CU in one package is not relevant in practice -- you normally have a lot more context.
Comment 14 Dani Megert CLA 2010-08-03 03:26:37 EDT
>It's always a tradeoff, and that's the best solution I found. What do you
>propose?
Not to add the feature unless we find a decent solution. One thing could be additional support in Platform UI that allows to draw decorations behind the current image.
Comment 15 Markus Keller CLA 2010-08-03 05:54:04 EDT
> additional support in Platform UI that allows to draw decorations behind the
> current image.

Technical issues can be attacked later -- we first need a solution that is visually pleasing in all cases. See comment 4 (left screenshot) for how hard to see deprecated types are when the '/' is behind the warning and type info adornments. Drawing the '/' behind the 'J' would show even less of the '/'.
Comment 16 Dani Megert CLA 2010-08-03 05:59:58 EDT
If we'd change '/' to '\' it would probably destroy less info.
Comment 17 Raksha Vasisht CLA 2010-08-03 07:20:06 EDT
Verified the enablement with I20100802-1800.
Comment 18 Markus Keller CLA 2010-12-05 12:07:55 EST
> If we'd change '/' to '\' it would probably destroy less info.
That's not an option since '/' is already used everywhere and '\' already means 'Hide' in view filter toolbar buttons.
Comment 19 Markus Keller CLA 2011-03-02 06:16:50 EST
In practice, the "scrambled icons" problem doesn't show up often, and we didn't get any other complaints about this so far. We're going to live with current solution for now.

See bug 318224 for improvements in the Synchronize view and Commit dialog.
Comment 20 Dani Megert CLA 2011-03-02 06:20:24 EST
(In reply to comment #19)
> In practice, the "scrambled icons" problem doesn't show up often, and we didn't
> get any other complaints about this so far. We're going to live with current
> solution for now.
> 
> See bug 318224 for improvements in the Synchronize view and Commit dialog.

Point taken.