use of org.eclipse.jface.preference.IPreferenceStore in project xtext-xtend by eclipse.
the class AbstractXtendContentAssistBugTest method tearDown.
@Override
public void tearDown() throws Exception {
if (demandCreateProject != null)
deleteProject(demandCreateProject);
IPreferenceStore preferenceStore = preferenceStoreAccess.getWritablePreferenceStore(null);
preferenceStore.setToDefault(XbaseBuilderPreferenceAccess.PREF_USE_COMPILER_SOURCE);
preferenceStore.setToDefault(XbaseBuilderPreferenceAccess.PREF_JAVA_VERSION);
super.tearDown();
}
use of org.eclipse.jface.preference.IPreferenceStore 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() });
}
use of org.eclipse.jface.preference.IPreferenceStore in project xtext-xtend by eclipse.
the class DerivedSourceView method inititalizeColors.
@Override
protected void inititalizeColors() {
IPreferenceStore store = preferenceStoreAccess.getPreferenceStore();
getColorRegistry().addListener(this);
StyledText textWidget = getSourceViewer().getTextWidget();
textWidget.setForeground(getColorFromStore(store, AbstractTextEditor.PREFERENCE_COLOR_FOREGROUND_SYSTEM_DEFAULT, SWT.COLOR_WIDGET_FOREGROUND, AbstractTextEditor.PREFERENCE_COLOR_FOREGROUND));
textWidget.setBackground(getColorFromStore(store, AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND_SYSTEM_DEFAULT, SWT.COLOR_INFO_BACKGROUND, AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND));
lineNumberRulerColumn.setForeground(getColorFromStore(store, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_LINE_NUMBER_RULER_COLOR, SWT.COLOR_WIDGET_FOREGROUND, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_LINE_NUMBER_RULER_COLOR));
lineNumberRulerColumn.setBackground(getColorFromStore(store, AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND_SYSTEM_DEFAULT, SWT.COLOR_WIDGET_BACKGROUND, AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND));
lineNumberRulerColumn.setFont(getFont(getViewerFontName()));
}
use of org.eclipse.jface.preference.IPreferenceStore in project xtext-xtend by eclipse.
the class DerivedSourceView method createSourceViewer.
@Override
protected SourceViewer createSourceViewer(Composite parent) {
IPreferenceStore store = JavaPlugin.getDefault().getCombinedPreferenceStore();
IOverviewRuler overviewRuler = new OverviewRuler(defaultMarkerAnnotationAccess, OVERVIEW_RULER_WIDTH, getSharedTextColors());
AnnotationRulerColumn annotationRulerColumn = new AnnotationRulerColumn(VERTICAL_RULER_WIDTH, defaultMarkerAnnotationAccess);
@SuppressWarnings("unchecked") List<AnnotationPreference> annotationPreferences = markerAnnotationPreferences.getAnnotationPreferences();
for (AnnotationPreference annotationPreference : annotationPreferences) {
String key = annotationPreference.getVerticalRulerPreferenceKey();
boolean showAnnotation = true;
if (key != null && store.contains(key)) {
showAnnotation = store.getBoolean(key);
}
if (showAnnotation) {
annotationRulerColumn.addAnnotationType(annotationPreference.getAnnotationType());
}
}
annotationRulerColumn.addAnnotationType(Annotation.TYPE_UNKNOWN);
lineNumberRulerColumn = new LineNumberRulerColumn();
CompositeRuler compositeRuler = new CompositeRuler();
compositeRuler.addDecorator(0, annotationRulerColumn);
compositeRuler.addDecorator(1, lineNumberRulerColumn);
javaSourceViewer = new JavaSourceViewer(parent, compositeRuler, overviewRuler, true, SWT.V_SCROLL | SWT.H_SCROLL, store);
javaSourceViewerConfiguration = new SimpleJavaSourceViewerConfiguration(JavaPlugin.getDefault().getJavaTextTools().getColorManager(), store, null, IJavaPartitions.JAVA_PARTITIONING, true) {
@Override
public IInformationControlCreator getInformationControlCreator(ISourceViewer sourceViewer) {
return new IInformationControlCreator() {
@Override
public IInformationControl createInformationControl(final Shell parent) {
return new DefaultInformationControl(parent, true);
}
};
}
@Override
public IAnnotationHover getAnnotationHover(ISourceViewer sourceViewer) {
return new DefaultAnnotationHover();
}
};
javaSourceViewer.configure(javaSourceViewerConfiguration);
javaSourceViewer.setEditable(false);
javaSourceViewer.showAnnotations(true);
sourceViewerDecorationSupport = new SourceViewerDecorationSupport(javaSourceViewer, overviewRuler, defaultMarkerAnnotationAccess, getSharedTextColors());
for (AnnotationPreference annotationPreference : annotationPreferences) {
sourceViewerDecorationSupport.setAnnotationPreference(annotationPreference);
}
sourceViewerDecorationSupport.install(preferenceStoreAccess.getPreferenceStore());
return javaSourceViewer;
}
use of org.eclipse.jface.preference.IPreferenceStore in project xtext-xtend by eclipse.
the class XtendSourceViewerConfiguration method getPresentationReconciler.
@Override
public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) {
XtextPresentationReconciler reconciler = (XtextPresentationReconciler) super.getPresentationReconciler(sourceViewer);
IPreferenceStore store = JavaPlugin.getDefault().getCombinedPreferenceStore();
IColorManager colorManager = JavaPlugin.getDefault().getJavaTextTools().getColorManager();
JavaDocScanner javaDocScanner = new JavaDocScanner(colorManager, store, null);
DefaultDamagerRepairer dr = new DefaultDamagerRepairer(javaDocScanner);
reconciler.setRepairer(dr, TokenTypeToPartitionMapper.JAVA_DOC_PARTITION);
reconciler.setDamager(dr, TokenTypeToPartitionMapper.JAVA_DOC_PARTITION);
return reconciler;
}
Aggregations