当前位置: 首页>>代码示例>>Java>>正文


Java ContentAssistPreference类代码示例

本文整理汇总了Java中org.eclipse.jdt.internal.ui.text.ContentAssistPreference的典型用法代码示例。如果您正苦于以下问题:Java ContentAssistPreference类的具体用法?Java ContentAssistPreference怎么用?Java ContentAssistPreference使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ContentAssistPreference类属于org.eclipse.jdt.internal.ui.text包,在下文中一共展示了ContentAssistPreference类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createJavaContentAssistant

import org.eclipse.jdt.internal.ui.text.ContentAssistPreference; //导入依赖的package包/类
public static SubjectControlContentAssistant createJavaContentAssistant(IContentAssistProcessor processor) {
	final SubjectControlContentAssistant contentAssistant= new SubjectControlContentAssistant();

	contentAssistant.setContentAssistProcessor(processor, IDocument.DEFAULT_CONTENT_TYPE);

	ContentAssistPreference.configure(contentAssistant, JavaPlugin.getDefault().getPreferenceStore());
	contentAssistant.setContextInformationPopupOrientation(IContentAssistant.CONTEXT_INFO_ABOVE);
	contentAssistant.setInformationControlCreator(new IInformationControlCreator() {
		public IInformationControl createInformationControl(Shell parent) {
			return new DefaultInformationControl(parent, JavaPlugin.getAdditionalInfoAffordanceString());
		}
	});

	return contentAssistant;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:16,代码来源:ControlContentAssistHelper.java

示例2: getContentAssistant

import org.eclipse.jdt.internal.ui.text.ContentAssistPreference; //导入依赖的package包/类
@Override
public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {

	if (getEditor() != null) {

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

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

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

		ContentAssistProcessor singleLineProcessor= new JavaCompletionProcessor(getEditor(), assistant, IJavaPartitions.JAVA_SINGLE_LINE_COMMENT);
		assistant.setContentAssistProcessor(singleLineProcessor, IJavaPartitions.JAVA_SINGLE_LINE_COMMENT);

		ContentAssistProcessor stringProcessor= new JavaCompletionProcessor(getEditor(), assistant, IJavaPartitions.JAVA_STRING);
		assistant.setContentAssistProcessor(stringProcessor, IJavaPartitions.JAVA_STRING);

		ContentAssistProcessor multiLineProcessor= new JavaCompletionProcessor(getEditor(), assistant, IJavaPartitions.JAVA_MULTI_LINE_COMMENT);
		assistant.setContentAssistProcessor(multiLineProcessor, IJavaPartitions.JAVA_MULTI_LINE_COMMENT);

		ContentAssistProcessor javadocProcessor= new JavadocCompletionProcessor(getEditor(), assistant);
		assistant.setContentAssistProcessor(javadocProcessor, IJavaPartitions.JAVA_DOC);

		ContentAssistPreference.configure(assistant, fPreferenceStore);

		assistant.setContextInformationPopupOrientation(IContentAssistant.CONTEXT_INFO_ABOVE);
		assistant.setInformationControlCreator(new IInformationControlCreator() {
			public IInformationControl createInformationControl(Shell parent) {
				return new DefaultInformationControl(parent, JavaPlugin.getAdditionalInfoAffordanceString());
			}
		});

		return assistant;
	}

	return null;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:40,代码来源:JavaSourceViewerConfiguration.java

示例3: handlePreferenceStoreChanged

import org.eclipse.jdt.internal.ui.text.ContentAssistPreference; //导入依赖的package包/类
@Override
protected void handlePreferenceStoreChanged(PropertyChangeEvent event) {

	try {

		AdaptedSourceViewer asv= (AdaptedSourceViewer) getSourceViewer();
		if (asv != null) {

			String p= event.getProperty();

			if (CLOSE_BRACKETS.equals(p)) {
				fBracketInserter.setCloseBracketsEnabled(getPreferenceStore().getBoolean(p));
				return;
			}

			if (CLOSE_STRINGS.equals(p)) {
				fBracketInserter.setCloseStringsEnabled(getPreferenceStore().getBoolean(p));
				return;
			}

			if (JavaCore.COMPILER_SOURCE.equals(p)) {
				boolean closeAngularBrackets= JavaCore.VERSION_1_5.compareTo(getPreferenceStore().getString(p)) <= 0;
				fBracketInserter.setCloseAngularBracketsEnabled(closeAngularBrackets);
			}

			if (SPACES_FOR_TABS.equals(p)) {
				if (isTabsToSpacesConversionEnabled())
					installTabsToSpacesConverter();
				else
					uninstallTabsToSpacesConverter();
				return;
			}

			if (PreferenceConstants.EDITOR_SMART_TAB.equals(p)) {
				if (getPreferenceStore().getBoolean(PreferenceConstants.EDITOR_SMART_TAB)) {
					setActionActivationCode("IndentOnTab", '\t', -1, SWT.NONE); //$NON-NLS-1$
				} else {
					removeActionActivationCode("IndentOnTab"); //$NON-NLS-1$
				}
			}

			IContentAssistant c= asv.getContentAssistant();
			if (c instanceof ContentAssistant)
				ContentAssistPreference.changeConfiguration((ContentAssistant) c, getPreferenceStore(), event);

			if (CODE_FORMATTER_TAB_SIZE.equals(p) && isTabsToSpacesConversionEnabled()) {
				uninstallTabsToSpacesConverter();
				installTabsToSpacesConverter();
			}
		}

	} finally {
		super.handlePreferenceStoreChanged(event);
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:56,代码来源:CompilationUnitEditor.java

示例4: getContentAssistant

import org.eclipse.jdt.internal.ui.text.ContentAssistPreference; //导入依赖的package包/类
@Override
public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {
		
ContentAssistant assistant = new ContentAssistant();
    assistant.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer));

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

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

    ContentAssistProcessor singleLineProcessor = new HydrographJavaCompletionProcessor(assistant,
            IJavaPartitions.JAVA_SINGLE_LINE_COMMENT);
    assistant.setContentAssistProcessor(singleLineProcessor, IJavaPartitions.JAVA_SINGLE_LINE_COMMENT);

    ContentAssistProcessor stringProcessor = new HydrographJavaCompletionProcessor(assistant, IJavaPartitions.JAVA_STRING);
    assistant.setContentAssistProcessor(stringProcessor, IJavaPartitions.JAVA_STRING);

    ContentAssistProcessor multiLineProcessor = new HydrographJavaCompletionProcessor(assistant,
            IJavaPartitions.JAVA_MULTI_LINE_COMMENT);
    assistant.setContentAssistProcessor(multiLineProcessor, IJavaPartitions.JAVA_MULTI_LINE_COMMENT);

    ContentAssistProcessor javadocProcessor = new HydrographJavaCompletionProcessor(assistant,
     IJavaPartitions.JAVA_DOC);
     assistant.setContentAssistProcessor(javadocProcessor, IJavaPartitions.JAVA_DOC);

 
    
    ContentAssistPreference.configure(assistant, fPreferenceStore);

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

    return assistant;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:36,代码来源:HydrographJavaSourceViewerConfiguration.java


注:本文中的org.eclipse.jdt.internal.ui.text.ContentAssistPreference类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。