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 236358

Summary: "Diff To..." menu item doesn't work in FullRemote projects
Product: utilities Reporter: soldatov <soldatov>
Component: DiffAssignee: Ondrej Vrabec <ovrabec>
Status: NEW ---    
Severity: normal CC: issues, ovrabec
Priority: P3    
Version: 7.4   
Hardware: PC   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:
Bug Depends on: 207496    
Bug Blocks:    
Attachments: the fix might be as simple as attached one; however I think it's rather a prototype; the correct one should be done via more common SPI than just Diff SPI

Description soldatov 2013-09-25 10:50:39 UTC
Scenario:
- Launch NetBeans
- Add some Unix remote host:
--- Push Tools|Options main menu item
--- Click on C/C++ icon
--- Select "Build Tools" tab
--- Press Edit button
--- Press Add button in Build Hosts Manager window
--- Specify host name and press Next
--- Specify login and press Next
--- Type password and press OK
--- Press Finish
--- Press OK in Build Hosts Manager window
--- Press OK in Options window
- Call context menu on toolbar, add Remote toolbar
- Push "Create Remote C/C++ Project" button on toolbar
- Create "C/C++ Application" project
- Create 2 files (file1.c and file2.c)
- Call context menu on "file1" editor's node
- Select Diff To...
==> I can't select remote file in "Diff file1 To..." wizard
Comment 1 Vladimir Kvashin 2013-12-23 13:14:43 UTC
Created attachment 143405 [details]
the fix might be as simple as attached one; however I think it's rather a prototype; the correct one should be done via more common SPI than just Diff SPI
Comment 2 Vladimir Kvashin 2013-12-24 09:03:26 UTC
The drawback of the fix attached (https://netbeans.org/bugzilla/attachment.cgi?id=143405&action=diff) is that it is diff-specific.

There are other cases where it should be possible to create a file chooser that allows to choose a file on the file system node belongs to.

So I think FileChooserBuilder should use an SPI that allows to replace it with FileSystem/FileObject based chooser.

Such a FileObject based chooser is already implemented in dlight.remote module, and it works pretty well.

I'm eager to participate.
Comment 3 Ondrej Vrabec 2013-12-27 07:36:01 UTC
one question: how does it work in Favorites and with File -> Open File... ? If you choose Add to Favorites from the popup in the Fav window, are you able to select any remote file there? And in Open File are you able to open any remote file? In other words, is there any file chooser window where it works?
Comment 4 Vladimir Kvashin 2014-01-29 10:53:50 UTC
(In reply to Ondrej Vrabec from comment #3)
> one question: how does it work in Favorites and with File -> Open File... ?
It does not work: you can add/open only local file via "File->Open File" or "Add to Favorites"
> In other words, is there any file chooser window where it works?
Sure it is, you can see it via two ways:
1) enable "Remote" toolbar and set up a host, then use "Open Remove File" or "Open Remote Project" buttons on this toolbar.
2) select "Services" pane, choose "C/C++ Build Hosts", add host there (or select a previously added one), choose "Add to Favorites"
Comment 5 Vladimir Kvashin 2014-01-29 11:02:46 UTC
(In reply to Vladimir Kvashin from comment #4)

It isn't easy to create a suitable api/spi for the cases I described since there is no "base" file object there - I mean the object that implicitely determines, which file system / file chooser to use. So notion of host appears, which is too specific for C/C++ (and probably some other, like php, but not platform itself).

With "Diff to" situation is easier from api/spi perspective: file object that is used to implicitely determine, which file chooser to use, already exists, so we can create api/spi without adding ne dependencies.
Comment 6 Jaroslav Havlin 2014-02-04 14:56:54 UTC
> Select Diff To...
As a workaround, it's possible to select the two files in e.g. Favorites view, right-click and select Tools -> Diff.

> the fix might be as simple as attached one; however I think it's rather a
> prototype; the correct one should be done via more common SPI than just
> Diff SPI.
I'm afraid that the fix will not work correctly. The custom file chooser will return a java.io.File that doesn't exists on the local file system, so we'll not be probably able to get corresponding FileObject for it anyway (FileUtil.toFileObject will return null).

> So I think FileChooserBuilder should use an SPI that allows to replace it with
> FileSystem/FileObject based chooser.
I think we should move this discussion to bug 207496.