use of org.eclipse.core.runtime.Preferences in project webtools.sourceediting by eclipse.
the class AutoEditStrategyForTabs method getIndentationWidth.
/**
* Returns indentation width if using spaces for indentation, -1 otherwise
*
* @return
*/
private int getIndentationWidth() {
int width = -1;
Preferences preferences = HTMLCorePlugin.getDefault().getPluginPreferences();
if (HTMLCorePreferenceNames.SPACE.equals(preferences.getString(HTMLCorePreferenceNames.INDENTATION_CHAR)))
width = preferences.getInt(HTMLCorePreferenceNames.INDENTATION_SIZE);
return width;
}
use of org.eclipse.core.runtime.Preferences in project webtools.sourceediting by eclipse.
the class NewHTMLFileWizardPage method addDefaultExtension.
/**
* Adds default extension to the filename
*
* @param filename
* @return
*/
String addDefaultExtension(String filename) {
StringBuffer newFileName = new StringBuffer(filename);
Preferences preference = HTMLCorePlugin.getDefault().getPluginPreferences();
String ext = preference.getString(HTMLCorePreferenceNames.DEFAULT_EXTENSION);
// $NON-NLS-1$
newFileName.append(".");
newFileName.append(ext);
return newFileName.toString();
}
use of org.eclipse.core.runtime.Preferences in project webtools.sourceediting by eclipse.
the class CSSSourcePreferencePage method storeValuesForFormattingGroup.
private void storeValuesForFormattingGroup() {
// Formatting
Preferences prefs = getModelPreferences();
prefs.setValue(CSSCorePreferenceNames.LINE_WIDTH, fLineWidthText.getText());
prefs.setValue(CSSCorePreferenceNames.WRAPPING_ONE_PER_LINE, fPropertyPerLine.getSelection());
prefs.setValue(CSSCorePreferenceNames.WRAPPING_PROHIBIT_WRAP_ON_ATTR, fNowrapAttr.getSelection());
prefs.setValue(CSSCorePreferenceNames.FORMAT_SPACE_BETWEEN_SELECTORS, spaceBetweenSelectors.getSelection());
if (fIndentUsingTabs.getSelection()) {
getModelPreferences().setValue(CSSCorePreferenceNames.INDENTATION_CHAR, CSSCorePreferenceNames.TAB);
} else {
getModelPreferences().setValue(CSSCorePreferenceNames.INDENTATION_CHAR, CSSCorePreferenceNames.SPACE);
}
getModelPreferences().setValue(CSSCorePreferenceNames.INDENTATION_SIZE, fIndentationSize.getSelection());
}
use of org.eclipse.core.runtime.Preferences in project webtools.sourceediting by eclipse.
the class CSSSourcePreferencePage method storeValuesForContentAssistGroup.
private void storeValuesForContentAssistGroup() {
// not content assist, but preferred case
Preferences prefs = getModelPreferences();
prefs.setValue(CSSCorePreferenceNames.CASE_IDENTIFIER, (fIdentUpper.getSelection()) ? CSSCorePreferenceNames.UPPER : CSSCorePreferenceNames.LOWER);
prefs.setValue(CSSCorePreferenceNames.CASE_SELECTOR, (fSelectorUpper.getSelection()) ? CSSCorePreferenceNames.UPPER : CSSCorePreferenceNames.LOWER);
prefs.setValue(CSSCorePreferenceNames.CASE_PROPERTY_NAME, (fPropNameUpper.getSelection()) ? CSSCorePreferenceNames.UPPER : CSSCorePreferenceNames.LOWER);
prefs.setValue(CSSCorePreferenceNames.CASE_PROPERTY_VALUE, (fPropValueUpper.getSelection()) ? CSSCorePreferenceNames.UPPER : CSSCorePreferenceNames.LOWER);
}
use of org.eclipse.core.runtime.Preferences in project webtools.sourceediting by eclipse.
the class CSSSourcePreferencePage method initializeValuesForContentAssistGroup.
private void initializeValuesForContentAssistGroup() {
// not content assist, but preferred case
Preferences prefs = getModelPreferences();
fIdentUpper.setSelection(prefs.getInt(CSSCorePreferenceNames.CASE_IDENTIFIER) == CSSCorePreferenceNames.UPPER);
fIdentLower.setSelection(prefs.getInt(CSSCorePreferenceNames.CASE_IDENTIFIER) == CSSCorePreferenceNames.LOWER);
fSelectorUpper.setSelection(prefs.getInt(CSSCorePreferenceNames.CASE_SELECTOR) == CSSCorePreferenceNames.UPPER);
fSelectorLower.setSelection(prefs.getInt(CSSCorePreferenceNames.CASE_SELECTOR) == CSSCorePreferenceNames.LOWER);
fPropNameUpper.setSelection(prefs.getInt(CSSCorePreferenceNames.CASE_PROPERTY_NAME) == CSSCorePreferenceNames.UPPER);
fPropNameLower.setSelection(prefs.getInt(CSSCorePreferenceNames.CASE_PROPERTY_NAME) == CSSCorePreferenceNames.LOWER);
fPropValueUpper.setSelection(prefs.getInt(CSSCorePreferenceNames.CASE_PROPERTY_VALUE) == CSSCorePreferenceNames.UPPER);
fPropValueLower.setSelection(prefs.getInt(CSSCorePreferenceNames.CASE_PROPERTY_VALUE) == CSSCorePreferenceNames.LOWER);
}
Aggregations