use of org.eclipse.wst.dtd.core.internal.text.RegionIterator in project webtools.sourceediting by eclipse.
the class Attribute method resolveRegions.
public void resolveRegions() {
removeChildNodes();
RegionIterator iter = iterator();
while (iter.hasNext()) {
ITextRegion currentRegion = iter.next();
if (currentRegion.getType().equals(DTDRegionTypes.LEFT_PAREN)) {
enumList = new AttributeEnumList(getDTDFile(), getStructuredDTDDocumentRegion());
}
if (enumList != null) {
enumList.addRegion(currentRegion);
if (currentRegion.getType() == DTDRegionTypes.RIGHT_PAREN) {
return;
}
}
}
}
use of org.eclipse.wst.dtd.core.internal.text.RegionIterator in project webtools.sourceediting by eclipse.
the class AttributeList method resolveRegions.
public void resolveRegions() {
removeChildNodes();
RegionIterator iter = iterator();
if (getNameRegion() != null) {
// we skip past the name token is our name
skipPastName(iter);
}
ArrayList children = new ArrayList();
Attribute attribute = null;
boolean trailingWhitespace = false;
while (iter.hasNext()) {
ITextRegion currentRegion = iter.next();
if (currentRegion.getType().equals(DTDRegionTypes.ATTRIBUTE_NAME)) {
attribute = new Attribute(getDTDFile(), getStructuredDTDDocumentRegion());
children.add(attribute);
appendChild(attribute);
trailingWhitespace = false;
}
if (attribute != null && currentRegion.getType() != DTDRegionTypes.END_TAG) {
if (!trailingWhitespace) {
attribute.addRegion(currentRegion);
} else {
if (currentRegion.getType() == DTDRegionTypes.WHITESPACE) {
attribute.addWhitespaceRegion(currentRegion);
}
}
// up by the attribute
if (currentRegion.getType() == DTDRegionTypes.REQUIRED_KEYWORD || currentRegion.getType() == DTDRegionTypes.IMPLIED_KEYWORD || currentRegion.getType() == DTDRegionTypes.SINGLEQUOTED_LITERAL || currentRegion.getType() == DTDRegionTypes.DOUBLEQUOTED_LITERAL) {
trailingWhitespace = true;
}
}
}
int numKids = children.size();
for (int i = 0; i < numKids; i++) {
((Attribute) children.get(i)).resolveRegions();
}
// end of for ()
}
Aggregations