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;
}
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);
}
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();
}
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();
}
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;
}
Aggregations