org.eclipse.xtext.ui.editor.XtextPresentationReconciler Java Examples

The following examples show how to use org.eclipse.xtext.ui.editor.XtextPresentationReconciler. 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: TesterUiModule.java    From n4js with Eclipse Public License 1.0 6 votes vote down vote up
@Override
public void configure(Binder binder) {
	// define all bindings to N4JS-UI here (ui packages)
	binder.bind(XtextPresentationReconciler.class)
			.toProvider(() -> n4jsInjector.getInstance(XtextPresentationReconciler.class));
	binder.bind(EditorContentExtractor.class)
			.toProvider(() -> n4jsInjector.getInstance(EditorContentExtractor.class));
	binder.bind(IN4JSEclipseCore.class)
			.toProvider(() -> n4jsInjector.getInstance(IN4JSEclipseCore.class));
	binder.bind(IURIEditorOpener.class)
			.toProvider(() -> n4jsInjector.getInstance(IURIEditorOpener.class));
	binder.bind(RunnerFrontEndUI.class)
			.toProvider(() -> n4jsInjector.getInstance(RunnerFrontEndUI.class));

	binder.bind(TestResultsView.class);
	binder.bind(TestConfigurationConverter.class);
}
 
Example #2
Source File: XtextStyledTextHighlightingHelper.java    From statecharts with Eclipse Public License 1.0 6 votes vote down vote up
public void install(StyledTextXtextAdapter styledTextXtextAdapter,
		XtextSourceViewer sourceViewer) {
	this.styledTextXtextAdapter = styledTextXtextAdapter;
	fSourceViewer = sourceViewer;
	if (styledTextXtextAdapter != null) {
		fConfiguration = styledTextXtextAdapter
				.getXtextSourceViewerConfiguration();
		fPresentationReconciler = (XtextPresentationReconciler) fConfiguration
				.getPresentationReconciler(sourceViewer);
	} else {
		fConfiguration = null;
		fPresentationReconciler = null;
	}
	preferenceStore = getPreferenceStoreAccessor().getPreferenceStore();
	preferenceStore.addPropertyChangeListener(this);
	enable();
}
 
Example #3
Source File: HighlightingHelper.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
/**
 * @since 2.3
 */
public void install(XtextSourceViewerConfiguration configuration, XtextSourceViewer sourceViewer) {
	fSourceViewer= sourceViewer;
	fConfiguration= configuration;
	if(sourceViewer != null && configuration != null){
		fPresentationReconciler= (XtextPresentationReconciler) fConfiguration.getPresentationReconciler(sourceViewer);
	} else {
		fPresentationReconciler = null;
		fConfiguration = null;
	}
	preferenceStore = getPreferenceStoreAccessor().getPreferenceStore();
	preferenceStore.addPropertyChangeListener(this);
	enable();
}
 
Example #4
Source File: XtendSourceViewerConfiguration.java    From xtext-xtend with Eclipse Public License 2.0 5 votes vote down vote up
@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;
}
 
Example #5
Source File: HighlightingPresenter.java    From xtext-eclipse with Eclipse Public License 2.0 3 votes vote down vote up
/**
 * Install this presenter on the given source viewer and background presentation reconciler.
 * 
 * @param sourceViewer
 *            the source viewer
 * @param backgroundPresentationReconciler
 *            the background presentation reconciler, can be <code>null</code>, in that case
 *            {@link HighlightingPresenter#createPresentation(List, List)} should not be called
 */
public void install(XtextSourceViewer sourceViewer, XtextPresentationReconciler backgroundPresentationReconciler) {
	fSourceViewer = sourceViewer;
	fPresentationReconciler = backgroundPresentationReconciler;

	fSourceViewer.prependTextPresentationListener(this);
	fSourceViewer.addTextInputListener(this);
	manageDocument(fSourceViewer.getDocument());
}