Search in sources :

Example 56 with IPreferencesService

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;
}
Also used : XMLValidationConfiguration(org.eclipse.wst.xml.core.internal.validation.XMLValidationConfiguration) XMLValidationReport(org.eclipse.wst.xml.core.internal.validation.XMLValidationReport) IPreferencesService(org.eclipse.core.runtime.preferences.IPreferencesService)

Example 57 with IPreferencesService

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;
}
Also used : IPreferencesService(org.eclipse.core.runtime.preferences.IPreferencesService)

Example 58 with IPreferencesService

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;
}
Also used : IPreferencesService(org.eclipse.core.runtime.preferences.IPreferencesService)

Example 59 with IPreferencesService

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;
}
Also used : IPreferencesService(org.eclipse.core.runtime.preferences.IPreferencesService)

Example 60 with IPreferencesService

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;
}
Also used : IPreferencesService(org.eclipse.core.runtime.preferences.IPreferencesService)

Aggregations

IPreferencesService (org.eclipse.core.runtime.preferences.IPreferencesService)96 IFile (org.eclipse.core.resources.IFile)26 ArrayList (java.util.ArrayList)15 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)15 WorkspaceJob (org.eclipse.core.resources.WorkspaceJob)14 IProject (org.eclipse.core.resources.IProject)13 CoreException (org.eclipse.core.runtime.CoreException)13 Module (org.eclipse.titan.designer.AST.Module)11 ProjectSourceParser (org.eclipse.titan.designer.parsers.ProjectSourceParser)11 List (java.util.List)10 File (java.io.File)8 TextSelection (org.eclipse.jface.text.TextSelection)8 Path (org.eclipse.core.runtime.Path)6 IContainer (org.eclipse.core.resources.IContainer)5 IMarker (org.eclipse.core.resources.IMarker)5 IPath (org.eclipse.core.runtime.IPath)5 SubMonitor (org.eclipse.core.runtime.SubMonitor)5 RefactoringStatus (org.eclipse.ltk.core.refactoring.RefactoringStatus)5 IOException (java.io.IOException)4 IStatus (org.eclipse.core.runtime.IStatus)4