org.eclipse.jface.text.reconciler.IReconcilingStrategyExtension Java Examples

The following examples show how to use org.eclipse.jface.text.reconciler.IReconcilingStrategyExtension. 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: SpellingQuickfixTest.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
protected ICompletionProposal[] computeQuickAssistProposals(int offset) {
	XtextSourceViewer sourceViewer = getSourceViewer();
	XtextReconciler reconciler = (XtextReconciler) sourceViewer.getAdapter(IReconciler.class);
	IReconcilingStrategyExtension reconcilingStrategyExtension = (IReconcilingStrategyExtension) reconciler.getReconcilingStrategy("");
	reconcilingStrategyExtension.initialReconcile();
	QuickAssistAssistant quickAssistAssistant = (QuickAssistAssistant) sourceViewer.getQuickAssistAssistant();
	IQuickAssistProcessor quickAssistProcessor = quickAssistAssistant.getQuickAssistProcessor();
	ICompletionProposal[] quickAssistProposals = quickAssistProcessor
			.computeQuickAssistProposals(new TextInvocationContext(sourceViewer, offset, -1));
	return quickAssistProposals;
}
 
Example #2
Source File: XtextReconciler.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
protected void handleInputDocumentChanged(IDocument oldInput, IDocument newInput) {
	if (Display.getCurrent() == null) {
		log.error("Changes to the document must only be applied from the Display thread to keep them ordered",
				new Exception());
	}
	if (shouldInstallCompletionListener) {
		ContentAssistantFacade facade = ((ISourceViewerExtension4) textViewer).getContentAssistantFacade();
		if (facade != null) {
			facade.addCompletionListener(documentListener);
		}
		shouldInstallCompletionListener = false;
	}
	if(oldInput != newInput) {
		if (oldInput instanceof IXtextDocument) {
			((IXtextDocument) oldInput).removeXtextDocumentContentObserver(documentListener);
		}
		if (newInput instanceof IXtextDocument) {
			((IXtextDocument) newInput).addXtextDocumentContentObserver(documentListener);
			final IXtextDocument document = xtextDocumentUtil.getXtextDocument(textViewer);
			strategy.setDocument(document);
			if (!initalProcessDone && strategy instanceof IReconcilingStrategyExtension) {
				initalProcessDone = true;
				IReconcilingStrategyExtension reconcilingStrategyExtension = (IReconcilingStrategyExtension) strategy;
				reconcilingStrategyExtension.initialReconcile();
			}
		}
	}
	if (oldInput != null && newInput != null) {
		handleDocumentChanged(new InputChangedDocumentEvent(oldInput, newInput));
	}
}
 
Example #3
Source File: XtextDocumentReconcileStrategy.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
/**
 * @since 2.3
 */
@Override
public void setProgressMonitor(IProgressMonitor monitor) {
	this.monitor = monitor;
	for (IReconcilingStrategy strategy: strategies) {
		if (strategy instanceof IReconcilingStrategyExtension) {
			((IReconcilingStrategyExtension) strategy).setProgressMonitor(monitor);
		}
	}
}
 
Example #4
Source File: XtextDocumentReconcileStrategy.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
/**
 * @since 2.3
 */
@Override
public void initialReconcile() {
	for (IReconcilingStrategy strategy: strategies) {
		if (strategy instanceof IReconcilingStrategyExtension) {
			((IReconcilingStrategyExtension) strategy).initialReconcile();
		}
	}
}
 
Example #5
Source File: CompositeReconcilingStrategy.java    From xds-ide with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public void setProgressMonitor(IProgressMonitor monitor) {
    if (strategies == null)
        return;

    for (IReconcilingStrategy strategy : strategies) {
        if (strategy instanceof IReconcilingStrategyExtension) {
            IReconcilingStrategyExtension extension = (IReconcilingStrategyExtension)strategy;
            extension.setProgressMonitor(monitor);
        }
    }
}
 
Example #6
Source File: CompositeReconcilingStrategy.java    From xds-ide with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public void initialReconcile() {
    if (strategies == null)
        return;

    for (IReconcilingStrategy strategy : strategies) {
        if (strategy instanceof IReconcilingStrategyExtension) {
            IReconcilingStrategyExtension extension = (IReconcilingStrategyExtension)strategy;
            extension.initialReconcile();
        }
    }
}
 
Example #7
Source File: CompositeReconcilingStrategy.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
public void setProgressMonitor(IProgressMonitor monitor)
{
	for (IReconcilingStrategy strategy : fStrategies)
	{
		if (strategy instanceof IReconcilingStrategyExtension)
		{
			IReconcilingStrategyExtension extension = (IReconcilingStrategyExtension) strategy;
			extension.setProgressMonitor(monitor);
		}
	}
}
 
Example #8
Source File: CompositeReconcilingStrategy.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
public void initialReconcile()
{
	for (IReconcilingStrategy strategy : fStrategies)
	{
		if (strategy instanceof IReconcilingStrategyExtension)
		{
			IReconcilingStrategyExtension extension = (IReconcilingStrategyExtension) strategy;
			extension.initialReconcile();
		}
	}
}
 
Example #9
Source File: CommonReconciler.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void initialProcess()
{
	for (IReconcilingStrategy s : reconcilingStrategies)
	{
		if (s instanceof IReconcilingStrategyExtension)
		{
			((IReconcilingStrategyExtension) s).initialReconcile();
		}
	}
	fInitialProcessDone = true;
}
 
Example #10
Source File: CompositeReconcilingStrategy.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
public void setProgressMonitor(IProgressMonitor monitor) {
	if (fStrategies == null)
		return;

	for (int i=0; i < fStrategies.length; i++) {
		if (fStrategies[i] instanceof IReconcilingStrategyExtension) {
			IReconcilingStrategyExtension extension= (IReconcilingStrategyExtension) fStrategies[i];
			extension.setProgressMonitor(monitor);
		}
	}
}
 
Example #11
Source File: CompositeReconcilingStrategy.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
public void initialReconcile() {
	if (fStrategies == null)
		return;

	for (int i=0; i < fStrategies.length; i++) {
		if (fStrategies[i] instanceof IReconcilingStrategyExtension) {
			IReconcilingStrategyExtension extension= (IReconcilingStrategyExtension) fStrategies[i];
			extension.initialReconcile();
		}
	}
}
 
Example #12
Source File: CompositeReconcilingStrategy.java    From goclipse with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public void setProgressMonitor(IProgressMonitor monitor) {
	if (fStrategies == null)
		return;

	for (int i=0; i < fStrategies.length; i++) {
		if (fStrategies[i] instanceof IReconcilingStrategyExtension) {
			IReconcilingStrategyExtension extension= (IReconcilingStrategyExtension) fStrategies[i];
			extension.setProgressMonitor(monitor);
		}
	}
}
 
Example #13
Source File: CompositeReconcilingStrategy.java    From goclipse with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public void initialReconcile() {
	if (fStrategies == null)
		return;

	for (int i=0; i < fStrategies.length; i++) {
		if (fStrategies[i] instanceof IReconcilingStrategyExtension) {
			IReconcilingStrategyExtension extension= (IReconcilingStrategyExtension) fStrategies[i];
			extension.initialReconcile();
		}
	}
}