org.eclipse.jface.text.quickassist.QuickAssistAssistant Java Examples

The following examples show how to use org.eclipse.jface.text.quickassist.QuickAssistAssistant. 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: AbstractMultiQuickfixTest.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
protected ICompletionProposal[] computeQuickAssistProposals(XtextEditor editor, int offset) {
	IResourcesSetupUtil.waitForBuild();
	XtextSourceViewer sourceViewer = (XtextSourceViewer) editor.getInternalSourceViewer();
	QuickAssistAssistant quickAssistAssistant = (QuickAssistAssistant) sourceViewer.getQuickAssistAssistant();
	IQuickAssistProcessor quickAssistProcessor = quickAssistAssistant.getQuickAssistProcessor();
	ICompletionProposal[] quickAssistProposals = quickAssistProcessor
			.computeQuickAssistProposals(new TextInvocationContext(sourceViewer, offset, -1));
	return quickAssistProposals;
}
 
Example #3
Source File: JsonSourceViewerConfiguration.java    From KaiZen-OpenAPI-Editor with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public IQuickAssistAssistant getQuickAssistAssistant(ISourceViewer sourceViewer) {
    QuickAssistAssistant assistant = new QuickAssistAssistant();
    assistant.setQuickAssistProcessor(new JsonQuickAssistProcessor());
    assistant.setInformationControlCreator(getInformationControlCreator(sourceViewer));
    return assistant;
}
 
Example #4
Source File: PyCorrectionAssistant.java    From Pydev with Eclipse Public License 1.0 5 votes vote down vote up
public PyCorrectionAssistant() {
    if (PlatformUtils.isLinuxPlatform()) {
        // Workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=508245 (hack can be removed when that's fixed).
        try {
            Field field = QuickAssistAssistant.class.getDeclaredField("fQuickAssistAssistantImpl");
            field.setAccessible(true);
            ContentAssistant assistant = (ContentAssistant) field.get(this);
            ContentAssistHackingAroundBugs.fixAssistBugs(assistant);
        } catch (Throwable e) {
            // Just ignore if this hack fails.
        }
    }
}
 
Example #5
Source File: PydevConsole.java    From Pydev with Eclipse Public License 1.0 4 votes vote down vote up
@Override
protected IQuickAssistProcessor createConsoleQuickAssistProcessor(QuickAssistAssistant quickAssist) {
    return new PydevConsoleQuickAssistProcessor((PyCorrectionAssistant) quickAssist);
}
 
Example #6
Source File: ScriptConsole.java    From Pydev with Eclipse Public License 1.0 2 votes vote down vote up
/**
 * @return the assistant that should handle quick assist requests (quick fixes)
 */
protected abstract IQuickAssistProcessor createConsoleQuickAssistProcessor(QuickAssistAssistant quickAssist);