Search in sources :

Example 76 with IStructuredDocumentRegion

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());
}
Also used : IStructuredDocumentRegion(org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion)

Example 77 with IStructuredDocumentRegion

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();
}
Also used : IStructuredDocumentRegion(org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion) RegionIterator(org.eclipse.wst.dtd.core.internal.text.RegionIterator) Iterator(java.util.Iterator)

Example 78 with IStructuredDocumentRegion

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());
}
Also used : IStructuredDocumentRegion(org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion)

Example 79 with IStructuredDocumentRegion

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;
}
Also used : IStructuredDocumentRegion(org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion) Vector(java.util.Vector)

Example 80 with IStructuredDocumentRegion

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;
}
Also used : IStructuredDocumentRegion(org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion)

Aggregations

IStructuredDocumentRegion (org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion)439 ITextRegion (org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion)174 IDOMNode (org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode)99 ITextRegionList (org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList)87 IStructuredDocument (org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument)70 List (java.util.List)40 BadLocationException (org.eclipse.jface.text.BadLocationException)39 ArrayList (java.util.ArrayList)38 Iterator (java.util.Iterator)35 IndexedRegion (org.eclipse.wst.sse.core.internal.provisional.IndexedRegion)35 Node (org.w3c.dom.Node)30 ITextRegionContainer (org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionContainer)26 RegionIterator (org.eclipse.wst.css.core.internal.util.RegionIterator)19 IDOMModel (org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel)19 CustomCompletionProposal (org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal)17 IStructuredModel (org.eclipse.wst.sse.core.internal.provisional.IStructuredModel)15 CMElementDeclaration (org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration)15 ICSSNode (org.eclipse.wst.css.core.internal.provisional.document.ICSSNode)14 CMNamedNodeMap (org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap)13 NodeList (org.w3c.dom.NodeList)13