After the impl of issue #50683, some project settings seem like they should be
tied to the active group, but are not. For example, the last opened project
location should probably be group-specific.
Also, the Recent Projects list shows projects "closed" by switching groups,
which is probably undesirable.
Created attachment 36652 [details]
Initial attempt; doesn't really work too well
I also think that the last opened project location should be group specific, and
I would consider this P3 at least (but feel free to change it back to P4 if you
See also bug #168578.
another usecase for group specific settings is usage of maven binary and settings.xml file for a certain project group only.
(In reply to comment #4)
> usage of maven binary and settings.xml file for a certain project group only
Bug #197577 (defining that in a parent POM) would probably suffice for this use case.
(In reply to comment #5)
> Bug #197577
Sorry, just noticed you have that as blocked by this issue, but in fact it could be done without any reference to project groups.
disagree. maven executable maybe, but anything that can touch the location of
local repository is suspicious and needs to be handled en-block for all opened
projects. (and maven executable contains a setting file)
Forgot to mention that MavenFileOwnerQueryImpl should probably keep the
persistent caches on project group level as well. It solves the problem with
multiple branch checkouts pointing to the same spot in local repository
Comment #7 perhaps intended to be added to bug #197577 rather than here.
Created attachment 123211 [details]
suggested API in project.uiapi
Created attachment 123212 [details]
implementation in projectui
Created attachment 123213 [details]
usage of api from mavenFileOwnerQuery
please review the following new api.
1. a getter for ProjectGroup in OpenProjects, containing currently just name and preferences. Ideally we would have the same pattern as with root preferences. NbPreferences.forModule(Class) but it turned out the impl is using some classes unaccessible from projectui. So we use forPackage(Class) instead.
2. New listener and event that gets fired when project group starts changing and when it finishes.
Two example usages in the diffs, one preserving the last opened project directory on group level and the in maven support, reset the external roots preferences on group change and use group private preferences. That's useful especially when working on multiple branches of the same code.
thanks for review, I will integrate tomorrow
Y01 ProjectGroupChangeListener should extend EventListener to follow JavaBeans specification
Y02 Maybe constructor of ProjectGroupChangeEvent should not be public (as the only place that constructs it should be OpenProjects class).
(In reply to comment #14)
> Y01 ProjectGroupChangeListener should extend EventListener to follow JavaBeans
> Y02 Maybe constructor of ProjectGroupChangeEvent should not be public (as the
> only place that constructs it should be OpenProjects class).
It's actually OpenProjectsList in project.ui module. I've tried applying the trampoline pattern but it turned out too complicated to ripped it out after all. The potential for abuse of that constructor is fairly small.
considered done, Maven's fileownerquery implementation and basic project settings like recent projects or last opened dir are now group specific..
Integrated into 'main-golden', will be available in build *201208290001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
User: Milos Kleint <email@example.com>
Log: #91031 api for listening on changes in project groups, and querying the currently active group. group exposes a root Preferences not usable for settings that should be group specific