| Summary: | [api] Provide multiple task hyperlink extraction from text | ||
|---|---|---|---|
| Product: | z_Archived | Reporter: | Eugene Kuleshov <ekuleshov> |
| Component: | Mylyn | Assignee: | Steffen Pingel <steffen.pingel> |
| Status: | RESOLVED DUPLICATE | QA Contact: | |
| Severity: | normal | ||
| Priority: | P4 | ||
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | All | ||
| Whiteboard: | |||
Currently only one hyperlink can be displayed thus only one hyperlink must be returned, the 'one' we want. Thus the lineOffset constraint in this method. We could add an additional method that just returns all hyperlinks. IHyperlinkDetector.detectHyperlinks() have canShowMultipleHyperlinks parameter, which is currently not respected by task hyperlink detector. Though I am still puzzled by JIRA's detector is working without this range check and multiple JIRA links (even on the same line) are working just fine. I had a look at the JIRA hyperlink detector and it is using the lineOffset, albeit in a slightly different manner, to achieve the same result: detection of a single hyperlink located under the cursor, which is what we need for hyperlink detection in editors/viewers. The canShowMultipleHyperlinks parameter is ignored because the platform's DefaultHyperlinkPresenter isn't capable of displaying multiple hyperlinks for a given region. However, decoration of all hyperlinks in the body of the text is supported by the DefaultDamagerRepairer via RepositoryViewerConfig. So Eugene, if you want to let me know what requirements you have here we can add the api. With 3.4M6 we got multiple hyperlink support, Eugene, do you want to look into what the implications are for 3.0? (In reply to comment #5) > With 3.4M6 we got multiple hyperlink support, Eugene, do you want to look into > what the implications are for 3.0? Sorry, Rob, I am not sure when I'll be moving to 3.4m6. Probably not until after j1. No worries. I'll push post 3.0 here and we can revisit then. *** This bug has been marked as a duplicate of bug 244442 *** |
I found something strange in Bugzilla and Trac hyperlink detectors (strangely, detector for JIRA that I wrote don't have that). So, BugzillaRepositoryUi.findHyperlinks() have check like this: Matcher m = PATTERN.matcher(text); while (m.find()) { if (lineOffset >= m.start() && lineOffset <= m.end()) { IHyperlink link = extractHyperlink(repository, regionOffset, m); if (link != null) hyperlinksFound.add(link); } } So, this detection is only working if you point lineOffset inside that potential hyperlink. That is fine if it is called from the mouse events, but it does not work if I need to fetch all hyperlinks from any given text. If we just get rid of the lineOffset condition (note that Platform's urlhyperlinkdetector don't do such range check), then hyperlinks will behave weird in the task editor (the whole line is hyperlinked). So, there is probably something wrong in task editor too.