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 143713

Summary: custom JFileChooser shown for action Tools->Diff is unintuitive
Product: utilities Reporter: David Konecny <dkonecny>
Component: DiffAssignee: Ondrej Vrabec <ovrabec>
Status: NEW ---    
Severity: blocker CC: jrojcek
Priority: P4    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Attachments: diff NewClass1 to NewServlet or NewClass??

Description David Konecny 2008-08-13 08:22:30 UTC
It's first time I opened it and it took me couple of minutes to realize what's happening. I have three Java files in a
package and two of them are opened in editor. Starting Diff action showed custom file chooser where my three Java files
are list at the left and two at the right (see screenshot). Most of diff programs usually let you choose two files to
diff so I thought that's the case here as well and browsed to a file in JFileChooser and then tried to select *second*
file in "Files open in Editor". But doing so just updates filechooser to that file. After a while I noticed dialog's
title which made it clear. Still the UI is wrong I think. Regular diff dialog like:

  File A: [____file in editor_] [Browse]
  File B: [___________________] [Browse]

would be much simpler and more intuitive. Or if you wanna keep list of currently opened files in editor:

  Diff file <file in editor> to:
    ( ) [___________________] [Browse]
    (*) [list box with files opened in editor]

In any case dialog at the moment shows selected item in both left and right list which makes it hard to guess what I
will be diffing to. See attached screenshot.Thanks.
Comment 1 David Konecny 2008-08-13 08:24:01 UTC
Created attachment 67211 [details]
diff NewClass1 to NewServlet or NewClass??
Comment 2 Maros Sandor 2008-08-20 11:38:06 UTC
I have no idea how to make it more intuitive, HIE?
Comment 3 David Konecny 2008-08-25 03:06:11 UTC
In terms of feature matrix or coverage this could be an "enhancement"; in terms of UI quality or usability this is
defect. You cannot customize JFileChooser by adding an unrelated file selection concept to it. Purpose of filechooser
accessory is to provide an extra information on a selected file - eg. preview of a selected image; question whether
selected project folder should be opened with subprojects; decision how the selected file should be referenced; etc.
Comment 4 jrojcek 2008-08-29 08:21:58 UTC
I also think this is a defect. I would suggest to call this action "Diff Two Files...", so that it's not confused with the versioning "Diff" action.

I would suggest to use UI similar to David's:

----
Diff Two Files - title
---
File A: |_MyJavaFile.java___________________v_| [ Browse... ]
File B: |___________________________________v_| [ Browse... ]

[[ Diff ]] [ Cancel ]
---

Where both fields are editable combo boxes. The popup of each combo could offer our best guess which files the user wants to diff, e.g. files open in 
editor, some recent files, or something similar.

Comment 5 Maros Sandor 2008-08-29 10:30:51 UTC
*** Issue 145448 has been marked as a duplicate of this issue. ***
Comment 6 Maros Sandor 2008-12-18 11:10:59 UTC
*** Issue 153911 has been marked as a duplicate of this issue. ***