Bug 549254 - Quick Switch Editor: Highlight matching regions
Summary: Quick Switch Editor: Highlight matching regions
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: IDE (show other bugs)
Version: 4.12   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 4.13 M3   Edit
Assignee: Ünal Akkaya CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-07-14 15:20 EDT by Ünal Akkaya CLA
Modified: 2019-08-20 07:07 EDT (History)
2 users (show)

See Also:


Attachments
Issue when removing search term (113.35 KB, image/png)
2019-07-17 09:39 EDT, Matthias Becker CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ünal Akkaya CLA 2019-07-14 15:20:47 EDT
In the Quick Switch Editor (Ctrl+E) the highlighting of matching regions is missing.


Note:
There is a similar bug/fix: https://bugs.eclipse.org/bugs/show_bug.cgi?id=519302
But this is outdated and contains now syntax errors. Not sure why this was not merged.
Comment 1 Eclipse Genie CLA 2019-07-14 15:21:56 EDT
New Gerrit change created: https://git.eclipse.org/r/146056
Comment 2 Matthias Becker CLA 2019-07-15 11:12:08 EDT
(In reply to Ünal Akkaya from comment #0)
> Note:
> There is a similar bug/fix:
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=519302
> But this is outdated and contains now syntax errors. Not sure why this was
> not merged.
When I understand the discussion there correct the decision was to drop the "bold for hidden" editors feature.

We cannot use "bold" for the highlighting of the matches as well as for "hidden" editors.

So we the decision is still valid this change should also drop the "bold for "hidden" feature.
Comment 3 Ünal Akkaya CLA 2019-07-17 03:36:38 EDT
(In reply to Matthias Becker from comment #2)
> (In reply to Ünal Akkaya from comment #0)
> > Note:
> > There is a similar bug/fix:
> > https://bugs.eclipse.org/bugs/show_bug.cgi?id=519302
> > But this is outdated and contains now syntax errors. Not sure why this was
> > not merged.
> When I understand the discussion there correct the decision was to drop the
> "bold for hidden" editors feature.
> 
> We cannot use "bold" for the highlighting of the matches as well as for
> "hidden" editors.
> 
> So we the decision is still valid this change should also drop the "bold for
> "hidden" feature.

The bold styling of "hidden" editors are removed -> they're not bold anymore.
Comment 4 Andrey Loskutov CLA 2019-07-17 03:51:06 EDT
(In reply to Ünal Akkaya from comment #3)
> The bold styling of "hidden" editors are removed -> they're not bold anymore.

Sure they are.
Comment 5 Matthias Becker CLA 2019-07-17 09:37:21 EDT
(In reply to Andrey Loskutov from comment #4)
> (In reply to Ünal Akkaya from comment #3)
> > The bold styling of "hidden" editors are removed -> they're not bold anymore.
> 
> Sure they are.

With patchset 3 Ünal did remove the bold styling of "hidden" editor.

I like that.
Comment 6 Matthias Becker CLA 2019-07-17 09:39:08 EDT
Created attachment 279310 [details]
Issue when removing search term

When you type a search term (that appears in all entries in the list)the matches are highlighted correctly.

But when you remove it completely again the last highlight remains - some letters are still bold.

See screenshot
Comment 7 Matthias Becker CLA 2019-07-18 03:06:32 EDT
Patchset 5 looks good to me.
If I don't hear any objections I will merge tomorrow.
Comment 9 Ünal Akkaya CLA 2019-08-02 11:33:21 EDT
When user have more editors open then there is space for tabs a chevron is displayed on the right side which can be shown.
There are all editors, visible and hidden (in bold), listed and a filter text field is on top.

I tried to add this feature with highlighting the matching regions to the filtering of editors but failed.

The filtering is done in the ViewerFilter.filter(viewer, parent, elements) method.
At some point the CTabFolder.onSelection(e) is called and for the chevronItem the method showList(e) for all folderListerners are called.
This triggers the creation and update of all editors to show.

Among other logic the item in the Table will be updated. The class AbstractTableViewer is doing this in doUpdateItem(widget, element, fullMap) with the call columnViewer.refresh(cellToUpdate);

In ColumnLabelProvider the cell is updated in update(cell) and with cell.setFont(getFont(element)); for example the bold styling for hidden editors is done.
With the use of StyleRanges I tried to set the ranges which should be bold -> didn't work. Commenting out the cell.setFont(getFont(element)); didn't help.

The use of implementation IStyledLabelProvider for ColumnLabelProvider with the method getStyledText(element) doesn't work because at no point in time this method is called. I think there is something missing or can be enhanced to check if the labelProvider has implemented the IStyledLabelProvider and call the getStyledText instead of getText to render the text to show. I was not able to find such a place for enhancements.

There is also another issue to solve:
The filter pattern text needs to be known by the label provider to do the highlighting. Currently such information is not stored neither in Cell nor in CellItem.
Comment 10 Matthias Becker CLA 2019-08-06 09:13:08 EDT
(In reply to Ünal Akkaya from comment #9)
> When user have more editors open then there is space for tabs a chevron is
> displayed on the right side which can be shown.
> There are all editors, visible and hidden (in bold), listed and a filter
> text field is on top.
> 
> I tried to add this feature with highlighting the matching regions to the
> filtering of editors but failed.
> 
> The filtering is done in the ViewerFilter.filter(viewer, parent, elements)
> method.
> At some point the CTabFolder.onSelection(e) is called and for the
> chevronItem the method showList(e) for all folderListerners are called.
> This triggers the creation and update of all editors to show.
> 
> Among other logic the item in the Table will be updated. The class
> AbstractTableViewer is doing this in doUpdateItem(widget, element, fullMap)
> with the call columnViewer.refresh(cellToUpdate);
> 
> In ColumnLabelProvider the cell is updated in update(cell) and with
> cell.setFont(getFont(element)); for example the bold styling for hidden
> editors is done.
> With the use of StyleRanges I tried to set the ranges which should be bold
> -> didn't work. Commenting out the cell.setFont(getFont(element)); didn't
> help.
> 
> The use of implementation IStyledLabelProvider for ColumnLabelProvider with
> the method getStyledText(element) doesn't work because at no point in time
> this method is called. I think there is something missing or can be enhanced
> to check if the labelProvider has implemented the IStyledLabelProvider and
> call the getStyledText instead of getText to render the text to show. I was
> not able to find such a place for enhancements.
> 
> There is also another issue to solve:
> The filter pattern text needs to be known by the label provider to do the
> highlighting. Currently such information is not stored neither in Cell nor
> in CellItem.

I splitted this into bug 549817. So we can close this one.
Comment 11 Matthias Becker CLA 2019-08-20 07:07:29 EDT
verified with I20190819-2355