Search in sources :

Example 16 with IStructuredFormatProcessor

use of org.eclipse.wst.sse.core.internal.format.IStructuredFormatProcessor in project webtools.sourceediting by eclipse.

the class AbstractCommand method formatChild.

protected void formatChild(Element child) {
    if (child instanceof IDOMNode) {
        IDOMModel model = ((IDOMNode) child).getModel();
        try {
            // tell the model that we are about to make a big model change
            model.aboutToChangeModel();
            IStructuredFormatProcessor formatProcessor = new FormatProcessorXML();
            formatProcessor.formatNode(child);
        } finally {
            // tell the model that we are done with the big model change
            model.changedModel();
        }
    }
}
Also used : IStructuredFormatProcessor(org.eclipse.wst.sse.core.internal.format.IStructuredFormatProcessor) IDOMNode(org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode) IDOMModel(org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel) FormatProcessorXML(org.eclipse.wst.xml.core.internal.provisional.format.FormatProcessorXML)

Aggregations

IStructuredFormatProcessor (org.eclipse.wst.sse.core.internal.format.IStructuredFormatProcessor)16 FormatProcessorXML (org.eclipse.wst.xml.core.internal.provisional.format.FormatProcessorXML)8 IDOMNode (org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode)6 IContentType (org.eclipse.core.runtime.content.IContentType)5 IDOMModel (org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel)5 CoreException (org.eclipse.core.runtime.CoreException)4 IContentDescription (org.eclipse.core.runtime.content.IContentDescription)4 IOException (java.io.IOException)2 IContainer (org.eclipse.core.resources.IContainer)2 IFile (org.eclipse.core.resources.IFile)2 IStatus (org.eclipse.core.runtime.IStatus)2 MultiStatus (org.eclipse.core.runtime.MultiStatus)2 Status (org.eclipse.core.runtime.Status)2 MalformedInputExceptionWithDetail (org.eclipse.wst.sse.core.internal.exceptions.MalformedInputExceptionWithDetail)2 Iterator (java.util.Iterator)1 Vector (java.util.Vector)1 SubProgressMonitor (org.eclipse.core.runtime.SubProgressMonitor)1 IContentTypeManager (org.eclipse.core.runtime.content.IContentTypeManager)1 BadLocationException (org.eclipse.jface.text.BadLocationException)1 DocumentRewriteSession (org.eclipse.jface.text.DocumentRewriteSession)1