Search in sources :

Example 1 with TagNameRegion

use of org.eclipse.wst.xml.core.internal.parser.regions.TagNameRegion in project webtools.sourceediting by eclipse.

the class NodeFormatter method removeRegionSpaces.

protected void removeRegionSpaces(IDOMNode node, IStructuredDocumentRegion flatNode, ITextRegion region) {
    if ((region != null) && (region instanceof ContextRegion || region instanceof TagNameRegion) && (flatNode.getEndOffset(region) > flatNode.getTextEndOffset(region))) {
        IDOMModel structuredModel = node.getModel();
        IStructuredDocument structuredDocument = structuredModel.getStructuredDocument();
        replace(structuredDocument, flatNode.getTextEndOffset(region), flatNode.getEndOffset(region) - flatNode.getTextEndOffset(region), EMPTY_STRING);
    }
}
Also used : IDOMModel(org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel) ContextRegion(org.eclipse.wst.sse.core.internal.parser.ContextRegion) IStructuredDocument(org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument) TagNameRegion(org.eclipse.wst.xml.core.internal.parser.regions.TagNameRegion)

Aggregations

ContextRegion (org.eclipse.wst.sse.core.internal.parser.ContextRegion)1 IStructuredDocument (org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument)1 TagNameRegion (org.eclipse.wst.xml.core.internal.parser.regions.TagNameRegion)1 IDOMModel (org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel)1