public static IRegion getValueRegion(IDOMAttr attr) { int regOffset = attr.getValueRegionStartOffset(); int regLength = attr.getValueRegionText().length(); String attValue = attr.getValueRegionText(); if (StringUtils.isQuoted(attValue)) { regOffset++; regLength -= 2; } return new Region(regOffset, regLength); }
protected SearchMatch createSearchMatch(IFile file, Attr attributeNode) { int start = 0; int length = 0; if(attributeNode instanceof IDOMAttr){ IDOMAttr domAttr = (IDOMAttr)attributeNode; start = domAttr.getValueRegionStartOffset(); length = domAttr.getValueRegionText().length(); } SearchMatch match = new SearchMatch(attributeNode, start, length, file); return match; }
if (attributeNode != null) { startEndPositions[0] = attributeNode.getValueRegionStartOffset(); startEndPositions[1] = startEndPositions[0] + attributeNode.getValueRegionText().length();
private IRegion getHyperlinkRegion(Node node) { IRegion hyperRegion = null; if (node != null) { short nodeType = node.getNodeType(); if (nodeType == Node.DOCUMENT_TYPE_NODE) { // handle doc type node IDOMNode docNode = (IDOMNode) node; hyperRegion = new Region(docNode.getStartOffset(), docNode.getEndOffset() - docNode.getStartOffset()); } else if (nodeType == Node.ATTRIBUTE_NODE) { // handle attribute nodes IDOMAttr att = (IDOMAttr) node; // do not include quotes in attribute value region int regOffset = att.getValueRegionStartOffset(); ITextRegion valueRegion = att.getValueRegion(); if (valueRegion != null) { int regLength = valueRegion.getTextLength(); String attValue = att.getValueRegionText(); if (StringUtils.isQuoted(attValue)) { ++regOffset; regLength = regLength - 2; } hyperRegion = new Region(regOffset, regLength); } } } return hyperRegion; }
String source = ((IDOMAttr) a).getValueRegionText(); if (source != null) { char firstChar = source.charAt(0);
IDOMAttr eachAttr = (IDOMAttr) attributes.item(i); String oldAttrValue = eachAttr.getValueRegionText(); if (oldAttrValue == null) { IDOMModel structuredModel = node.getModel();
String oldAttrValue = eachAttr.getValueRegionText(); if (oldAttrValue == null) { IDOMModel structuredModel = node.getModel();
String attValue = att.getValueRegionText();