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.
In the Mercurial plugin when we clone a repository we set a project in the cloned repository as the main project. We would like the new main project to be also selected. We cannot find an API to do this.
org.netbeans.api.project.ui.OpenProjects.setMainProject? (in module projects/projectuiapi)
We call setMainProject but that does not select the project.
Ok, I misunderstood the request, sorry.
Yep this is the API. What we want is on making the setMainProject call is to have selection set to the project we have just set as our main project. An option to expand it one or more levels would be nice as well, but the key for us is to have the selection set to this project. Seems like reasonable default behaviour, but could always add a setSelection flag if you didn't want this to be the default. org.netbeans.api.project.ui.OpenProjects: Code snippet: public static void openProject(Project p, Object caller) { Project[] projects = new Project[] {p}; OpenProjects.getDefault().open(projects, false); OpenProjects.getDefault().setMainProject(p); }
I think it's useless to have "set as Main project". I find that when you select none project as "Main one", then the "Run" icon in the tool bar just recognize the project you select as the option. It is enough to do so. Also, when you select a project as "Main project" using the right-click menu, you just cannot degrade it as "none Main project" by right-clicking. You must use "Run" in the menu bar. Even than, there is a small bug that when you select "NONE" in the "Set Main Project", the current Main one won't be degraded until you de-select all the items in the sub-menu "Set Main Project".
*** This bug has been marked as a duplicate of bug 7551 ***