Bug 91031 - Better integration of project settings with groups
Better integration of project settings with groups
Status: RESOLVED FIXED
Product: projects
Classification: Unclassified
Component: Generic Projects UI
6.x
All All
: P1 (vote)
: 7.3
Assigned To: Milos Kleint
issues@projects
: API_REVIEW, API_REVIEW_FAST
Depends on:
Blocks: 215492 50683 197577
  Show dependency treegraph
 
Reported: 2006-12-13 17:44 UTC by Jesse Glick
Modified: 2012-08-29 02:40 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
:


Attachments
Initial attempt; doesn't really work too well (11.16 KB, patch)
2006-12-13 17:46 UTC, Jesse Glick
Details | Diff
suggested API in project.uiapi (18.60 KB, patch)
2012-08-16 18:25 UTC, Milos Kleint
Details | Diff
implementation in projectui (9.35 KB, patch)
2012-08-16 18:25 UTC, Milos Kleint
Details | Diff
usage of api from mavenFileOwnerQuery (3.25 KB, patch)
2012-08-16 18:26 UTC, Milos Kleint
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2006-12-13 17:44:41 UTC
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.
Comment 1 Jesse Glick 2006-12-13 17:46:18 UTC
Created attachment 36652 [details]
Initial attempt; doesn't really work too well
Comment 2 Jan Lahoda 2006-12-13 20:08:08 UTC
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
disagree).
Comment 3 Jesse Glick 2009-12-04 09:46:47 UTC
See also bug #168578.
Comment 4 Milos Kleint 2012-07-26 11:12:43 UTC
another usecase for group specific settings is usage of maven binary and settings.xml file for a certain project group only.
Comment 5 Jesse Glick 2012-07-26 13:09:53 UTC
(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.
Comment 6 Jesse Glick 2012-07-26 13:11:06 UTC
(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.
Comment 7 Milos Kleint 2012-07-26 13:15:20 UTC
 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 8 Jesse Glick 2012-07-26 13:28:56 UTC
Comment #7 perhaps intended to be added to bug #197577 rather than here.
Comment 9 Milos Kleint 2012-08-16 18:25:34 UTC
Created attachment 123211 [details]
suggested API in project.uiapi
Comment 10 Milos Kleint 2012-08-16 18:25:56 UTC
Created attachment 123212 [details]
implementation in projectui
Comment 11 Milos Kleint 2012-08-16 18:26:17 UTC
Created attachment 123213 [details]
usage of api from mavenFileOwnerQuery
Comment 12 Milos Kleint 2012-08-16 18:40:01 UTC
please review the following new api.

2 parts: 
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.
Comment 13 Milos Kleint 2012-08-23 11:17:49 UTC
thanks for review, I will integrate tomorrow
Comment 14 Jaroslav Tulach 2012-08-24 12:30:48 UTC
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).
Comment 15 Milos Kleint 2012-08-24 13:18:24 UTC
(In reply to comment #14)
> Y01 ProjectGroupChangeListener should extend EventListener to follow JavaBeans
> specification

Ok. Done.

> 
> 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.
Comment 16 Milos Kleint 2012-08-27 12:20:50 UTC
considered done, Maven's fileownerquery implementation and basic project settings like recent projects or last opened dir are now group specific..
Comment 17 Quality Engineering 2012-08-29 02:40:48 UTC
Integrated into 'main-golden', will be available in build *201208290001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/a003014d9d36
User: Milos Kleint <mkleint@netbeans.org>
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


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo