org.eclipse.xtext.tasks.PreferenceTaskTagProvider Java Examples
The following examples show how to use
org.eclipse.xtext.tasks.PreferenceTaskTagProvider.
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: XtendTaskTagProvider.java From xtext-xtend with Eclipse Public License 2.0 | 6 votes |
@Override public TaskTags getTaskTags(final Resource resource) { TaskTags _xblockexpression = null; { final IPreferenceValues prefs = this.preferenceValuesProvider.getPreferenceValues(resource); PreferenceKey _preferenceKey = new PreferenceKey(JavaCore.COMPILER_TASK_TAGS, "TODO,FIXME,XXX"); final String namePref = prefs.getPreference(_preferenceKey); PreferenceKey _preferenceKey_1 = new PreferenceKey(JavaCore.COMPILER_TASK_PRIORITIES, "NORMAL,HIGH,NORMAL"); final String prioritiesPref = prefs.getPreference(_preferenceKey_1); PreferenceKey _preferenceKey_2 = new PreferenceKey(JavaCore.COMPILER_TASK_CASE_SENSITIVE, JavaCore.ENABLED); final String caseSensitivePref = prefs.getPreference(_preferenceKey_2); final List<TaskTag> tags = PreferenceTaskTagProvider.parseTags(namePref, prioritiesPref); TaskTags _taskTags = new TaskTags(); final Procedure1<TaskTags> _function = (TaskTags it) -> { List<TaskTag> _taskTags_1 = it.getTaskTags(); Iterables.<TaskTag>addAll(_taskTags_1, tags); it.setCaseSensitive(caseSensitivePref.equals(JavaCore.ENABLED)); }; _xblockexpression = ObjectExtensions.<TaskTags>operator_doubleArrow(_taskTags, _function); } return _xblockexpression; }
Example #2
Source File: SarlTaskTagProvider.java From sarl with Apache License 2.0 | 6 votes |
@Override public TaskTags getTaskTags(Resource resource) { final IPreferenceValues prefs = this.preferenceValuesProvider.getPreferenceValues(resource); final String namePref = prefs.getPreference(new PreferenceKey( JavaCore.COMPILER_TASK_TAGS, "TODO,FIXME,XXX")); //$NON-NLS-1$ final String prioritiesPref = prefs.getPreference(new PreferenceKey( JavaCore.COMPILER_TASK_PRIORITIES, "NORMAL,HIGH,NORMAL")); //$NON-NLS-1$ final String caseSensitivePref = prefs.getPreference(new PreferenceKey( JavaCore.COMPILER_TASK_CASE_SENSITIVE, JavaCore.ENABLED)); final List<TaskTag> tags = PreferenceTaskTagProvider.parseTags(namePref, prioritiesPref); final TaskTags taskTags = new TaskTags(); taskTags.setCaseSensitive(caseSensitivePref.equals(JavaCore.ENABLED)); taskTags.getTaskTags().addAll(tags); return taskTags; }
Example #3
Source File: TaskTagPreferenceInitializer.java From xtext-eclipse with Eclipse Public License 2.0 | 4 votes |
@Override public void initialize(IPreferenceStoreAccess access) { IPreferenceStore store = access.getWritablePreferenceStore(); PreferenceTaskTagProvider.KEYS.forEach(preferenceKey -> store.setDefault(preferenceKey.getId(), preferenceKey.getDefaultValue())); }