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 224815 - Allow projects to not have files in Source Directory, but files from any directory
Summary: Allow projects to not have files in Source Directory, but files from any dire...
Alias: None
Product: projects
Classification: Unclassified
Component: Generic Projects UI (show other bugs)
Version: 7.4
Hardware: PC Windows 7
: P4 normal with 1 vote (vote)
Assignee: Tomas Stupka
Depends on:
Reported: 2013-01-13 17:36 UTC by CodeLurker
Modified: 2016-07-20 22:34 UTC (History)
0 users

See Also:
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
Description CodeLurker 2013-01-13 17:36:51 UTC
If you look at how the projects work in jEdit, you notice that they don't show you all the files in a certain directory; they show you only the files you add.  I'd like to be able to do that with NB.  When I edit a website, I typically have a number of files in there that, e.g. save old version of code, might be snippets or examples, or might be references.  I like being able to only include those files in a project that are relevant to the pages under development and/or are actually going up on the server.  This makes my files list in my project a lot cleaner, with more wheat and less chaff.  Another advantage of doing this, is that you can have frequently used references or example pages that aren't in the project folder tree, which you may be using as a template in the informal sense.  It gives the user much more control over what is available in a project's file list, and what is not.  Since I hate sorting through e.g. 50 files where I'd wish only 20 to be displayed, and not being able to have files from other directory trees in that list, I'm marking this one as a high priority enhancement.

There are a few other issues that are reminiscent of this suggestion, but which I do not feel actually request what this one requests; but you may wish to e.g. merge with:

"Include files / folders to a project"

Unlike this request, I am suggesting allowing the adding of files to a project that are not within the directory structure of any project, and allowing EXCLUDING all files in the Source Directory if desired; until added.

"Improve support for editing files that do not belong to a project"

This is a more specific request that seems to fall under this umbrella.
Comment 1 Milos Kleint 2013-01-13 17:39:21 UTC
unlikely to be implemented as a generic feature, more likely in specific project  types.
Comment 2 CodeLurker 2013-01-14 15:30:03 UTC
Although I'm just requesting, and not a developer, it seem to me that at least most project types might have files in the project folder, that might be useful to have as clips, archives, or impromptu old versions of files, that would just be clutter to have in the project file list. To my way of thinking, I fail to see a project type that that wouldn't be the case for; although I am not a java, but a PHP and C++ programmer. While development resources may be limited, as a general principle, I've never understood that point of view.
Comment 3 Martin Balin 2016-07-07 08:38:36 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss
Comment 4 CodeLurker 2016-07-07 13:53:40 UTC
I'm not sure how relevancy would have changed.  That being said, the problem seems to have been addressed in the build netbeans-trunk-nightly-201607070002-php-windows-x86.exe.  I can drag and drop files from other folders into the NB project.  That's great.  I can set up my project however I want.  (I do realize that if the same file is ever tracked in two different projects in two different folders, and one reverts one project, it could revert a file in another project.  Let the user beware - but I just think its the price for the extra flexibility.)

I have two more ideas to extend this new functionality to its logical conclusion:

1. Have some method in the GUI to import source files.  This will most often be only from the project directory, but as I suggest in this issue, sometimes it is convenient to have source from other dirs in your project.  This is to say, the functionality I suggested now exists, but is only available via drag-and-drop.  I'd like to see some other functionality to support it, like (for the PHP edition), right-clicking on Site Root, and have a choice, "Add existing file", and have the same functionality in the main menus.  If its no

2. This would be backtracking to the way it worked before, in a sense.  Notepad++ has just recently introduced a feature analogous to the way it worked before, called "Open Folder As Workspace".  I understand if some people with very complex projects feel uneasy about having files from multiple dirs in the same revision control system; because of the aforementioned possible conflicts with having the same file in two different projects, when e.g. one might get reverted, thereby unintentionally affecting the other.  I prefer not to work that way, but this feature would be for those who do.  I find it easy enough, e.g. to tell Git to ignore the file in one of the projects, but still see it there in my project.  This makes especial sense in C++ projects, where one directory may have some sources I'm using, but are part of another project, and it all compiles together.  HTML5 projects aren't as likely to have a server fetch a page from another directory that isn't a subdirectory of the current site.

I consider suggestion #1 to be part of fleshing out this functionality; and have reopened this issue on that basis.  Administrators may wish to see suggestion #2 as a separate issue, or to include it as part of this - as an accommodation to those who prefer the old way of doing it.
Comment 5 CodeLurker 2016-07-20 22:34:17 UTC
My bad.  It still only does "directory as a project," if you will.  Dragging and dropping a file from one directory into a project in another only copies the file into another; and you can't add only a short list of files from a directory into a project.  Also, you can't exclude, e.g. a given HTML file from a project, even if you have a half a dozen pages you are migrating content from, and don't want to see in the listing; e.g. CSS, PHP or Javascript code.  So yeah, it seems this one never got addressed; only closed without reason or comment.  Thx for the opportunity to reopen it.

You might solve it by having a choice when you create a new project, "Directory as project" or "Project includes only added files".  It appears you can add an include path, and utilize files from other directorys.  However, it also appears to be for PHP only.  If the user creates the project as the second type, then they should have the option to "Add existing files" and browse to any directory to find them.  I suppose this has been avoided, as how will a webserver know to find them elsewhere?  I say, let that be the expert user's problem.  They may be using an external webserver, or they should understand that there needs to be some way for the internal one to find them.  In the example of having a half a dozen files to migrate content from, you could copy them into your project's Webcontent directory, and then right-click and remove them from your project one at a time; with the option to delete the underlying file, OR NOT.