use of org.eclipse.core.runtime.preferences.IPreferencesService in project webtools.sourceediting by eclipse.
the class Validator method validate.
public ValidationReport validate(String uri, InputStream inputstream, NestedValidatorContext context, ValidationResult result) {
XMLValidator validator = XMLValidator.getInstance();
XMLValidationConfiguration configuration = new XMLValidationConfiguration();
try {
// Preferences pluginPreferences = XMLCorePlugin.getDefault().getPluginPreferences();
configuration.setFeature(XMLValidationConfiguration.INDICATE_NO_GRAMMAR, indicateNoGrammar);
final IPreferencesService preferencesService = Platform.getPreferencesService();
configuration.setFeature(XMLValidationConfiguration.INDICATE_NO_DOCUMENT_ELEMENT, preferencesService.getInt(XMLCorePlugin.getDefault().getBundle().getSymbolicName(), XMLCorePreferenceNames.INDICATE_NO_DOCUMENT_ELEMENT, -1, fPreferenceScopes));
configuration.setFeature(XMLValidationConfiguration.USE_XINCLUDE, preferencesService.getBoolean(XMLCorePlugin.getDefault().getBundle().getSymbolicName(), XMLCorePreferenceNames.USE_XINCLUDE, false, fPreferenceScopes));
configuration.setFeature(XMLValidationConfiguration.HONOUR_ALL_SCHEMA_LOCATIONS, preferencesService.getBoolean(XMLCorePlugin.getDefault().getBundle().getSymbolicName(), XMLCorePreferenceNames.HONOUR_ALL_SCHEMA_LOCATIONS, true, fPreferenceScopes));
} catch (Exception e) {
// TODO: Unable to set the preference. Log this problem.
}
XMLValidationReport valreport = validator.validate(uri, inputstream, configuration, result, context);
return valreport;
}
use of org.eclipse.core.runtime.preferences.IPreferencesService in project org.csstudio.display.builder by kasemir.
the class Preferences method get.
private static String get(final String setting, final String default_value) {
String value = default_value;
final IPreferencesService prefs = Platform.getPreferencesService();
if (prefs != null)
value = prefs.getString(RuntimePlugin.ID, setting, value, null);
return value;
}
use of org.eclipse.core.runtime.preferences.IPreferencesService in project org.csstudio.display.builder by kasemir.
the class Preferences method getUpdateDelayMillisec.
public static int getUpdateDelayMillisec() {
int milli = 100;
final IPreferencesService prefs = Platform.getPreferencesService();
if (prefs != null)
milli = prefs.getInt(ID, "update_delay", milli, null);
return milli;
}
use of org.eclipse.core.runtime.preferences.IPreferencesService in project org.csstudio.display.builder by kasemir.
the class Preferences method getLogPeriodSeconds.
// For explanation see preferences.ini
public static int getLogPeriodSeconds() {
int secs = 5;
final IPreferencesService prefs = Platform.getPreferencesService();
if (prefs != null)
secs = prefs.getInt(ID, "performance_log_period_secs", secs, null);
return secs;
}
use of org.eclipse.core.runtime.preferences.IPreferencesService in project org.csstudio.display.builder by kasemir.
the class Preferences method getLogThresholdMillisec.
public static int getLogThresholdMillisec() {
int milli = 20;
final IPreferencesService prefs = Platform.getPreferencesService();
if (prefs != null)
milli = prefs.getInt(ID, "performance_log_threshold_ms", milli, null);
return milli;
}
Aggregations