Source:
public IHyperlink[] detectHyperlinks(ITextViewer textViewer, IRegion region, boolean canShowMultipleHyperlinks) { List<IHyperlink> links = new ArrayList<IHyperlink>(); IFile file = MarkerResolutionUtils.getFile(); if(file == null) return null; String extension = file.getFileExtension(); if("htm".equals(extension) || "html".equals(extension)){ StructuredModelWrapper smw = new StructuredModelWrapper(); smw.init(textViewer.getDocument()); try { Document xmlDocument = smw.getDocument(); if (xmlDocument == null) return null; AttrNodePair pair = Utils.findAttrNodePairForOffset(xmlDocument, region.getOffset()); if(pair != null && pair.getNode() != null && pair.getAttribute() != null){ if("input".equalsIgnoreCase(pair.getNode().getNodeName()) && "list".equalsIgnoreCase(pair.getAttribute().getNodeName())){ IRegion sourceRegion = null; try { sourceRegion = Utils.getAttributeValueRegion(textViewer.getDocument(), (Attr)pair.getAttribute()); } catch (BadLocationException e) { WebUiPlugin.getDefault().logError(e); } if(sourceRegion != null && region.getOffset() >= sourceRegion.getOffset() && region.getOffset() <= (sourceRegion.getOffset()+sourceRegion.getLength())){ String attrValue = pair.getAttribute().getNodeValue(); IndexedRegion node = findNodeWithId(xmlDocument, "datalist", attrValue); if(node != null){ Region targetRegion = new Region(node.getStartOffset(), node.getEndOffset() - node.getStartOffset()); links.add(new JumpToHyperlink(NLS.bind(WebUIMessages.ShowDatalist, attrValue), textViewer.getDocument(), sourceRegion, targetRegion)); } } } } } finally { smw.dispose(); } } if (links.size() == 0) return null; return (IHyperlink[])links.toArray(new IHyperlink[links.size()]); }

Target:
public IHyperlink[] detectHyperlinks(ITextViewer textViewer, IRegion region, boolean canShowMultipleHyperlinks) { List<IHyperlink> links = new ArrayList<IHyperlink>(); StructuredModelWrapper smw = new StructuredModelWrapper(); smw.init(textViewer.getDocument()); try { Document xmlDocument = smw.getDocument(); if (xmlDocument == null) return null; AttrNodePair pair = Utils.findAttrNodePairForOffset(xmlDocument, region.getOffset()); if(pair != null && pair.getNode() != null && pair.getAttribute() != null){ if("input".equalsIgnoreCase(pair.getNode().getNodeName()) && "list".equalsIgnoreCase(pair.getAttribute().getNodeName())){ IRegion sourceRegion = null; try { sourceRegion = Utils.getAttributeValueRegion(textViewer.getDocument(), (Attr)pair.getAttribute()); } catch (BadLocationException e) { WebUiPlugin.getDefault().logError(e); } if(sourceRegion != null && region.getOffset() >= sourceRegion.getOffset() && region.getOffset() <= (sourceRegion.getOffset()+sourceRegion.getLength())){ String attrValue = pair.getAttribute().getNodeValue(); IndexedRegion node = findNodeWithId(xmlDocument, "datalist", attrValue); if(node != null){ Region targetRegion = new Region(node.getStartOffset(), node.getEndOffset() - node.getStartOffset()); links.add(new JumpToHyperlink(NLS.bind(WebUIMessages.ShowDatalist, attrValue), textViewer.getDocument(), sourceRegion, targetRegion)); } } } } } finally { smw.dispose(); } if (links.size() == 0) return null; return (IHyperlink[])links.toArray(new IHyperlink[links.size()]); }