use of org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion in project webtools.sourceediting by eclipse.
the class DTDStructuredDocumentReParser method checkForCrossStructuredDocumentRegionBoundryCases.
public StructuredDocumentEvent checkForCrossStructuredDocumentRegionBoundryCases() {
IStructuredDocumentRegion startNode = fStructuredDocument.getRegionAtCharacterOffset(fStart);
IStructuredDocumentRegion endNode = fStructuredDocument.getRegionAtCharacterOffset(fStart + fLengthToReplace - 1);
return reparse(startNode.getStart(), endNode.getEnd());
}
use of org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion in project webtools.sourceediting by eclipse.
the class TopLevelNode method getFullText.
// includes what gettext gives us plus any whitespace
// trailing it
public String getFullText() {
StringBuffer sb = new StringBuffer();
Iterator iter = flatNodes.iterator();
while (iter.hasNext()) {
IStructuredDocumentRegion fNode = (IStructuredDocumentRegion) iter.next();
sb.append(fNode.getText());
}
return sb.toString();
}
use of org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion in project webtools.sourceediting by eclipse.
the class TopLevelNode method delete.
// specialize this so we delete the objects flat node range
// AND any whitespace
public void delete() {
// $NON-NLS-1$
beginRecording(getDTDFile(), DTDCoreMessages._UI_LABEL_TOP_LEVEL_NODE_DELETE);
IStructuredDocumentRegion first = (IStructuredDocumentRegion) flatNodes.get(0);
IStructuredDocumentRegion last = (IStructuredDocumentRegion) flatNodes.get(flatNodes.size() - 1);
int startOffset = first.getStartOffset();
int endOffset = last.getEndOffset();
// $NON-NLS-1$
replaceText(getDTDFile(), startOffset, endOffset - startOffset, "");
endRecording(getDTDFile());
}
use of org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion in project webtools.sourceediting by eclipse.
the class StructuredDocumentRegionIterator method toVector.
public static final Vector toVector(IStructuredDocumentRegion headNode) {
IStructuredDocumentRegion aNode = headNode;
Vector v = new Vector();
while (aNode != null) {
v.addElement(aNode);
aNode = aNode.getNext();
}
return v;
}
use of org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion in project webtools.sourceediting by eclipse.
the class StructuredDocumentRegionIterator method adjustStart.
public static final IStructuredDocumentRegion adjustStart(IStructuredDocumentRegion headNode, int adjustment) {
IStructuredDocumentRegion aNode = headNode;
while (aNode != null) {
aNode.adjustStart(adjustment);
aNode = aNode.getNext();
}
return headNode;
}
Aggregations