This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 5009 - Patch for: Searching in all opened source files
Summary: Patch for: Searching in all opened source files
Status: RESOLVED FIXED
Alias: None
Product: utilities
Classification: Unclassified
Component: Search (show other bugs)
Version: 3.x
Hardware: All All
: P4 enhancement with 2 votes (vote)
Assignee: Jaroslav Havlin
URL:
Keywords: NETFIX, PATCH_AVAILABLE
: 124735 181446 208187 (view as bug list)
Depends on:
Blocks:
 
Reported: 1999-12-16 00:22 UTC by Svata Dedic
Modified: 2013-03-01 22:21 UTC (History)
5 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
Proposed patch (6.61 KB, patch)
2013-02-26 22:24 UTC, markiewb
Details | Diff
Icon for the SearchScope (3.24 KB, image/png)
2013-02-26 22:24 UTC, markiewb
Details
Shows the patch in action (90.63 KB, image/png)
2013-02-26 22:25 UTC, markiewb
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Svata Dedic 1999-12-16 00:22:57 UTC
There should be an option if user wants to search only the active editor window or all opened source files.
Comment 1 Marek Grummich 2000-07-25 09:08:59 UTC
Priority is changed to P4 (normal).
Comment 2 Petr Slegr 2000-09-19 11:06:59 UTC
So, here is suggestion for option like "Search in current file only/Search in
all opened files".

This option could be two level, possibly. There would be appropriate property
in editor options. Beside it the same option would be in Find dialog
(however in some second, less important section... together with others
similar). Setting this option would override the global one.

****

And next question is what about option whether highlight also new strings
written after their prior searching. Yes, this is very minor...
Comment 3 Jan Lahoda 2001-01-24 15:35:59 UTC
Only changed version to Development.
Comment 4 Jan Chalupa 2001-05-05 21:53:16 UTC
Target milestone -> 3.3
Comment 5 David Konecny 2001-05-22 15:49:59 UTC
Changing the state of the issue to ASSIGNED, because it was cover in 
Requirements document at http://editor.netbeans.org/doc/Requirements.html
Comment 6 Jan Chalupa 2001-11-27 12:27:38 UTC
Target milestone -> 3.3.1.
Comment 7 Marek Grummich 2002-07-22 09:59:57 UTC
Set target milestone to TBD
Comment 8 Marek Grummich 2002-07-22 10:03:21 UTC
Set target milestone to TBD
Comment 9 psuk 2004-03-23 18:16:36 UTC
Changing subcomponent to "search"
Comment 10 Milutin Kristofic 2012-02-15 13:16:42 UTC
*** Bug 124735 has been marked as a duplicate of this bug. ***
Comment 11 Milutin Kristofic 2012-02-15 13:18:09 UTC
*** Bug 208187 has been marked as a duplicate of this bug. ***
Comment 12 markiewb 2013-02-26 22:24:09 UTC
Created attachment 131927 [details]
Proposed patch

I like to propose the given patch to solve this issue. The patch includes a SearchScopeProvider for all the open documents. 

FYI: I couldn't create a patch with the binary icon, so i will attach it separately. The icon is needed for the RFE in http://netbeans.org/bugzilla/show_bug.cgi?id=222406 and taken from the same commit.

@NB-Devs: Please review, discuss and commit. Thank you.
Comment 13 markiewb 2013-02-26 22:24:49 UTC
Created attachment 131928 [details]
Icon for the SearchScope
Comment 14 markiewb 2013-02-26 22:25:15 UTC
Created attachment 131929 [details]
Shows the patch in action
Comment 15 Jaroslav Havlin 2013-02-28 09:47:34 UTC
Good job! Thank you very much for the patch.

I've encountered some (null pointer) exceptions, so I slightly modified method getCurrentlyOpenedFiles(). Please check it and let me know if you can find any problem there.

Integrated as http://hg.netbeans.org/core-main/rev/74c85cd4b12d
Comment 16 markiewb 2013-02-28 10:26:24 UTC
(In reply to comment #15)
> Good job! Thank you very much for the patch.
> 
> I've encountered some (null pointer) exceptions, so I slightly modified method
> getCurrentlyOpenedFiles(). Please check it and let me know if you can find any
> problem there.
> 
> Integrated as http://hg.netbeans.org/core-main/rev/74c85cd4b12d

You are right, there isn't always a DataObject available. Looks good. 

Do we have to inform/warn the user that it only works for file-based documents and unchanged modifications in open documents cannot be tracked?
Comment 17 Jaroslav Havlin 2013-02-28 12:36:35 UTC
(In reply to comment #16)
> Do we have to inform/warn the user that it only works for file-based documents
> and unchanged modifications in open documents cannot be tracked?
We've discussed it and concluded that the current state seems fine. The warning is shown in Search Results window if some files are not saved (it's the same for other search scopes); and it should be, hopefully, obvious that only file-based documents can be searched (again, this applies to all search scopes).

If some confusion is reported, we can reconsider it in the future.
Comment 18 Quality Engineering 2013-03-01 01:59:45 UTC
Integrated into 'main-golden', will be available in build *201302282300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/74c85cd4b12d
User: Jaroslav Havlin <jhavlin@netbeans.org>
Log: #5009: Searching in all opened source files
Comment 19 markiewb 2013-03-01 22:21:05 UTC
*** Bug 181446 has been marked as a duplicate of this bug. ***