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.

Bug 177531 - Edit button for wrapped JAR src & javadoc is initially disabled
Summary: Edit button for wrapped JAR src & javadoc is initially disabled
Alias: None
Product: apisupport
Classification: Unclassified
Component: Project (show other bugs)
Version: 6.x
Hardware: All All
: P4 normal with 2 votes (vote)
Assignee: Martin Kozeny
: 205051 (view as bug list)
Depends on:
Blocks: 171125
  Show dependency tree
Reported: 2009-11-24 09:15 UTC by Jesse Glick
Modified: 2014-01-06 12:58 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2009-11-24 09:15:55 UTC
See for description.
Comment 1 Jesse Glick 2010-05-04 20:33:39 UTC
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/ b/apisupport.project/src/org/netbeans/modules/apisupport/project/ui/customizer/
--- a/apisupport.project/src/org/netbeans/modules/apisupport/project/ui/customizer/
+++ b/apisupport.project/src/org/netbeans/modules/apisupport/project/ui/customizer/
@@ -779,7 +779,11 @@
         for (String s : cpExt) {
-        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.
Comment 2 Jesse Glick 2011-11-16 01:12:09 UTC
*** Bug 205051 has been marked as a duplicate of this bug. ***
Comment 3 Jesse Glick 2011-11-16 16:55:18 UTC
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.
Comment 4 aldobrucale 2011-11-25 09:05:15 UTC
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.
Comment 5 Jesse Glick 2011-11-30 13:43:53 UTC
(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.
Comment 6 aldobrucale 2011-12-01 14:21:13 UTC
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.
Comment 7 Martin Kozeny 2014-01-06 12:58:31 UTC
Using Jesse's solution:, probably there is no other. Connected to