本文整理匯總了Java中org.eclipse.jface.text.contentassist.ContentAssistant.setContextSelectorForeground方法的典型用法代碼示例。如果您正苦於以下問題:Java ContentAssistant.setContextSelectorForeground方法的具體用法?Java ContentAssistant.setContextSelectorForeground怎麽用?Java ContentAssistant.setContextSelectorForeground使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.jface.text.contentassist.ContentAssistant
的用法示例。
在下文中一共展示了ContentAssistant.setContextSelectorForeground方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: 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);
}
示例2: getContentAssistant
import org.eclipse.jface.text.contentassist.ContentAssistant; //導入方法依賴的package包/類
public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {
IPreferenceStore store= JavaScriptPlugin.getDefault().getPreferenceStore();
JavaScriptTextTools textTools= JavaScriptPlugin.getDefault().getJavaTextTools();
IColorManager manager= textTools.getColorManager();
ContentAssistant assistant= new ContentAssistant();
assistant.setContentAssistProcessor(fProcessor, IDocument.DEFAULT_CONTENT_TYPE);
// Register the same processor for strings and single line comments to get code completion at the start of those partitions.
assistant.setContentAssistProcessor(fProcessor, IJavaScriptPartitions.JAVA_STRING);
assistant.setContentAssistProcessor(fProcessor, IJavaScriptPartitions.JAVA_CHARACTER);
assistant.setContentAssistProcessor(fProcessor, IJavaScriptPartitions.JAVA_SINGLE_LINE_COMMENT);
assistant.setContentAssistProcessor(fProcessor, IJavaScriptPartitions.JAVA_MULTI_LINE_COMMENT);
assistant.setContentAssistProcessor(fProcessor, IJavaScriptPartitions.JAVASCRIPT_TEMPLATE_LITERAL);
assistant.setContentAssistProcessor(fProcessor, IJavaScriptPartitions.JAVA_DOC);
assistant.enableAutoInsert(store.getBoolean(PreferenceConstants.CODEASSIST_AUTOINSERT));
assistant.enableAutoActivation(store.getBoolean(PreferenceConstants.CODEASSIST_AUTOACTIVATION));
assistant.setAutoActivationDelay(store.getInt(PreferenceConstants.CODEASSIST_AUTOACTIVATION_DELAY));
assistant.setProposalPopupOrientation(IContentAssistant.PROPOSAL_OVERLAY);
assistant.setContextInformationPopupOrientation(IContentAssistant.CONTEXT_INFO_ABOVE);
assistant.setInformationControlCreator(new IInformationControlCreator() {
public IInformationControl createInformationControl(Shell parent) {
return new DefaultInformationControl(parent, SWT.NONE, new HTMLTextPresenter(true));
}
});
Color background= getColor(store, PreferenceConstants.CODEASSIST_PROPOSALS_BACKGROUND, manager);
assistant.setContextInformationPopupBackground(background);
assistant.setContextSelectorBackground(background);
assistant.setProposalSelectorBackground(background);
Color foreground= getColor(store, PreferenceConstants.CODEASSIST_PROPOSALS_FOREGROUND, manager);
assistant.setContextInformationPopupForeground(foreground);
assistant.setContextSelectorForeground(foreground);
assistant.setProposalSelectorForeground(foreground);
return assistant;
}
示例3: getContentAssistant
import org.eclipse.jface.text.contentassist.ContentAssistant; //導入方法依賴的package包/類
@Override
public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {
IPreferenceStore store= JavaPlugin.getDefault().getPreferenceStore();
JavaTextTools textTools= JavaPlugin.getDefault().getJavaTextTools();
IColorManager manager= textTools.getColorManager();
ContentAssistant assistant= new ContentAssistant();
assistant.setContentAssistProcessor(fProcessor, IDocument.DEFAULT_CONTENT_TYPE);
// Register the same processor for strings and single line comments to get code completion at the start of those partitions.
assistant.setContentAssistProcessor(fProcessor, IJavaPartitions.JAVA_STRING);
assistant.setContentAssistProcessor(fProcessor, IJavaPartitions.JAVA_CHARACTER);
assistant.setContentAssistProcessor(fProcessor, IJavaPartitions.JAVA_SINGLE_LINE_COMMENT);
assistant.setContentAssistProcessor(fProcessor, IJavaPartitions.JAVA_MULTI_LINE_COMMENT);
assistant.setContentAssistProcessor(fProcessor, IJavaPartitions.JAVA_DOC);
assistant.enableAutoInsert(store.getBoolean(PreferenceConstants.CODEASSIST_AUTOINSERT));
assistant.enableAutoActivation(store.getBoolean(PreferenceConstants.CODEASSIST_AUTOACTIVATION));
assistant.setAutoActivationDelay(store.getInt(PreferenceConstants.CODEASSIST_AUTOACTIVATION_DELAY));
assistant.setProposalPopupOrientation(IContentAssistant.PROPOSAL_OVERLAY);
assistant.setContextInformationPopupOrientation(IContentAssistant.CONTEXT_INFO_ABOVE);
assistant.setInformationControlCreator(new IInformationControlCreator() {
public IInformationControl createInformationControl(Shell parent) {
return new DefaultInformationControl(parent, JavaPlugin.getAdditionalInfoAffordanceString());
}
});
Color background= getColor(store, PreferenceConstants.CODEASSIST_PARAMETERS_BACKGROUND, manager);
assistant.setContextInformationPopupBackground(background);
assistant.setContextSelectorBackground(background);
Color foreground= getColor(store, PreferenceConstants.CODEASSIST_PARAMETERS_FOREGROUND, manager);
assistant.setContextInformationPopupForeground(foreground);
assistant.setContextSelectorForeground(foreground);
return assistant;
}
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:39,代碼來源:CodeTemplateSourceViewerConfiguration.java
示例4: 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);
}