Search in sources :

Example 46 with Preferences

use of org.eclipse.core.runtime.Preferences in project webtools.sourceediting by eclipse.

the class HTMLCleanupProcessorImpl method getCleanupPreferences.

public IStructuredCleanupPreferences getCleanupPreferences() {
    if (fCleanupPreferences == null) {
        fCleanupPreferences = new StructuredCleanupPreferences();
        Preferences preferences = getModelPreferences();
        if (preferences != null) {
            fCleanupPreferences.setTagNameCase(preferences.getInt(HTMLCorePreferenceNames.CLEANUP_TAG_NAME_CASE));
            fCleanupPreferences.setAttrNameCase(preferences.getInt(HTMLCorePreferenceNames.CLEANUP_ATTR_NAME_CASE));
            fCleanupPreferences.setCompressEmptyElementTags(preferences.getBoolean(HTMLCorePreferenceNames.COMPRESS_EMPTY_ELEMENT_TAGS));
            fCleanupPreferences.setInsertRequiredAttrs(preferences.getBoolean(HTMLCorePreferenceNames.INSERT_REQUIRED_ATTRS));
            fCleanupPreferences.setInsertMissingTags(preferences.getBoolean(HTMLCorePreferenceNames.INSERT_MISSING_TAGS));
            fCleanupPreferences.setQuoteAttrValues(preferences.getBoolean(HTMLCorePreferenceNames.QUOTE_ATTR_VALUES));
            fCleanupPreferences.setFormatSource(preferences.getBoolean(HTMLCorePreferenceNames.FORMAT_SOURCE));
            fCleanupPreferences.setConvertEOLCodes(preferences.getBoolean(HTMLCorePreferenceNames.CONVERT_EOL_CODES));
            fCleanupPreferences.setEOLCode(preferences.getString(HTMLCorePreferenceNames.CLEANUP_EOL_CODE));
        }
    }
    return fCleanupPreferences;
}
Also used : IStructuredCleanupPreferences(org.eclipse.wst.sse.core.internal.cleanup.IStructuredCleanupPreferences) StructuredCleanupPreferences(org.eclipse.wst.sse.core.internal.cleanup.StructuredCleanupPreferences) Preferences(org.eclipse.core.runtime.Preferences) IStructuredCleanupPreferences(org.eclipse.wst.sse.core.internal.cleanup.IStructuredCleanupPreferences) StructuredCleanupPreferences(org.eclipse.wst.sse.core.internal.cleanup.StructuredCleanupPreferences)

Example 47 with Preferences

use of org.eclipse.core.runtime.Preferences in project webtools.sourceediting by eclipse.

the class TestContentFormatter method resetPreferencesToDefault.

private void resetPreferencesToDefault() {
    Preferences preferences = HTMLCorePlugin.getDefault().getPluginPreferences();
    preferences.setToDefault(HTMLCorePreferenceNames.SPLIT_MULTI_ATTRS);
    preferences.setToDefault(HTMLCorePreferenceNames.LINE_WIDTH);
    preferences.setToDefault(HTMLCorePreferenceNames.INDENTATION_CHAR);
    preferences.setToDefault(HTMLCorePreferenceNames.INDENTATION_SIZE);
    preferences.setToDefault(HTMLCorePreferenceNames.CLEAR_ALL_BLANK_LINES);
}
Also used : Preferences(org.eclipse.core.runtime.Preferences)

Example 48 with Preferences

use of org.eclipse.core.runtime.Preferences in project webtools.sourceediting by eclipse.

the class TestCleanupProcessorCSS 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);
    fCleanupProcessor = new CleanupProcessorCSS();
    fStringCompareUtil = new StringCompareUtil();
}
Also used : StringCompareUtil(org.eclipse.wst.css.core.tests.util.StringCompareUtil) CleanupProcessorCSS(org.eclipse.wst.css.core.internal.cleanup.CleanupProcessorCSS) Preferences(org.eclipse.core.runtime.Preferences)

Example 49 with Preferences

use of org.eclipse.core.runtime.Preferences in project webtools.sourceediting by eclipse.

the class AbstractModelTest method setUp.

protected void setUp() throws Exception {
    super.setUp();
    Preferences prefs = CSSCorePlugin.getDefault().getPluginPreferences();
    prefs.setValue(CSSCorePreferenceNames.CASE_IDENTIFIER, CSSCorePreferenceNames.LOWER);
    prefs.setValue(CSSCorePreferenceNames.CASE_PROPERTY_NAME, CSSCorePreferenceNames.LOWER);
    prefs.setValue(CSSCorePreferenceNames.CASE_PROPERTY_VALUE, CSSCorePreferenceNames.LOWER);
    fModel = FileUtil.createModel();
}
Also used : Preferences(org.eclipse.core.runtime.Preferences)

Example 50 with Preferences

use of org.eclipse.core.runtime.Preferences in project webtools.sourceediting by eclipse.

the class CleanupProcessorXML method getCleanupPreferences.

public IStructuredCleanupPreferences getCleanupPreferences() {
    if (fCleanupPreferences == null) {
        fCleanupPreferences = new StructuredCleanupPreferences();
        Preferences preferences = getModelPreferences();
        if (preferences != null) {
            fCleanupPreferences.setCompressEmptyElementTags(preferences.getBoolean(XMLCorePreferenceNames.COMPRESS_EMPTY_ELEMENT_TAGS));
            fCleanupPreferences.setInsertRequiredAttrs(preferences.getBoolean(XMLCorePreferenceNames.INSERT_REQUIRED_ATTRS));
            fCleanupPreferences.setInsertMissingTags(preferences.getBoolean(XMLCorePreferenceNames.INSERT_MISSING_TAGS));
            fCleanupPreferences.setQuoteAttrValues(preferences.getBoolean(XMLCorePreferenceNames.QUOTE_ATTR_VALUES));
            fCleanupPreferences.setFormatSource(preferences.getBoolean(XMLCorePreferenceNames.FORMAT_SOURCE));
            fCleanupPreferences.setConvertEOLCodes(preferences.getBoolean(XMLCorePreferenceNames.CONVERT_EOL_CODES));
            fCleanupPreferences.setEOLCode(preferences.getString(XMLCorePreferenceNames.CLEANUP_EOL_CODE));
        }
    }
    return fCleanupPreferences;
}
Also used : IStructuredCleanupPreferences(org.eclipse.wst.sse.core.internal.cleanup.IStructuredCleanupPreferences) StructuredCleanupPreferences(org.eclipse.wst.sse.core.internal.cleanup.StructuredCleanupPreferences) Preferences(org.eclipse.core.runtime.Preferences) IStructuredCleanupPreferences(org.eclipse.wst.sse.core.internal.cleanup.IStructuredCleanupPreferences) StructuredCleanupPreferences(org.eclipse.wst.sse.core.internal.cleanup.StructuredCleanupPreferences)

Aggregations

Preferences (org.eclipse.core.runtime.Preferences)113 ByteArrayInputStream (java.io.ByteArrayInputStream)7 IndexedRegion (org.eclipse.wst.sse.core.internal.provisional.IndexedRegion)7 IFile (org.eclipse.core.resources.IFile)6 PartInitException (org.eclipse.ui.PartInitException)6 CSSCleanupStrategy (org.eclipse.wst.css.core.internal.cleanup.CSSCleanupStrategy)6 IStructuredDocument (org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument)6 ByteArrayOutputStream (java.io.ByteArrayOutputStream)5 OutputStreamWriter (java.io.OutputStreamWriter)5 IStructuredFormatPreferences (org.eclipse.wst.sse.core.internal.format.IStructuredFormatPreferences)5 ArrayList (java.util.ArrayList)4 CoreException (org.eclipse.core.runtime.CoreException)4 ICSSStyleDeclItem (org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleDeclItem)4 IStructuredCleanupPreferences (org.eclipse.wst.sse.core.internal.cleanup.IStructuredCleanupPreferences)4 StructuredCleanupPreferences (org.eclipse.wst.sse.core.internal.cleanup.StructuredCleanupPreferences)4 List (java.util.List)3 Vector (java.util.Vector)3 ITextRegion (org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion)3 ResultSet (java.sql.ResultSet)2 Statement (java.sql.Statement)2