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.
See https://netbeans.org/bugzilla/show_bug.cgi?id=171125#c4 for description.
ClassPathSupport.getSourceProperty => null since property = "release/modules/ext/whatever.jar", not matching the reference pattern, so Item.canEdit => false. The following makes the Edit button be enabled, but setting a source association then has no effect: diff --git a/apisupport.project/src/org/netbeans/modules/apisupport/project/ui/customizer/SingleModuleProperties.java b/apisupport.project/src/org/netbeans/modules/apisupport/project/ui/customizer/SingleModuleProperties.java --- a/apisupport.project/src/org/netbeans/modules/apisupport/project/ui/customizer/SingleModuleProperties.java +++ b/apisupport.project/src/org/netbeans/modules/apisupport/project/ui/customizer/SingleModuleProperties.java @@ -779,7 +779,11 @@ for (String s : cpExt) { sb.append(s); } - return getClassPathSupport().itemsIterator(sb.toString(), CPEXT); + List<Item> items = getClassPathSupport().itemsList(sb.toString(), CPEXT); + for (Item item : items) { + item.setReference("${file.reference." + item.getReference() + "}"); + } + return items.iterator(); } DefaultListModel getWrappedJarsListModel() { I'm afraid I hardly understand what any of this code does and it is likely any changes would result in regressions. Perhaps it would be better to stop using ClassPathUiSupport and just write a simple data model from scratch; apisupport's storage of JARs is not much like that of other Ant-based projects. Workaround is to make source/Javadoc associations when adding the JAR; if already added, delete and readd.
*** Bug 205051 has been marked as a duplicate of this bug. ***
Does not matter as much in 7.1 since you do not really need this UI any more; independent of project type, you are offered the opportunity to associate source or Javadoc with a JAR at the point where you actually need it (e.g. code completion in the editor). Possibly the special association system should simply be removed altogether, to simplify code in apisupport.
I had not noticed the "Attach javadoc..." link. I think that the "Edit" button should be preserved, in case one has set the wrong directory. I still can't find how to attach the sources.
(In reply to comment #4) > I think that the "Edit" button > should be preserved, in case one has set the wrong directory. Probably needs to be addressed more generically in source attacher in java.j2seplatform, though I am not sure what the UI should be - maybe some dialog listing previously attached source and Javadoc locations with a Remove button. > I still can't find how to attach the sources. Whenever you get a generated source skeleton - Ctrl-B, Ctrl-O, etc. on a class in the library - there will be a button at the top of the editor to attach real sources.
Thank you, I've just seen it. The "Attach sources" button on the far right of the editor window is not very noticeable, expecially on 16:9 displays... And it doesn't seem to work in nb 7.1 RC1, I'll file separate issues about this.
Using Jesse's solution: https://hg.netbeans.org/core-main/rev/248186aaf91f, probably there is no other. Connected to https://netbeans.org/bugzilla/show_bug.cgi?id=240022.