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 199742 - Hyperlinks do not work in GrammarResult.getDescription HTML text
Summary: Hyperlinks do not work in GrammarResult.getDescription HTML text
Status: RESOLVED FIXED
Alias: None
Product: xml
Classification: Unclassified
Component: Text-Edit (show other bugs)
Version: 7.0
Hardware: PC Linux
: P3 normal (vote)
Assignee: Svata Dedic
URL:
Keywords: API_REVIEW_FAST
Depends on:
Blocks:
 
Reported: 2011-06-27 18:16 UTC by Jesse Glick
Modified: 2011-11-17 07:39 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Proposed patch (18.42 KB, patch)
2011-10-20 06:48 UTC, Svata Dedic
Details | Diff
Proposed patch #2 (18.92 KB, patch)
2011-10-21 07:37 UTC, Svata Dedic
Details | Diff
Proposed patch, #3 (19.79 KB, patch)
2011-10-24 11:47 UTC, Svata Dedic
Details | Diff
Revised patch, unit test added (37.12 KB, patch)
2011-11-10 10:23 UTC, Svata Dedic
Details | Diff
apichanges corrected (39.48 KB, patch)
2011-11-10 10:52 UTC, Svata Dedic
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2011-06-27 18:16:40 UTC
E.g. after core-main #b7adb449ed59, Ant task completion items will show a page which may have HTML hyperlinks. But these do nothing when clicked. The reason (I suppose) is that XMLResultItem.Docum.resolveLink is a no-op.

Fix might require an API enhancement in GrammarResult so that it could specify a URL rather than raw description; or specify a base URL for resolving links.
Comment 1 Jesse Glick 2011-06-27 18:18:13 UTC
(In reply to comment #0)
> core-main #b7adb449ed59

Make that core-main #fa02d609943d.
Comment 2 Svata Dedic 2011-10-20 06:48:22 UTC
Created attachment 112241 [details]
Proposed patch
Comment 3 Svata Dedic 2011-10-20 06:52:21 UTC
Please review the proposed patch to XML Core APIs
Comment 4 Jesse Glick 2011-10-20 17:15:56 UTC
[JG01] spec.version.base must end in .0 for it to function properly: http://wiki.netbeans.org/DevFaqImplementationDependency

Anyway it is not clear from the patch why you added OpenIDE-Module-Implementation-Version to xml.text; you do not appear to be adding an implementation dependency on it from anywhere else. (And please avoid doing so anyway; we want to be removing impl deps, not adding fresh ones!)


[JG02] @NullAllowed need not be commented out. Just add a dep on Common Anno API.


[JG03] It seems like getDescription in the modified section of AntGrammar could just return null (or not be overridden at all), at least according to DescriptionSource Javadoc. I.e.:

list.add(new MyElement(element) {
  @Override public URL getContentURL() {
    ClassLoader cl = ...;
    URL manpage = ...;
    return manpage;
  }
});


[JG04] Tip: <code>null</code> can be written more easily {@code null}.


[JG05] {@link #resolveLink(java.net.URI)} does not match the actual signature of the method. (Vote for bug #194324.)
Comment 5 Svata Dedic 2011-10-21 07:37:22 UTC
Created attachment 112296 [details]
Proposed patch #2

Applied JG-x comments
Comment 6 Jesse Glick 2011-10-21 14:18:03 UTC
JG05 still outstanding.


[JG06] Javadoc for GrammarResult.getDescription might mention that it can be useful to use DescriptionSource.getContentURL even if you are not expecting links, simply because it can be easier to implement in case the content is kept in a separate file/resource.


BTW stray whitespace added at the end of XMLResultItem.java patch; make sure you have Remove Trailing Whitespace set (to From Modified Lines Only).
Comment 7 Svata Dedic 2011-10-24 11:47:13 UTC
Created attachment 112367 [details]
Proposed patch, #3

Adapted to comment #6
Comment 8 Jaroslav Tulach 2011-10-24 20:42:43 UTC
Y01 I see no unit test in patch #3.
Comment 9 Jesse Glick 2011-11-08 19:29:04 UTC
Any movement on this?


[JG07] Missing apichanges.xml entry.
Comment 10 Svata Dedic 2011-11-10 10:23:15 UTC
Created attachment 113076 [details]
Revised patch, unit test added

Was temporarily on hold; please see revised patch: unit tests to cover just the documentation feature were added, but the CC feature as a whole remains largely untested.
Comment 11 Svata Dedic 2011-11-10 10:52:40 UTC
Created attachment 113077 [details]
apichanges corrected

Updated+corrected apichanges in XML core module; the original version did not include the actual changelist.
Comment 12 Quality Engineering 2011-11-17 07:30:11 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/dc1a8c54520e
User: Svata Dedic <sdedic@netbeans.org>
Log: #199742: added mixing API interface to resolve link and provide base URL of documentation to XML completion core