Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 217115 - Search Results context menu doesn't work reliably for files
Search Results context menu doesn't work reliably for files
Status: RESOLVED DUPLICATE of bug 218447
Product: utilities
Classification: Unclassified
Component: Search
7.2
PC Windows 7
: P3 (vote)
: TBD
Assigned To: Jaroslav Havlin
issues@utilities
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-08-20 16:04 UTC by Alexander Kouznetsov
Modified: 2012-10-03 09:18 UTC (History)
0 users

See Also:
Issue Type: DEFECT
:


Attachments
Modified module (1.09 MB, application/x-java-archive)
2012-09-03 14:42 UTC, Jaroslav Havlin
Details
Modified module - Patch (4.38 KB, patch)
2012-09-03 14:43 UTC, Jaroslav Havlin
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Kouznetsov 2012-08-20 16:04:02 UTC
Steps to reproduce:
- Right-click Source Packages entry in Projects for Java or JavaFX project
- Search for something that exists in the files, "get" for example.
- In Search results window:
1. Double click on any file name: Nothing happens, but I'd expect it to open the file
2. Right click and select Edit: Sometimes file is opened, sometimes not (see #3)
3. Right click and select Copy File Path: Sometimes file path is copied, sometimes not. I was verifing this by pasting it into currently opened file. It looks like when it fails to do this, it then breaks Edit file functionality (#2).

It would be really great if double-click on file name in Search/Usages Results will open the file in editor showing first found entry. I can file a separate feature request on this if necessary.
Comment 1 Jaroslav Havlin 2012-08-27 10:01:03 UTC
I'm sorry, I cannot reproduce.

(In reply to comment #0)
> 1. Double click on any file name: Nothing happens, but I'd expect it to open
> the file
Sure, the file should be opened. For me it works as expected.

> 2. Right click and select Edit: Sometimes file is opened, sometimes not.
> 3. Right click and select Copy File Path: Sometimes file path is copied,
> sometimes not. I was verifing this by pasting it into currently opened file.
> It looks like when it fails to do this, it then breaks Edit file
> functionality (#2).
Please, do you mean that for some files it works and for other files it doesn't work, or that it doesn't work for a file when you perform the action the first time and it works when you repeat it?

> It would be really great if double-click on file name in Search/Usages Results
> will open the file in editor showing first found entry. I can file a separate
> feature request on this if necessary.
Currently the file is selected if it is already opened, without any scrolling; or opened showing the first line if it is not opened yet.
It would be great if you file a separate enhancement for showing the first occurrence.

Thank you.
Comment 2 Alexander Kouznetsov 2012-08-27 12:44:36 UTC
What about the following step?
> 3. Right click and select Copy File Path: Sometimes file path is copied,
> sometimes not. I was verifing this by pasting it into currently opened file.
> It looks like when it fails to do this, it then breaks Edit file
> functionality (#2).

Does it work for you reliable?

Here is what I observe with this menu item:
1. Copy File Path for first file doesn't change the clipboard buffer (previous text from another app is there).
2. Copy File path for the second file updates clipboard buffer to first file path
3. Copy File Path for the third file updates clipboard buffer to the second file path
4. Copy File Path for 8th file updates clipboard buffer to the third file
5. Copy File Path for 8th file again doesn't change the clipboard buffer
Comment 3 Alexander Kouznetsov 2012-08-27 12:47:14 UTC
On another attempt all Copy File Path operation didn't change the clipboard buffer either by doing the same file twice, or different files.
Comment 4 Alexander Kouznetsov 2012-08-27 12:48:04 UTC
The following step this time works without any problems:
> 1. Double click on any file name: Nothing happens, but I'd expect it to open
> the file
Comment 5 Jaroslav Havlin 2012-08-27 14:16:52 UTC
> Does it work for you reliable?
I haven't observed any problems yet. But I'll check it.

Thank you very much for the additional information.
Comment 6 Jaroslav Havlin 2012-08-27 16:44:47 UTC
I've followed your steps to reproduce, but I still cannot reproduce it.
Can you please attach your IDE Log?
Thank you.
Comment 7 Jaroslav Havlin 2012-09-03 14:42:00 UTC
Created attachment 123834 [details]
Modified module

Module with extra logging. Only for testing purposes.

Please copy to your userdir, for example:
C:\Users\username\AppData\Roaming\NetBeans\7.2\modules\org-netbeans-api-search.jar
(create directory modules if it does not exit).

With this module, you can find some extra information in the IDE Log.
Comment 8 Jaroslav Havlin 2012-09-03 14:43:58 UTC
Created attachment 123835 [details]
Modified module - Patch
Comment 9 Jaroslav Havlin 2012-09-13 07:31:29 UTC
This problem can be related to bug 217984. Can you please try the latest development build? Thank you.
Comment 10 Alexander Kouznetsov 2012-09-13 16:48:15 UTC
It looks the problem is related to clipboard handling.

When I Copy File Path and paste it in 3rd party app like Notepad, everything works just fine.
When I Copy File Path and paste it in NetBeans editor, I get old clipboard value.
Comment 11 Alexander Kouznetsov 2012-09-13 16:52:18 UTC
Moreover, it is enough to just switch to other application and back to paste the correct clipboard value.
Comment 12 Jaroslav Havlin 2012-09-14 08:27:08 UTC
(In reply to comment #10)
> It looks the problem is related to clipboard handling.
> 
> When I Copy File Path and paste it in 3rd party app like Notepad, everything
> works just fine.
> When I Copy File Path and paste it in NetBeans editor, I get old clipboard
> value.

http://hg.netbeans.org/core-main/rev/1892d933f7df
Use ExClipboard class.

Please try the development version (after the change gets into the build).
Thank you.
Comment 13 Quality Engineering 2012-09-15 02:12:39 UTC
Integrated into 'main-golden', will be available in build *201209150001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/1892d933f7df
User: Jaroslav Havlin <jhavlin@netbeans.org>
Log: #217115: Use ExClipboard for copying paths of found files
Comment 14 Jaroslav Havlin 2012-09-17 09:16:42 UTC
Does copying text from editor work reliably for you, or is it erroneous, too?
If it is also incorrect, this bug is probably duplicate of bug 218447.
Comment 15 Jaroslav Havlin 2012-09-20 15:33:51 UTC
The clipboard issue (bug 218447) was already fixed. Please check the latest development build and let me know whether search results work correctly now.
Thank you.
Comment 16 Alexander Kouznetsov 2012-10-03 09:12:57 UTC
I've tried it with NetBeans IDE Dev (Build 201210020001) and it seems to work correctly now. Thank you for your support!

*** This bug has been marked as a duplicate of bug 218447 ***
Comment 17 Jaroslav Havlin 2012-10-03 09:14:50 UTC
Thank you for reporting and your help!
Comment 18 Alexander Kouznetsov 2012-10-03 09:18:17 UTC
Filed bug 219428 for the enhancement request mentioned.


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