JaroslavTulach commented on code in PR #9636:
URL: https://github.com/apache/netbeans/pull/9636#discussion_r4133540976
##########
ergonomics/ide.ergonomics/src/org/netbeans/modules/ide/ergonomics/fod/FeatureProjectFactory.java:
##########
@@ -635,6 +640,38 @@ public Node findPath(Node root, Object target) {
}
return null;
}
+
+ @NbBundle.Messages({
+ "MSG_OnMissingSourceGroup=Project initialization requested",
+ "# {0} - name of the project",
+ "MSG_FullyInitializeProject=Should we open the {0} project and
initialize it fully?",
+ })
+ @Override
+ public SourceGroup[] getSourceGroups(String type) {
+ var src = delegate.lookup(Sources.class);
+ if (src != null && src != this) {
+ return src.getSourceGroups(type);
+ }
+ Project prj = getLookup().lookup(Project.class);
+ if (prj != null && openingPrj == null) {
+ openingPrj = NotificationDisplayer.getDefault().notify(
+ Bundle.MSG_OnMissingSourceGroup(), loadIcon(),
+ Bundle.MSG_FullyInitializeProject(getDisplayName()),
+ (ev) -> {
+ OpenProjects.getDefault().open(new Project[] { prj },
false);
+ }
+ );
+ }
+ return new SourceGroup[0];
Review Comment:
@MartinBalin told me there are two problems:
- original code had `GenericSources.genericOnly(project)` for
`Sources.TYPE_GENERIC`
- listeners aren't implemented. They should as after `associate()` the old
`Sources` impl starts to return new values without firing any event
- here is a test suggested by Martin: 96d0a4c815
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists