當前位置: 首頁>>代碼示例>>Java>>正文


Java ContentAssistant.enableColoredLabels方法代碼示例

本文整理匯總了Java中org.eclipse.jface.text.contentassist.ContentAssistant.enableColoredLabels方法的典型用法代碼示例。如果您正苦於以下問題:Java ContentAssistant.enableColoredLabels方法的具體用法?Java ContentAssistant.enableColoredLabels怎麽用?Java ContentAssistant.enableColoredLabels使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.jface.text.contentassist.ContentAssistant的用法示例。


在下文中一共展示了ContentAssistant.enableColoredLabels方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getContentAssistant

import org.eclipse.jface.text.contentassist.ContentAssistant; //導入方法依賴的package包/類
public IContentAssistant getContentAssistant(ISourceViewer aSourceViewer)
  {
      ContentAssistant assistant = new ContentAssistant();
      CompletionProcessor completionProcessor = new CompletionProcessor(editor);
      XMLCompletionProcessor xmlProcessor = new XMLCompletionProcessor(editor.getFile());
      assistant.setContentAssistProcessor(completionProcessor, IDocument.DEFAULT_CONTENT_TYPE);
      assistant.setContentAssistProcessor(completionProcessor, PartitionScanner.FOREACH_PARTITION);
      assistant.setContentAssistProcessor(completionProcessor, PartitionScanner.IF_PARTITION);
      assistant.setContentAssistProcessor(completionProcessor, PartitionScanner.MACRO_PARTITION);
      assistant.setContentAssistProcessor(completionProcessor, PartitionScanner.MACRO_INSTANCE_PARTITION);
      assistant.setContentAssistProcessor(completionProcessor, PartitionScanner.INCLUDE_PARTITION);
      assistant.setContentAssistProcessor(completionProcessor, PartitionScanner.PARSE_PARTITION);
      assistant.setContentAssistProcessor(completionProcessor, PartitionScanner.SET_PARTITION);
      assistant.setContentAssistProcessor(completionProcessor, PartitionScanner.STOP_PARTITION);
      assistant.setContentAssistProcessor(completionProcessor, PartitionScanner.VARIABLE_PARTITION);
      assistant.setContentAssistProcessor(xmlProcessor, PartitionScanner.XML_TAG);
      assistant.setContentAssistProcessor(xmlProcessor, PartitionScanner.XML_DEFAULT);
      assistant.enableAutoInsert(true);
      assistant.enableAutoActivation(true);
assistant.setAutoActivationDelay(Plugin.getDefault().getPreferenceStore()
		.getInt(MainPreferences.AUTO_COMPLETE_DEPLAY));

assistant.enableColoredLabels(true);
      return assistant;
  }
 
開發者ID:ninneko,項目名稱:velocity-edit,代碼行數:26,代碼來源:Configuration.java

示例2: getContentAssistant

import org.eclipse.jface.text.contentassist.ContentAssistant; //導入方法依賴的package包/類
@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;
}
 
開發者ID:RepreZen,項目名稱:KaiZen-OpenAPI-Editor,代碼行數:21,代碼來源:JsonSourceViewerConfiguration.java

示例3: configure

import org.eclipse.jface.text.contentassist.ContentAssistant; //導入方法依賴的package包/類
/**
 * Configure the given content assistant from the given store.
 *
 * @param assistant the content assistant
 * @param store the preference store
 */
private void configure(ContentAssistant assistant, IPreferenceStore store) {

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

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

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

	c = getColor(store, PARAMETERS_BACKGROUND, colorManager);
	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);

	configureTemplateProcessor(assistant, store);
}
 
開發者ID:grosenberg,項目名稱:fluentmark,代碼行數:34,代碼來源:FluentMkSourceViewerConfiguration.java

示例4: getContentAssistant

import org.eclipse.jface.text.contentassist.ContentAssistant; //導入方法依賴的package包/類
@Override
	public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {
		if (getEditor() != null) {

			ContentAssistant assistant = new ContentAssistant();
			assistant.enableColoredLabels(true);
			assistant.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer));

			assistant.setRestoreCompletionProposalSize(getSettings("completion_proposal_size")); //$NON-NLS-1$

			IContentAssistProcessor javaProcessor = new TypeScriptCompletionProcessor(getEditor(), assistant,
					IDocument.DEFAULT_CONTENT_TYPE);
			assistant.setContentAssistProcessor(javaProcessor, IDocument.DEFAULT_CONTENT_TYPE);

			ContentAssistProcessor singleLineProcessor = new TypeScriptCompletionProcessor(getEditor(), assistant,
					IJavaScriptPartitions.JAVA_SINGLE_LINE_COMMENT);
			assistant.setContentAssistProcessor(singleLineProcessor, IJavaScriptPartitions.JAVA_SINGLE_LINE_COMMENT);

			ContentAssistProcessor stringProcessor = new TypeScriptCompletionProcessor(getEditor(), assistant,
					IJavaScriptPartitions.JAVA_STRING);
			assistant.setContentAssistProcessor(stringProcessor, IJavaScriptPartitions.JAVA_STRING);
			assistant.setContentAssistProcessor(stringProcessor, IJavaScriptPartitions.JAVA_CHARACTER);

			ContentAssistProcessor multiLineProcessor = new TypeScriptCompletionProcessor(getEditor(), assistant,
					IJavaScriptPartitions.JAVA_MULTI_LINE_COMMENT);
			assistant.setContentAssistProcessor(multiLineProcessor, IJavaScriptPartitions.JAVA_MULTI_LINE_COMMENT);

			ContentAssistProcessor templateLiteralProcessor = new TypeScriptCompletionProcessor(getEditor(), assistant,
					IJavaScriptPartitions.JAVASCRIPT_TEMPLATE_LITERAL);
			assistant.setContentAssistProcessor(templateLiteralProcessor,
					IJavaScriptPartitions.JAVASCRIPT_TEMPLATE_LITERAL);

			ContentAssistProcessor jsxProcessor = new TypeScriptCompletionProcessor(getEditor(), assistant,
					IJSXPartitions.JSX);
			assistant.setContentAssistProcessor(jsxProcessor, IJSXPartitions.JSX);

			ContentAssistProcessor javadocProcessor = new TypeScriptJavadocCompletionProcessor(getEditor(), assistant);
			assistant.setContentAssistProcessor(javadocProcessor, IJavaScriptPartitions.JAVA_DOC);

			ContentAssistPreference.configure(assistant, fPreferenceStore);

			assistant.setContextInformationPopupOrientation(IContentAssistant.CONTEXT_INFO_ABOVE);
			assistant.setInformationControlCreator(getInformationControlCreator(sourceViewer));

//			assistant.setContextInformationPopupOrientation(ContentAssistant.CONTEXT_INFO_BELOW);
//			assistant.setProposalPopupOrientation(ContentAssistant.PROPOSAL_REMOVE);
//			assistant.setAutoActivationDelay(0);
//			assistant.enableColoredLabels(true);
//			assistant.enableAutoActivation(true);
			
			return assistant;
		}
		return null;
	}
 
開發者ID:angelozerr,項目名稱:typescript.java,代碼行數:55,代碼來源:TypeScriptSourceViewerConfiguration.java

示例5: setColoredLabels

import org.eclipse.jface.text.contentassist.ContentAssistant; //導入方法依賴的package包/類
protected void setColoredLabels(ContentAssistant assistant) {
	assistant.enableColoredLabels(enableStyledLabels);
}
 
開發者ID:cplutte,項目名稱:bts,代碼行數:4,代碼來源:DefaultContentAssistantFactory.java

示例6: configure

import org.eclipse.jface.text.contentassist.ContentAssistant; //導入方法依賴的package包/類
/**
 * 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);
}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:40,代碼來源:ContentAssistPreference.java


注:本文中的org.eclipse.jface.text.contentassist.ContentAssistant.enableColoredLabels方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。