Java Code Examples for org.eclipse.jface.text.contentassist.ContentAssistant#enablePrefixCompletion()

The following examples show how to use org.eclipse.jface.text.contentassist.ContentAssistant#enablePrefixCompletion() . 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: JsonSourceViewerConfiguration.java    From KaiZen-OpenAPI-Editor with Eclipse Public License 1.0 6 votes vote down vote up
@Override
public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {
    ContentAssistant ca = new ContentAssistant();
    JsonContentAssistProcessor processor = createContentAssistProcessor(ca);

    ca.setContentAssistProcessor(processor, IDocument.DEFAULT_CONTENT_TYPE);
    ca.setInformationControlCreator(getInformationControlCreator(sourceViewer));

    ca.enableAutoInsert(false);
    ca.enablePrefixCompletion(false);
    ca.enableAutoActivation(true);
    ca.setAutoActivationDelay(100);
    ca.enableColoredLabels(true);
    ca.setShowEmptyList(true);
    ca.setRepeatedInvocationMode(true);
    ca.addCompletionListener(processor);
    ca.setStatusLineVisible(true);

    return ca;
}
 
Example 2
Source File: ImpexSourceViewerConfig.java    From hybris-commerce-eclipse-plugin with Apache License 2.0 5 votes vote down vote up
@Override
public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {
	
	ContentAssistant assistant = new ContentAssistant();
	assistant.enableAutoActivation(true);
	assistant.setAutoActivationDelay(300);
	assistant.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer));
	assistant.setProposalPopupOrientation(IContentAssistant.PROPOSAL_OVERLAY);
	assistant.enableAutoInsert(true);
	assistant.enablePrefixCompletion(true);
	
	IContentAssistProcessor pr = new ImpexInstructionContentAssistProcessor();
	assistant.setContentAssistProcessor(pr, ImpexDocumentPartitioner.IMPEX_INSTRUCTION);
	
	//pr = new ImpexTypeAttributeContentAssistProcessor();
	pr = new ImpexTypeSystemContentAssistProcessor();
	assistant.setContentAssistProcessor(pr, ImpexDocumentPartitioner.IMPEX_HEADER);
	
	pr = new ImpexDataContentAssistProcessor();
	assistant.setContentAssistProcessor(pr, ImpexDocumentPartitioner.IMPEX_DATA);
	
	pr = new ImpexCommentContentAssistProcessor();
	assistant.setContentAssistProcessor(pr, ImpexDocumentPartitioner.IMPEX_COMMENT);
	
	pr = new ImpexCommandContentAssistProcessor();
	assistant.setContentAssistProcessor(pr, IDocument.DEFAULT_CONTENT_TYPE);
	
	assistant.setInformationControlCreator(getInformationControlCreator(sourceViewer));
	return assistant;
}
 
Example 3
Source File: ContentAssistPreference.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 3 votes vote down vote up
/**
 * Configure the given content assistant from the given store.
 *
 * @param assistant the content assistant
 * @param store the preference store
 */
public static void configure(ContentAssistant assistant, IPreferenceStore store) {

	JavaTextTools textTools= JavaPlugin.getDefault().getJavaTextTools();
	IColorManager manager= textTools.getColorManager();


	boolean enabled= store.getBoolean(AUTOACTIVATION);
	assistant.enableAutoActivation(enabled);

	int delay= store.getInt(AUTOACTIVATION_DELAY);
	assistant.setAutoActivationDelay(delay);

	Color c= getColor(store, PARAMETERS_FOREGROUND, manager);
	assistant.setContextInformationPopupForeground(c);
	assistant.setContextSelectorForeground(c);

	c= getColor(store, PARAMETERS_BACKGROUND, manager);
	assistant.setContextInformationPopupBackground(c);
	assistant.setContextSelectorBackground(c);

	enabled= store.getBoolean(AUTOINSERT);
	assistant.enableAutoInsert(enabled);

	enabled= store.getBoolean(PREFIX_COMPLETION);
	assistant.enablePrefixCompletion(enabled);

	enabled= store.getBoolean(USE_COLORED_LABELS);
	assistant.enableColoredLabels(enabled);


	configureJavaProcessor(assistant, store);
	configureJavaDocProcessor(assistant, store);
}