Search in sources :

Example 1 with FixedScopedPreferenceStore

use of org.eclipse.xtext.ui.editor.preferences.FixedScopedPreferenceStore in project xtext-xtend by eclipse.

the class XtendPreferenceStoreAccess method getContextPreferenceStore.

@SuppressWarnings("all")
@Override
public IPreferenceStore getContextPreferenceStore(Object context) {
    IProject project = getProject(context);
    if (project == null)
        return getPreferenceStore();
    IPreferenceStore store = super.getContextPreferenceStore(context);
    ProjectScope projectScope = new ProjectScope(project);
    FixedScopedPreferenceStore jdtStore = new FixedScopedPreferenceStore(projectScope, JavaCore.PLUGIN_ID);
    jdtStore.setSearchContexts(new IScopeContext[] { projectScope, new InstanceScope(), new ConfigurationScope() });
    return new ChainedPreferenceStore(new IPreferenceStore[] { store, jdtStore, PreferenceConstants.getPreferenceStore() });
}
Also used : ProjectScope(org.eclipse.core.resources.ProjectScope) InstanceScope(org.eclipse.core.runtime.preferences.InstanceScope) ChainedPreferenceStore(org.eclipse.ui.texteditor.ChainedPreferenceStore) IPreferenceStore(org.eclipse.jface.preference.IPreferenceStore) FixedScopedPreferenceStore(org.eclipse.xtext.ui.editor.preferences.FixedScopedPreferenceStore) IProject(org.eclipse.core.resources.IProject) ConfigurationScope(org.eclipse.core.runtime.preferences.ConfigurationScope)

Example 2 with FixedScopedPreferenceStore

use of org.eclipse.xtext.ui.editor.preferences.FixedScopedPreferenceStore in project xtext-xtend by eclipse.

the class XtendPreferenceStoreAccess method getPreferenceStore.

@SuppressWarnings("all")
@Override
public IPreferenceStore getPreferenceStore() {
    IPreferenceStore store = super.getPreferenceStore();
    FixedScopedPreferenceStore jdtStore = new FixedScopedPreferenceStore(new InstanceScope(), JavaCore.PLUGIN_ID);
    jdtStore.setSearchContexts(new IScopeContext[] { new InstanceScope(), new ConfigurationScope() });
    return new ChainedPreferenceStore(new IPreferenceStore[] { store, jdtStore, PreferenceConstants.getPreferenceStore() });
}
Also used : InstanceScope(org.eclipse.core.runtime.preferences.InstanceScope) ChainedPreferenceStore(org.eclipse.ui.texteditor.ChainedPreferenceStore) IPreferenceStore(org.eclipse.jface.preference.IPreferenceStore) FixedScopedPreferenceStore(org.eclipse.xtext.ui.editor.preferences.FixedScopedPreferenceStore) ConfigurationScope(org.eclipse.core.runtime.preferences.ConfigurationScope)

Aggregations

ConfigurationScope (org.eclipse.core.runtime.preferences.ConfigurationScope)2 InstanceScope (org.eclipse.core.runtime.preferences.InstanceScope)2 IPreferenceStore (org.eclipse.jface.preference.IPreferenceStore)2 ChainedPreferenceStore (org.eclipse.ui.texteditor.ChainedPreferenceStore)2 FixedScopedPreferenceStore (org.eclipse.xtext.ui.editor.preferences.FixedScopedPreferenceStore)2 IProject (org.eclipse.core.resources.IProject)1 ProjectScope (org.eclipse.core.resources.ProjectScope)1