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 223992

Summary: Support Open Project on unrecognized directories
Product: projects Reporter: Petr Jiricka <pjiricka>
Component: Generic InfrastructureAssignee: Tomas Stupka <tstupka>
Status: NEW ---    
Severity: normal CC: dkonecny, tmysik
Priority: P2    
Version: 7.3   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:

Description Petr Jiricka 2012-12-18 16:43:44 UTC
1. Choose File -> Open Project...
2. Browse to a directory that's not recognized as any project type
3. Click Open Project

At this point the IDE enters this directory and lets the user choose one of its subdirectories, but it would be nice if instead the IDE offered you to "Open As...", and let the user choose which type of project they want. 

Individual project types would be able to register their interest in opening plain directories, and after the user chooses the project type to use for given directory, they would present a projecttype-specific UI for configuring the project (analogous to the "with existing sources" wizards). I can imagine that this the interested project types could include:

* All Ant-based Java project types
* PHP project
* HTML5 project
* C++ project
....

This feature would need to consider how it will work with ergonomics.
Comment 1 Petr Jiricka 2012-12-18 20:04:19 UTC
Accompanying this feature, there could be a context action on folders in Favorites tab called "Open as project..."
Comment 2 Milos Kleint 2013-01-03 10:12:44 UTC
The big question is how nesting is supposed to work. If a folder already belongs to a project (via FileOwnerQuery) do we still allow creating a new project for that location?
When overused, people can wake up to nasty surprises.. eg. a version control commit omits some files because "Open as Project" was used on a subfolder. 

on the semantic level, I'm not comfortable with the label "Open as project" when the actual work done is "Create project".

Can you estimate how many clicks we are capable of saving by this improvement? I appears to me that just the selection of project type in first panel, clicking next, selecting folder in second panel and the rest of the wizards has to be still shown, correct?
Comment 3 Petr Jiricka 2013-01-03 11:57:01 UTC
> If a folder already belongs to a project (via FileOwnerQuery) do we 
> still allow creating a new project for that location?

I think the answer is no - that's a clear corner case. Let's focus on the main use case.

> on the semantic level, I'm not comfortable with the label "Open as project"

Sure, the exact wording is TBD; we can think about a more suitable label.

> Can you estimate how many clicks we are capable of saving by this improvement?

This will likely differ for various project types. Also, the difference is not only in the hard number of clicks, there is also a psychological difference: some users (especially those coming from simple text editors) may not like the concept of "creating a project", they would rather just "open files". So this enhancement gives them this possibility, making NetBeans feel more "lightweight".

> selection of project type in first panel, clicking next, selecting folder in second panel

As for selecting folder, you mean for things like src dir, lib dir, tests dir etc? Hopefully that can be defaulted so the user just confirms it. Again, this will be simpler for some project types (HTML5) than for others (Java).
Comment 4 Milos Kleint 2013-01-14 09:40:48 UTC
(In reply to comment #3)
> > If a folder already belongs to a project (via FileOwnerQuery) do we 
> > still allow creating a new project for that location?
> 
> I think the answer is no - that's a clear corner case. Let's focus on the main
> use case.
> 

unfortunately people do it even now, with fairly serious consequences IMHO see issue 224790. with the feature requested in this issue it will be even easier. Please note that in issue 224790 not only FileOwnerQuery is affected but also SourceGroup instance as the wrapped project is inside the sourcecode, not just outer project folder.


It's semantically unclear what will typically be the folder that people will trigger this on. I suppose it will be the Source root in most cases which in some project types cannot be equal to the project basedir (ant java projects IMHO) so we will actually have to ask users where to put the project basedir.
Comment 5 Petr Jiricka 2013-01-14 09:50:00 UTC
> ...see issue 224790. with the feature requested in this issue it will be even easier.

I hope not, the UI for this enhancement should not allow creating project inside or outside of another project.

> we will actually have to ask users where to put the project basedir

You are right, your arguments make sense. We can not rely on people selecting the right directory to start with.