Bug 539624 - [codemining] Improve drastically draw of inlined header annotation by using StyledText#setLineVerticalIndent
Summary: [codemining] Improve drastically draw of inlined header annotation by using S...
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 4.8   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 4.10 M3   Edit
Assignee: Angelo ZERR CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 539618
Blocks: 529127 532822
  Show dependency tree
 
Reported: 2018-09-28 09:35 EDT by Angelo ZERR CLA
Modified: 2018-11-17 10:14 EST (History)
5 users (show)

See Also:


Attachments
Demo with improve of draw of inlined annotation (217.58 KB, image/gif)
2018-09-28 09:39 EDT, Angelo ZERR CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Angelo ZERR CLA 2018-09-28 09:35:09 EDT
When https://bugs.eclipse.org/bugs/show_bug.cgi?id=539618 will be merged, we will able to improve drastically draw of inlined header annotation by using StyleRange#marginTop

Today draw of inlined header annotation uses GlyphMetrics#ascent but there are a lot of problem with this solution:

 * using Glyphmetrics remove the character where it is setted, that's line header annotation redraw this character which provides some problem (ex: selection of this character has not black foreground).
 * when line which have line header annototation below is selected, blue background is done for line text and line header annotation (although it should keep blank).
 * matching bracket square has a too big height (the line text height + line header annotation height)
 * same problem when mark occurences is done for method (in JDT Java Editor)
 * same problem with square height when refactor is done for method (in JDT Java Editor) -> https://github.com/angelozerr/jdt-codemining/issues/6
Comment 1 Angelo ZERR CLA 2018-09-28 09:39:50 EDT
Created attachment 276049 [details]
Demo with improve of draw of inlined annotation

The gerrit patch https://git.eclipse.org/r/#/c/130151/ requires https://bugs.eclipse.org/bugs/show_bug.cgi?id=539618

You will see that code is more elegant and doesn't require to redraw of character. It fixes all issues with JDT mark occurences, square of refactoring, selection of line which set blue teh line header annotation, square of matching bracket, etc.
Comment 2 Eric Williams CLA 2018-11-16 14:03:46 EST
Angelo do you have a JFace snippet which reproduces this issue?
Comment 3 Angelo ZERR CLA 2018-11-16 15:12:14 EST
> Angelo do you have a JFace snippet which reproduces this issue?

No. Problems that I reported comes from users feedback of JDT CodeMining. Write a JFace snippet is a big work I think, sorry -(
Comment 4 Eric Williams CLA 2018-11-16 15:14:04 EST
(In reply to Angelo ZERR from comment #3)
> > Angelo do you have a JFace snippet which reproduces this issue?
> 
> No. Problems that I reported comes from users feedback of JDT CodeMining.
> Write a JFace snippet is a big work I think, sorry -(

So this issue is only visible when using code mining in the IDE?
Comment 5 Angelo ZERR CLA 2018-11-16 15:14:40 EST
In other words, if you install JDT CodeMining, you will see all problems that I have listed in the issue. If you apply my patch, you will see thoses problems will gone.
Comment 6 Eric Williams CLA 2018-11-16 15:15:53 EST
(In reply to Angelo ZERR from comment #5)
> In other words, if you install JDT CodeMining, you will see all problems
> that I have listed in the issue. If you apply my patch, you will see thoses
> problems will gone.

Okay thanks, I'll take a look.
Comment 7 Angelo ZERR CLA 2018-11-16 15:16:31 EST
> So this issue is only visible when using code mining in the IDE?

The uses cases is to have an editor which have several IPainter like mark occurrences, cursor line painter, etc which draws in the editor. It's not very symply to configure that with a simple snippet I think.
Comment 9 Mickael Istria CLA 2018-11-17 09:49:19 EST
Thanks Angelo!
Comment 10 Angelo ZERR CLA 2018-11-17 10:14:08 EST
Thanks Mickael!