Search in sources :

Example 1 with HTMLFormatProcessorImpl

use of org.eclipse.wst.html.core.internal.format.HTMLFormatProcessorImpl in project webtools.sourceediting by eclipse.

the class HTMLNodeActionManager method reformat.

public void reformat(Node newElement, boolean deep) {
    try {
        // tell the model that we are about to make a big model change
        fModel.aboutToChangeModel();
        // format selected node
        IStructuredFormatProcessor formatProcessor = new HTMLFormatProcessorImpl();
        formatProcessor.formatNode(newElement);
    } finally {
        // tell the model that we are done with the big model change
        fModel.changedModel();
    }
}
Also used : IStructuredFormatProcessor(org.eclipse.wst.sse.core.internal.format.IStructuredFormatProcessor) HTMLFormatProcessorImpl(org.eclipse.wst.html.core.internal.format.HTMLFormatProcessorImpl)

Example 2 with HTMLFormatProcessorImpl

use of org.eclipse.wst.html.core.internal.format.HTMLFormatProcessorImpl in project webtools.sourceediting by eclipse.

the class StructuredTextViewerConfigurationHTML method getContentFormatter.

public IContentFormatter getContentFormatter(ISourceViewer sourceViewer) {
    IContentFormatter formatter = super.getContentFormatter(sourceViewer);
    // generic one
    if (!(formatter instanceof MultiPassContentFormatter))
        formatter = new MultiPassContentFormatter(getConfiguredDocumentPartitioning(sourceViewer), IHTMLPartitions.HTML_DEFAULT);
    ((MultiPassContentFormatter) formatter).setMasterStrategy(new StructuredFormattingStrategy(new HTMLFormatProcessorImpl()));
    return formatter;
}
Also used : IContentFormatter(org.eclipse.jface.text.formatter.IContentFormatter) HTMLFormatProcessorImpl(org.eclipse.wst.html.core.internal.format.HTMLFormatProcessorImpl) MultiPassContentFormatter(org.eclipse.jface.text.formatter.MultiPassContentFormatter) StructuredFormattingStrategy(org.eclipse.wst.sse.ui.internal.format.StructuredFormattingStrategy)

Aggregations

HTMLFormatProcessorImpl (org.eclipse.wst.html.core.internal.format.HTMLFormatProcessorImpl)2 IContentFormatter (org.eclipse.jface.text.formatter.IContentFormatter)1 MultiPassContentFormatter (org.eclipse.jface.text.formatter.MultiPassContentFormatter)1 IStructuredFormatProcessor (org.eclipse.wst.sse.core.internal.format.IStructuredFormatProcessor)1 StructuredFormattingStrategy (org.eclipse.wst.sse.ui.internal.format.StructuredFormattingStrategy)1