Search in sources :

Example 1 with FormatProcessorCSS

use of org.eclipse.wst.css.core.internal.format.FormatProcessorCSS in project webtools.sourceediting by eclipse.

the class StructuredTextViewerConfigurationCSS method getContentFormatter.

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

Example 2 with FormatProcessorCSS

use of org.eclipse.wst.css.core.internal.format.FormatProcessorCSS in project webtools.sourceediting by eclipse.

the class TestFormatProcessorCSS method setUp.

protected void setUp() throws Exception {
    // set up preferences
    Preferences prefs = CSSCorePlugin.getDefault().getPluginPreferences();
    fOldClearBlankLinesPref = prefs.getBoolean(CSSCorePreferenceNames.CLEAR_ALL_BLANK_LINES);
    fOldMaxLineWidthPref = prefs.getInt(CSSCorePreferenceNames.LINE_WIDTH);
    fOldIndentationCharPref = prefs.getString(CSSCorePreferenceNames.INDENTATION_CHAR);
    fOldIndentationSizePref = prefs.getInt(CSSCorePreferenceNames.INDENTATION_SIZE);
    prefs.setValue(CSSCorePreferenceNames.CLEAR_ALL_BLANK_LINES, false);
    prefs.setValue(CSSCorePreferenceNames.LINE_WIDTH, 72);
    prefs.setValue(CSSCorePreferenceNames.INDENTATION_CHAR, CSSCorePreferenceNames.TAB);
    prefs.setValue(CSSCorePreferenceNames.INDENTATION_SIZE, 1);
    formatProcessor = new FormatProcessorCSS();
    fStringCompareUtil = new StringCompareUtil();
}
Also used : StringCompareUtil(org.eclipse.wst.css.core.tests.util.StringCompareUtil) FormatProcessorCSS(org.eclipse.wst.css.core.internal.format.FormatProcessorCSS) Preferences(org.eclipse.core.runtime.Preferences)

Aggregations

FormatProcessorCSS (org.eclipse.wst.css.core.internal.format.FormatProcessorCSS)2 Preferences (org.eclipse.core.runtime.Preferences)1 IContentFormatter (org.eclipse.jface.text.formatter.IContentFormatter)1 MultiPassContentFormatter (org.eclipse.jface.text.formatter.MultiPassContentFormatter)1 StringCompareUtil (org.eclipse.wst.css.core.tests.util.StringCompareUtil)1 StructuredFormattingStrategy (org.eclipse.wst.sse.ui.internal.format.StructuredFormattingStrategy)1