Java Code Examples for org.eclipse.xtext.ui.editor.preferences.IPreferenceStoreAccess#getWritablePreferenceStore()

The following examples show how to use org.eclipse.xtext.ui.editor.preferences.IPreferenceStoreAccess#getWritablePreferenceStore() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ConfigurableIssueCodesPreferenceStoreInitializer.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public void initialize(IPreferenceStoreAccess preferenceStoreAccess) {
	IPreferenceStore preferenceStore = preferenceStoreAccess.getWritablePreferenceStore();
	for (PreferenceKey prefKey : issueCodesProvider.getConfigurableIssueCodes().values()) {
		preferenceStore.setDefault(prefKey.getId(), prefKey.getDefaultValue());
	}
}
 
Example 2
Source File: BuilderPreferenceAccess.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public void initialize(IPreferenceStoreAccess preferenceStoreAccess) {
	IPreferenceStore store = preferenceStoreAccess.getWritablePreferenceStore();
	initializeBuilderPreferences(store);
	for (OutputConfiguration configuration : outputConfigurationProvider.getOutputConfigurations()) {
		initializeOutputPreferences(store, configuration);
	}
}
 
Example 3
Source File: SARLBuilderPreferenceAccess.java    From sarl with Apache License 2.0 5 votes vote down vote up
@Override
public void initialize(IPreferenceStoreAccess preferenceStoreAccess) {
	final IPreferenceStore store = preferenceStoreAccess.getWritablePreferenceStore();
	store.setDefault(PREF_GENERATED_TEST_SOURCE_FOLDER, SARLConfig.FOLDER_TEST_SOURCE_GENERATED);
	store.setDefault(PREF_GENERATE_INLINE, GeneratorConfig2.DEFAULT_GENERATE_INLINE_ANNOTATION);
	store.setDefault(PREF_USE_EXPRESSION_INTERPRETER, GeneratorConfig2.DEFAULT_USE_EXPRESSION_INTERPRETER_FOR_INLINE_ANNOTATION);
	store.setDefault(PREF_GENERATE_PURE, GeneratorConfig2.DEFAULT_GENERATE_PURE_ANNOTATION);
	store.setDefault(PREF_GENERATE_EQUALITY_TEST_FUNCTIONS, GeneratorConfig2.DEFAULT_GENERATE_EQUALITY_TEST_FUNCTIONS);
	store.setDefault(PREF_GENERATE_TOSTRING_FUNCTIONS, GeneratorConfig2.DEFAULT_GENERATE_TOSTRING_FUNCTION);
	store.setDefault(PREF_GENERATE_CLONE_FUNCTIONS, GeneratorConfig2.DEFAULT_GENERATE_CLONE_FUNCTION);
	store.setDefault(PREF_GENERATE_SERIAL_NUMBER_FIELDS, GeneratorConfig2.DEFAULT_GENERATE_SERIAL_NUMBER_FIELD);
}
 
Example 4
Source File: SARLPreferences.java    From sarl with Apache License 2.0 5 votes vote down vote up
/** Replies the preference store for the given project.
 *
 * @param project the project.
 * @return the preference store or {@code null}.
 */
public static IPreferenceStore getSARLPreferencesFor(IProject project) {
	if (project != null) {
		final Injector injector = LangActivator.getInstance().getInjector(LangActivator.IO_SARL_LANG_SARL);
		final IPreferenceStoreAccess preferenceStoreAccess = injector.getInstance(IPreferenceStoreAccess.class);
		return preferenceStoreAccess.getWritablePreferenceStore(project);
	}
	return null;
}
 
Example 5
Source File: PyPreferenceInitializer.java    From sarl with Apache License 2.0 5 votes vote down vote up
@Override
public void initialize(IPreferenceStoreAccess access) {
	final IPreferenceStore store = access.getWritablePreferenceStore();
	initializeGeneralOptions(store);
	initializeTypeConversion(store);
	initializeFeatureNameConversion(store);
}
 
Example 6
Source File: N4JSBuilderPreferenceAccess.java    From n4js with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public void initialize(IPreferenceStoreAccess preferenceStoreAccess) {
	IPreferenceStore store = preferenceStoreAccess.getWritablePreferenceStore();
	intializeBuilderPreferences(store);
}
 
Example 7
Source File: TaskTagPreferenceInitializer.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public void initialize(IPreferenceStoreAccess access) {
	IPreferenceStore store = access.getWritablePreferenceStore();
	PreferenceTaskTagProvider.KEYS.forEach(preferenceKey -> store.setDefault(preferenceKey.getId(), preferenceKey.getDefaultValue()));
}
 
Example 8
Source File: SARLPreferenceStoreInitializer.java    From sarl with Apache License 2.0 4 votes vote down vote up
private void setupIssueCodesDefaults(IPreferenceStoreAccess preferenceStoreAccess) {
	final IPreferenceStore store = preferenceStoreAccess.getWritablePreferenceStore();
	for (final PreferenceKey prefKey : this.issueCodes.getConfigurableIssueCodes().values()) {
		store.setDefault(prefKey.getId(), prefKey.getDefaultValue());
	}
}