Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 211098 - Regular Expression option for file name pattern is confusing
Regular Expression option for file name pattern is confusing
Status: RESOLVED FIXED
Product: utilities
Classification: Unclassified
Component: Search
7.2
PC Windows XP
: P4 (vote)
: 7.4
Assigned To: Jaroslav Havlin
issues@utilities
: UI, USABILITY
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-04-12 13:13 UTC by steady
Modified: 2013-01-30 03:40 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
:


Attachments
Mockup of adjusted Find in Projects dialog (31.15 KB, image/png)
2012-08-02 13:39 UTC, Petr Somol
Details
Screenshot - Dialog with separators and examples (29.79 KB, image/png)
2013-01-18 14:36 UTC, Jaroslav Havlin
Details
Proposed Patch (9.17 KB, patch)
2013-01-18 14:45 UTC, Jaroslav Havlin
Details | Diff
Proposed Patch v2 (13.91 KB, patch)
2013-01-21 14:54 UTC, Jaroslav Havlin
Details | Diff
Screenshot - Dialog with separators and examples (32.74 KB, image/png)
2013-01-21 14:58 UTC, Jaroslav Havlin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description steady 2012-04-12 13:13:02 UTC
Product Version = NetBeans IDE Dev (Build 201204100400)
Operating System = Windows XP version 5.1 running on x86
Java; VM; Vendor = 1.6.0_26
Runtime = Java HotSpot(TM) Client VM 20.1-b02

1. assure you have at least one project opened
2. click  menu --> Edit --> Find_in_Projects or press CTRL+SHIFT+F ==> 'Find in Projects' dialog appears
3. type as a search text some regular expression, for example '[a]' without quotes - that searches all letters 'a' in all files
4. activate 'regular expression' checkbox
5. click on the 'find' button

result: "no matching files were found"

expected result: files with the letter 'a'
Comment 1 Jaroslav Havlin 2012-04-13 14:36:39 UTC
I'm sorry, I am not able to reproduce.
What search scope did you select?
What other text pattern options and file name options are active?
Thank you.
Comment 2 Jaroslav Havlin 2012-04-16 08:14:44 UTC
Closing. Please reopen if you can provide us with some additional information.
Comment 3 steady 2012-04-16 13:37:37 UTC
Sorry, my fault. It is usability problem.

I've used 'Regular Expression' for 'File Name Patterns' instead of 'Regular Expression' for 'Containing Text'. The 'Regular Expression' checkbox was on the bottom of the dialog before the version 7.2.

Is it possible to make context boundaries to prevent such mistakes?
Comment 4 Jaroslav Havlin 2012-04-17 16:05:02 UTC
I see, it is quite confusing.
We'll try to improve it, rename the option or add boundaries.
Thank you.
Comment 5 Jaroslav Havlin 2012-07-24 15:10:04 UTC
What about renaming the option to "Path Regular Expression", or "Regular Expression on Path"?

Petr, please, do you have any idea?
Comment 6 steady 2012-07-25 08:05:20 UTC
I think the boundaries could solve this problem.
The long texts for options is less user friendly.
Comment 7 Petr Somol 2012-07-26 14:11:44 UTC
Boundaries seem OK here. I'll try to adjust the layout and provide a mockup (in a couple of days..)
Comment 8 Petr Somol 2012-08-02 13:39:14 UTC
Created attachment 122685 [details]
Mockup of adjusted Find in Projects dialog

Tried to add boundaries but the result was not satisfactory enough. Eventually it seems the simplest idea works the best, thus I endorse renaming the RegEx checkbox. Additionally I suggest adding horizontal separator lines to improve "legibility" of the layout without actually changing the appearance or size of dialog too much. See the attachment.
Comment 9 steady 2012-08-03 08:49:18 UTC
Looks very good for me.
The only small inconsistency between the names is a bit confusing:
"file NAME patterns" -- "file PATH regular expression"
Comment 10 Petr Somol 2012-08-03 09:18:37 UTC
It is indeed inconsistent as I got the explanation that the RegEx switch actually changes the scope of the pattern - with RegEx the pattern needs to address whole file path, without RegEx not necessarily. Please jhavlin comment on this as you know more..
Comment 11 Jaroslav Havlin 2012-08-03 09:33:28 UTC
(In reply to comment #10)
> It is indeed inconsistent as I got the explanation that the RegEx switch
> actually changes the scope of the pattern - with RegEx the pattern needs to
> address whole file path, without RegEx not necessarily. Please jhavlin comment
> on this as you know more..
Yes, exactly.

Maybe it is not so much inconsistent.
If the checbox is unchecked, only the last path element is considered to be  file name, and one or more simple patterns (*.foo) can be specified.
If it is checked, the whole path is considered to be the file name, and a regular expression can be specified, which can include several patterns, e.g. ((/src/)|(/test/)).

I agree it is not very nice, and better labels would make it more intuitive.
Comment 12 Petr Somol 2012-08-03 09:41:37 UTC
> 
> Maybe it is not so much inconsistent.
> If the checbox is unchecked, only the last path element is considered to be 
> file name, and one or more simple patterns (*.foo) can be specified.
> If it is checked, the whole path is considered to be the file name, and a
> regular expression can be specified, which can include several patterns, e.g.
> ((/src/)|(/test/)).
> 
> I agree it is not very nice, and better labels would make it more intuitive.

"Better" labels may not be that easy to define. But certainly the explanation would help if displayed as RegEx checkbox tooltip.
Comment 13 Jaroslav Havlin 2013-01-18 14:36:40 UTC
Created attachment 130366 [details]
Screenshot - Dialog with separators and examples
Comment 14 Jaroslav Havlin 2013-01-18 14:45:17 UTC
Created attachment 130368 [details]
Proposed Patch

> "Better" labels may not be that easy to define. But certainly the explanation
> would help if displayed as RegEx checkbox tooltip.
The tooltip was added (patch).

> Created attachment 122685 [details]
> Mockup of adjusted Find in Projects dialog
Thank you, it seems very good.

> Tried to add boundaries but the result was not satisfactory enough. 
> Eventually it seems the simplest idea works the best, thus I endorse 
> renaming the RegEx checkbox.
The checkbox is not renamed in the patch, I'm sorry, I'll update the patch and screenshot soon.

> Additionally I suggest adding horizontal separator lines to improve
> "legibility" of the layout without actually changing the appearance or size 
> of dialog too much. See the attachment.
I've also tried to add some examples (they were there before 7.2). Please see the screenshot how it looks now and let me know what do you think.
Thanks in advance.
Comment 15 Jaroslav Havlin 2013-01-21 14:54:56 UTC
Created attachment 130450 [details]
Proposed Patch v2

Updated patch
Comment 16 Jaroslav Havlin 2013-01-21 14:58:01 UTC
Created attachment 130451 [details]
Screenshot - Dialog with separators and examples

Screenshot. Updated "File Path Regular Expression" check-box and example, and  "Text to Find" regular expression info string.
Comment 17 Jaroslav Havlin 2013-01-29 10:47:08 UTC
http://hg.netbeans.org/core-main/rev/a8efc474edfa
Fixed.
Thank you for your help.
Comment 18 Quality Engineering 2013-01-30 03:40:38 UTC
Integrated into 'main-golden', will be available in build *201301300001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/a8efc474edfa
User: Jaroslav Havlin <jhavlin@netbeans.org>
Log: #211098: Regular Expression option for file name pattern is confusing


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