private String getRegionName(ITextRegionCollection containerRegion) { ITextRegionList regions = containerRegion.getRegions(); ITextRegion nameRegion = null; for (int i = 0; i < regions.size(); i++) { ITextRegion r = regions.get(i); if (r.getType() == DOMRegionContext.XML_TAG_NAME) { nameRegion = r; break; } } return nameRegion != null ? containerRegion.getText(nameRegion).trim() : null; }
protected void validateRegionContainer(ITextRegionCollection container, IReporter reporter, IFile file) { ITextRegionCollection containerRegion = container; Iterator regions = containerRegion.getRegions().iterator(); ITextRegion region = null; while (regions.hasNext() && !reporter.isCancelled()) { region = (ITextRegion) regions.next(); String type = region.getType(); if (type != null && region instanceof ITextRegionCollection) { ITextRegionCollection parentRegion = ((ITextRegionCollection) region); Iterator childRegions = parentRegion.getRegions().iterator(); while (childRegions.hasNext() && !reporter.isCancelled()) { ITextRegion childRegion = (ITextRegion) childRegions.next(); if (childRegion.getType() == DOMJSPRegionContexts.JSP_EL_CONTENT) validateXMLNode(parentRegion, childRegion, reporter, file); } } } }
private boolean isSelfClosingTag(ITextRegionCollection containerRegion) { if (containerRegion == null) return false; ITextRegionList regions = containerRegion.getRegions(); ITextRegion r = regions.get(regions.size() - 1); return r.getType() == DOMRegionContext.XML_EMPTY_TAG_CLOSE; }
private boolean isSelfClosingTag(ITextRegionCollection containerRegion) { if (containerRegion == null) return false; ITextRegionList regions = containerRegion.getRegions(); ITextRegion r = regions.get(regions.size() - 1); return r.getType() == DOMRegionContext.XML_EMPTY_TAG_CLOSE; }
/** * Pass the ITextRegionCollection which is the embedded region * * @param iterator */ private void translateEmbeddedJSPInBlock(ITextRegionCollection collection) { Iterator regions = collection.getRegions().iterator(); ITextRegion region = null; while (regions.hasNext()) { region = (ITextRegion) regions.next(); if (isJSP(region.getType())) break; region = null; } if (region != null) { translateEmbeddedJSPInAttribute(collection); } }
String className = null; Iterator regions = container.getRegions().iterator(); while (regions.hasNext() && (r = (ITextRegion) regions.next()) != null && (r.getType() != DOMRegionContext.XML_TAG_CLOSE || r.getType() != DOMRegionContext.XML_EMPTY_TAG_CLOSE)) {
ITextRegionList regions = jspReferenceRegion.getRegions(); ITextRegion r = null; String attrName = "", attrValue = ""; //$NON-NLS-1$ //$NON-NLS-2$
/** * * @param jspReferenceRegion * @return */ private boolean isUsebeanTag(ITextRegionCollection jspReferenceRegion) { ITextRegionList regions = jspReferenceRegion.getRegions(); ITextRegion r = null; boolean isUseBean = false; for (int i = 0; i < regions.size(); i++) { r = regions.get(i); // https://bugs.eclipse.org/bugs/show_bug.cgi?id=128490 // length of 11 is the length of jsp:useBean // and saves the expensive getText.equals call if (r.getType() == DOMRegionContext.XML_TAG_NAME) { if (r.getTextLength() == 11 && jspReferenceRegion.getText(r).equals("jsp:useBean")) { //$NON-NLS-1$ isUseBean = true; } // break no matter what if you hit tagname break; } } return isUseBean; }
Iterator regions = containerRegion.getRegions().iterator(); ITextRegion region = null; while (regions.hasNext()) {
Iterator regions = containerRegion.getRegions().iterator(); ITextRegion region = null; String uri = null;
ITextRegionList regions = jspReferenceRegion.getRegions(); int size = regions.size();
if (stRegion.getRegions() != null && stRegion.getRegions().size() > 1) { ITextRegion jspContent = stRegion.getRegions().get(1); // should if (stRegion.getRegions() != null && stRegion.getRegions().size() > 1) jspContent = stRegion.getRegions().get(1); return (jspContent != null) ? stRegion.getFullText(jspContent) : stRegion.getFullText(); // don't
ITextRegionList embeddedRegions = embeddedContainer.getRegions(); ITextRegion delim = null; ITextRegion content = null;
final ITextRegionList regionList = parentRegion.getRegions(); if (regionList.size() >= 4)