Bug 539446 - Show path in CTRL+E
Summary: Show path in CTRL+E
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.8   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Patrik Suzzi CLA
QA Contact:
URL:
Whiteboard:
Keywords: bugday, helpwanted, noteworthy, usability
Depends on:
Blocks: 540792
  Show dependency tree
 
Reported: 2018-09-26 01:51 EDT by Lars Vogel CLA
Modified: 2018-11-28 18:27 EST (History)
5 users (show)

See Also:


Attachments
Screenshot (61.50 KB, image/png)
2018-09-26 01:51 EDT, Lars Vogel CLA
no flags Details
Open Resource Dialog (Ctrl+Shift+R) (109.19 KB, image/png)
2018-10-15 19:26 EDT, Patrik Suzzi CLA
no flags Details
Example of Ctrl+E displaying the full path (193.79 KB, image/png)
2018-10-16 18:32 EDT, Patrik Suzzi CLA
no flags Details
Ctrl+E using IWorkbenchPart#getTooltip (327.04 KB, image/png)
2018-10-17 18:16 EDT, Patrik Suzzi CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lars Vogel CLA 2018-09-26 01:51:51 EDT
Created attachment 275980 [details]
Screenshot

CTRL+E should use a similar label provider as Ctrl+R to show the full path of the items. This allows to find the correct editor.
Comment 1 Patrik Suzzi CLA 2018-10-15 19:26:37 EDT
Created attachment 276249 [details]
Open Resource Dialog (Ctrl+Shift+R)

The dialog that shows path is implemented in FilteredResourcesSelectionDialog.
Comment 2 Patrik Suzzi CLA 2018-10-16 16:59:28 EDT
The label provider for Ctrl+E should be added in org.eclipse.ui.internal.WorkbookEditorsHandler.setLabelProvider(TableViewerColumn)
Comment 3 Patrik Suzzi CLA 2018-10-16 18:09:15 EDT
I am going to fix this by overriding WorkbookEditorsHandler.getWorkbenchPartReferenceText(.), where I'll return the previous text plus the path relative to the workspace.
Comment 4 Patrik Suzzi CLA 2018-10-16 18:32:47 EDT
Created attachment 276276 [details]
Example of Ctrl+E displaying the full path
Comment 5 Eclipse Genie CLA 2018-10-16 19:04:58 EDT
New Gerrit change created: https://git.eclipse.org/r/131025
Comment 6 Patrik Suzzi CLA 2018-10-16 19:08:23 EDT
Possible additional improvements:
a) Ctrl+e, type in the filter: filter applied only to file name and not the path
b) Add a checkbox on the bottom, to filter on nsme only or name + path when unchecked
Comment 7 Lars Vogel CLA 2018-10-17 15:43:35 EDT
(In reply to Patrik Suzzi from comment #6)
> Possible additional improvements:
> a) Ctrl+e, type in the filter: filter applied only to file name and not the
> path
> b) Add a checkbox on the bottom, to filter on nsme only or name + path when
> unchecked

Lets handle that via separate bugs.
Comment 8 Lars Vogel CLA 2018-10-17 15:43:54 EDT
(In reply to Patrik Suzzi from comment #4)
> Created attachment 276276 [details]
> Example of Ctrl+E displaying the full path

Looks great. :-)
Comment 10 Lars Vogel CLA 2018-10-17 16:15:13 EDT
Thanks Patrick, please add to N&N
Comment 11 Patrik Suzzi CLA 2018-10-17 16:22:29 EDT
(In reply to Lars Vogel from comment #10)
> Thanks Patrick, please add to N&N

Immediately. 

(In reply to Lars Vogel from comment #7)
> (In reply to Patrik Suzzi from comment #6)
> > Possible additional improvements:
> > a) Ctrl+e, type in the filter: filter applied only to file name and not the
> > path
> > b) Add a checkbox on the bottom, to filter on nsme only or name + path when
> > unchecked
> 
> Lets handle that via separate bugs.

Update: the Ctrl+E dialog filters only on the name of resources.

Do you think we should add a checkbox to the bottom to filter both on name and path?
Comment 12 Eclipse Genie CLA 2018-10-17 17:00:17 EDT
New Gerrit change created: https://git.eclipse.org/r/131095
Comment 14 Patrik Suzzi CLA 2018-10-17 18:16:59 EDT
Created attachment 276292 [details]
Ctrl+E using IWorkbenchPart#getTooltip

As suggested by Andrey, I am going to use the IWorkbenchPart#getTooltip to get the path and all the needed information on the file currently being edited. 

See attached image, showing how it works on editors for java code, java classes, images, text, and browsers.
Comment 15 Eclipse Genie CLA 2018-10-17 18:33:42 EDT
New Gerrit change created: https://git.eclipse.org/r/131098
Comment 17 Noopur Gupta CLA 2018-11-21 06:38:24 EST
It is causing bug 540792.
Comment 18 Lakshmi P Shanmugam CLA 2018-11-21 07:29:06 EST
(In reply to Eclipse Genie from comment #13)
> Gerrit change https://git.eclipse.org/r/131095 was merged to [master].
> Commit:
> http://git.eclipse.org/c/www.eclipse.org/eclipse/news.git/commit/?id=738abacc98a6bfe2089f2cd150162b2084ec2387
> 

Hi Patrik,
While reviewing the N&N, I found the text for this entry to be confusing. The text says "shows both the filename and the path of the resource currently being edited", but in the screenshot the path of all the files is shown. Also, it's not clear if it shows only relative path or full path. Can you please clarify?
Comment 19 Lakshmi P Shanmugam CLA 2018-11-23 06:36:05 EST
(In reply to Lakshmi Shanmugam from comment #18)
> (In reply to Eclipse Genie from comment #13)
> > Gerrit change https://git.eclipse.org/r/131095 was merged to [master].
> > Commit:
> > http://git.eclipse.org/c/www.eclipse.org/eclipse/news.git/commit/?id=738abacc98a6bfe2089f2cd150162b2084ec2387
> > 
> 
> Hi Patrik,
> While reviewing the N&N, I found the text for this entry to be confusing.
> The text says "shows both the filename and the path of the resource
> currently being edited", but in the screenshot the path of all the files is
> shown. Also, it's not clear if it shows only relative path or full path. Can
> you please clarify?

I removed "currently being edited" from the text. Here's the updated entry - https://www.eclipse.org/eclipse/news/4.10/platform.php#ctrl-e-show-path
Comment 20 Patrik Suzzi CLA 2018-11-28 18:27:42 EST
(In reply to Lakshmi Shanmugam from comment #18)
> 
> Hi Patrik,
> While reviewing the N&N, I found the text for this entry to be confusing.
> The text says "shows both the filename and the path of the resource
> currently being edited", but in the screenshot the path of all the files is
> shown. Also, it's not clear if it shows only relative path or full path. Can
> you please clarify?

It is displaying the path stored in the Editor > Tooltip. 
- for some resources, it is possible to display the file path
- for others, like those contained in an archive, there is a different way to compute the path. 

After discussing with Andrey in https://git.eclipse.org/r/#/c/131025/, I decided the best way to display the resource path is to reuse WorkbenchPartReference#getTitleToolTip()