Bug 153728 - Provide an action to copy the filename + Path to the clipboard
Provide an action to copy the filename + Path to the clipboard
Status: RESOLVED FIXED
Product: utilities
Classification: Unclassified
Component: Code
6.x
All All
: P3 with 14 votes (vote)
: 7.3
Assigned To: Jaroslav Havlin
issues@utilities
: PLAN
: 106788 156048 160337 170203 171220 171222 180835 214515 221418 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-11-23 23:40 UTC by Petr Pisl
Modified: 2013-10-03 11:57 UTC (History)
12 users (show)

See Also:
Issue Type: ENHANCEMENT
:


Attachments
PathTools NBM built from post-6.9 coudebase (26.48 KB, application/octet-stream)
2010-06-18 10:53 UTC, Vitezslav Stejskal
Details
Proposed copyToClipboard action (7.24 KB, application/zip)
2012-08-23 23:38 UTC, markiewb
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Pisl 2008-11-23 23:40:13 UTC
Based on a user feedback:

A really great little feature would be if a right-click on the file tab would allow you to copy the filename+path to the
clipboard. This is possible in PsPAD and it is very addictive
Comment 1 faheemhameed 2008-12-19 09:39:03 UTC
I also want to see the full path of the current file in the IDE title bar.

This is actually an important thing for me.
Comment 2 softcarlos 2009-02-11 18:07:21 UTC
i'nedd this!
this is basic!
Comment 3 Vitezslav Stejskal 2009-09-08 10:17:12 UTC
*** Issue 160337 has been marked as a duplicate of this issue. ***
Comment 4 Vitezslav Stejskal 2009-09-08 10:17:32 UTC
*** Issue 171220 has been marked as a duplicate of this issue. ***
Comment 5 adam.spiers 2009-11-13 16:36:32 UTC
This is really basic functionality - one of the first things I noticed missing when I started using NetBeans a couple of months ago.
Comment 6 Michel Graciano 2009-11-13 18:14:13 UTC
Take a look at this plugin [1]. This should solve your problem.

Regards
[1] http://plugins.netbeans.org/PluginPortal/faces/PluginDetailPage.jsp?pluginid=676
Comment 7 rcasha 2009-11-13 20:54:23 UTC
That plugin only works until version 6.0
Comment 8 Michel Graciano 2009-11-14 07:10:29 UTC
(In reply to comment #7)
> That plugin only works until version 6.0

No, not really. I am using this for all 6.X version without any problem. Try it and let me know if you face any problem.
Comment 9 Michel Graciano 2010-02-18 05:01:17 UTC
*** Bug 156048 has been marked as a duplicate of this bug. ***
Comment 10 Michel Graciano 2010-02-18 05:01:53 UTC
*** Bug 180835 has been marked as a duplicate of this bug. ***
Comment 11 holub 2010-06-18 08:21:41 UTC
+1 for copying file name/path from tab and from context menu in the Projects/Files windows
Comment 12 Vitezslav Stejskal 2010-06-18 10:47:03 UTC
(In reply to comment #8)
> (In reply to comment #7)
> > That plugin only works until version 6.0
> 
> No, not really. I am using this for all 6.X version without any problem. Try it
> and let me know if you face any problem.

Well, the problem here is that there is no public official place to get the latest version of this plugin from. The plugin portal contains an obsolete (old) version and presumably the only person, who could update it is Sandip. Moreover, the plugin is not included in the experimental cluster and so is not available in the 'Latest Development Build' update center either.

So, the only way how to get hold of the latest version is to build it from sources. I did that and can confirm that the plugin works fine in the current trunk (ie. post-6.9 codebase, but close enough to 6.9 to be pretty sure that it is going to work in Nb6.9 build). Unfortunately (and quite understandably), building from sources is not something an average user would want to do.
Comment 13 Vitezslav Stejskal 2010-06-18 10:53:48 UTC
Created attachment 100199 [details]
PathTools NBM built from post-6.9 coudebase
Comment 14 Jesse Glick 2011-10-31 14:58:35 UTC
Current workaround: S-F4 A-P C-A C-C ESC
Comment 15 markiewb 2012-01-19 20:37:14 UTC
Pathtools works with NB-7.1. Three people confirmed it in http://plugins.netbeans.org/PluginPortal/faces/PluginDetailPage.jsp?pluginid=676 - see the comments.

(Version: 1.4 Source: 1210303533494_org-netbeans-modules-pathtools.nbm)
Comment 16 mark_barnes 2012-08-23 17:28:38 UTC
I installed Path Tools on 7.2 and restarted. I can't see any changes to context menus.
Comment 17 mark_barnes 2012-08-23 17:45:50 UTC
I spoke too soon.  I installed version 1.5 from a link in the previous comment and it now works.

But... there's still nothing added to the context menu for TABS!

I also have CoolEditorActions 1.3.1, which claims to add this functionality to a new menu in the Editor Toolbar.  It doesn't.  Not for 7.2, anyway.  It adds the menu alright, but in includes only "Open in System", "Explore in System", "Select in Projects", "Select in Files" for each component in the path. Cool!  No copy path to clipboard, however.

There's also CopyQualifiedName 1.0.  It adds "Copy qualified name" to the Editor Context Menu.
Comment 18 markiewb 2012-08-23 17:59:09 UTC
(In reply to comment #17)
> I spoke too soon.  I installed version 1.5 from a link in the previous comment
> and it now works.
> 
> But... there's still nothing added to the context menu for TABS!

Yes you are right. There is no menu entry for the tab. BUT you can click the tab to focus the document and then press the icon for "Copy Path".

> 
> I also have CoolEditorActions 1.3.1, which claims to add this functionality to
> a new menu in the Editor Toolbar.  It doesn't.  Not for 7.2, anyway.  It adds
> the menu alright, but in includes only "Open in System", "Explore in System",
> "Select in Projects", "Select in Files" for each component in the path. Cool! 
> No copy path to clipboard, however.
> 

I did not see any claim at the plugin site (at the first glance) that this feature is supported.

> There's also CopyQualifiedName 1.0.  It adds "Copy qualified name" to the
> Editor Context Menu.

What the point with the plugin?
Comment 19 mark_barnes 2012-08-23 18:14:07 UTC
(In reply to comment #18)
> (In reply to comment #17)
> > I spoke too soon.  I installed version 1.5 from a link in the previous comment
> > and it now works.
> > 
> > But... there's still nothing added to the context menu for TABS!
> 
> Yes you are right. There is no menu entry for the tab. BUT you can click the
> tab to focus the document and then press the icon for "Copy Path".

Not as convenient, but workable.  I'd rather not have to switch files just to get the path into the clipboard.  Not even the drop-down on the tab group that lists all the files in the tab group can do it.  Now that would be convenient. 

 
> > I also have CoolEditorActions 1.3.1, which claims to add this functionality to
> > a new menu in the Editor Toolbar.  It doesn't.  Not for 7.2, anyway.  It adds
> > the menu alright, but in includes only "Open in System", "Explore in System",
> > "Select in Projects", "Select in Files" for each component in the path. Cool! 
> > No copy path to clipboard, however.
> > 
> 
> I did not see any claim at the plugin site (at the first glance) that this
> feature is supported.

Sorry. Previous version claimed it in the Plugin Description.  I hadn't noticed the claim was gone in the newer version.


> > There's also CopyQualifiedName 1.0.  It adds "Copy qualified name" to the
> > Editor Context Menu.
> 
> What the point with the plugin?

More convenient than having to go all the way up to the toolbar.
Comment 20 markiewb 2012-08-23 19:43:06 UTC
(In reply to comment #19)
> (In reply to comment #18)
> > (In reply to comment #17)
> > > I spoke too soon.  I installed version 1.5 from a link in the previous comment
> > > and it now works.
> > > 
> > > But... there's still nothing added to the context menu for TABS!
> > 
> > Yes you are right. There is no menu entry for the tab. BUT you can click the
> > tab to focus the document and then press the icon for "Copy Path".
> 
> Not as convenient, but workable.  I'd rather not have to switch files just to
> get the path into the clipboard.  Not even the drop-down on the tab group that
> lists all the files in the tab group can do it.  Now that would be convenient. 

I looked it up. It is very easy to integrate the existing 'copy path'-action into the contextmenu of the tab - as you see in http://wiki.netbeans.org/DevFaqActionAddTabPopup - and to integrate in the contextmenu of the current file. 

BUT the pathtools plugin seams to be unmaintained and cannot be extended this way. Providing a thirdparty-plugin to integrate a thirdparty-plugin is not reasonable.

In the end i could do it on my own. I'll provide a contributer-patch in a few days, which reimplements the action and the registration in the contextmenu of the tab and the editor. This way the requested feature could go into the next version of NetBeans IDE.
Comment 21 markiewb 2012-08-23 23:38:04 UTC
Created attachment 123488 [details]
Proposed copyToClipboard action

(In reply to comment #20)
> In the end i could do it on my own. I'll provide a contributer-patch in a few
> days, which reimplements the action and the registration in the contextmenu of
> the tab and the editor. This way the requested feature could go into the next
> version of NetBeans IDE.

Attached sample code. @NetBeans-Dev: Please review and commit.

Action is shown 
* in context menu of tab (as requested)
* as menu item in menu bar at Edit
* in context menu of every editor (as requested)
It supports DataShadows, so the path of items in the favorites window can be copied properly. 
It support items within JAR-files.
It does not support projects.

ToDos:
- moving to correct package / module
- needs testing / simple unit test required
- repositioning of item within the menu
Comment 22 Jaroslav Havlin 2012-09-11 09:16:14 UTC
Thank you very much for providing the patch!

> Action is shown 
> * in context menu of tab (as requested)
OK
> * as menu item in menu bar at Edit
> * in context menu of every editor (as requested)
The new action was not added to these menus (maybe later).

The default actions was set to Alt-Shift-L.

> ToDos:
> - moving to correct package / module
Done. Moved to module utilities.
> - needs testing / simple unit test required
Done.
> - repositioning of item within the menu
Done.

I've slightly modified the implementation to support multiple selected files.
If you select some nodes in Projects window and press Alt-Shift-L, all paths will be copied to clipboard, separated by new line character.

http://hg.netbeans.org/core-main/rev/5dd35e929ad7
Comment 23 Quality Engineering 2012-09-12 02:10:01 UTC
Integrated into 'main-golden', will be available in build *201209120001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/5dd35e929ad7
User: Jaroslav Havlin <jhavlin@netbeans.org>
Log: #153728 - Provide an action to copy the filename + Path to the clipboard
Comment 24 markiewb 2012-09-25 18:19:00 UTC
*** Bug 171222 has been marked as a duplicate of this bug. ***
Comment 25 markiewb 2012-09-28 22:27:44 UTC
*** Bug 170203 has been marked as a duplicate of this bug. ***
Comment 26 Jesse Glick 2012-09-29 12:10:01 UTC
" " would arguably be a more convenient separator than "\n" (or "\r\n") for typical purposes such as pasting into a shell/batch command line. Of course a newline is a bit safer when file paths may contain ' ' as is commonplace on Windows.

archiveFileName can never be null so it is senseless to check for it; just use archiveFileName.isEmpty().

It is conventional to place @Messages on the nearest enclosing element using particular keys, in this case setClipboardContents for CTL_Status_CopyToClipboardMulti and CTL_Status_CopyToClipboardSingle.
Comment 27 Jaroslav Havlin 2012-10-04 12:49:02 UTC
http://hg.netbeans.org/core-main/rev/c1d4f6ae2209

(In reply to comment #26)
> " " would arguably be a more convenient separator than "\n" (or "\r\n") [...]
Certainly. Paths that contain spaces are quoted. That hopefully works fine on both Windows and Unix.

> Just use archiveFileName.isEmpty() [...]
> It is conventional to place @Messages on the nearest enclosing element [...]
OK

Thank you.
Comment 28 Quality Engineering 2012-10-07 02:02:03 UTC
Integrated into 'main-golden', will be available in build *201210070002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/c1d4f6ae2209
User: Jaroslav Havlin <jhavlin@netbeans.org>
Log: #153728: Use space as separator for copied file paths, code cleanup
Comment 29 markiewb 2012-10-10 16:04:41 UTC
*** Bug 106788 has been marked as a duplicate of this bug. ***
Comment 30 Marian Mirilovic 2012-11-05 11:21:44 UTC
*** Bug 221418 has been marked as a duplicate of this bug. ***
Comment 31 Milutin Kristofic 2013-10-03 11:57:07 UTC
*** Bug 214515 has been marked as a duplicate of this bug. ***


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo