本文整理匯總了Java中org.eclipse.jface.text.contentassist.ContentAssistant.setDocumentPartitioning方法的典型用法代碼示例。如果您正苦於以下問題:Java ContentAssistant.setDocumentPartitioning方法的具體用法?Java ContentAssistant.setDocumentPartitioning怎麽用?Java ContentAssistant.setDocumentPartitioning使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.jface.text.contentassist.ContentAssistant
的用法示例。
在下文中一共展示了ContentAssistant.setDocumentPartitioning方法的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getContentAssistant
import org.eclipse.jface.text.contentassist.ContentAssistant; //導入方法依賴的package包/類
@Override
public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {
ContentAssistant assistant = new ContentAssistant();
IContentAssistProcessor processor = new EiffelContentAssistantProcessor();
assistant.setContentAssistProcessor(processor, IDocument.DEFAULT_CONTENT_TYPE);
assistant.setInformationControlCreator(getInformationControlCreator(sourceViewer));
assistant.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer));
assistant.setContentAssistProcessor(new EiffelContentAssistantProcessor(),
IDocument.DEFAULT_CONTENT_TYPE);
assistant.setAutoActivationDelay(100);
assistant.enableAutoActivation(true);
assistant.enableAutoInsert(true);
assistant.setProposalSelectorBackground(Display.getDefault().getSystemColor(SWT.COLOR_WHITE));
return assistant;
}
示例2: getContentAssistant
import org.eclipse.jface.text.contentassist.ContentAssistant; //導入方法依賴的package包/類
@Override
public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {
ContentAssistant assistant = new ContentAssistant();
assistant.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer));
assistant.setContentAssistProcessor(new FtcCompletionProcessor(sourceViewer), IDocument.DEFAULT_CONTENT_TYPE);
assistant.enableAutoActivation(true);
assistant.setAutoActivationDelay(300);
assistant.setProposalPopupOrientation(IContentAssistant.PROPOSAL_OVERLAY);
assistant.setContextInformationPopupOrientation(IContentAssistant.CONTEXT_INFO_ABOVE);
assistant.setContextInformationPopupBackground(colorManager.getColor(new RGB(150, 150, 0)));
return assistant;
}
示例3: getContentAssistant
import org.eclipse.jface.text.contentassist.ContentAssistant; //導入方法依賴的package包/類
public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {
assistant = new ContentAssistant();
assistant.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer));
assistant.setContentAssistProcessor(new BibCompletionProcessor(this.editor.getDocumentModel()),
BibPartitionScanner.BIB_ENTRY);
assistant.setContentAssistProcessor(new BibCompletionProcessor(this.editor.getDocumentModel()),
IDocument.DEFAULT_CONTENT_TYPE);
assistant.enableAutoActivation(TexlipsePlugin.getDefault().getPreferenceStore().getBoolean(TexlipseProperties.BIB_COMPLETION));
assistant.enableAutoInsert(true);
assistant.setAutoActivationDelay(TexlipsePlugin.getDefault().getPreferenceStore().getInt(TexlipseProperties.BIB_COMPLETION_DELAY));
assistant.setProposalPopupOrientation(IContentAssistant.PROPOSAL_OVERLAY);
assistant.setContextInformationPopupOrientation(IContentAssistant.CONTEXT_INFO_ABOVE);
assistant.setInformationControlCreator(getInformationControlCreator(sourceViewer));
return assistant;
}
示例4: getContentAssistant
import org.eclipse.jface.text.contentassist.ContentAssistant; //導入方法依賴的package包/類
@Override
public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {
ContentAssistant assistant = new ContentAssistant();
assistant.setDocumentPartitioning(this.getConfiguredDocumentPartitioning(sourceViewer));
CompletionProposalToggler toggler = new CompletionProposalToggler();
assistant.setContentAssistProcessor(toggler, IDocument.DEFAULT_CONTENT_TYPE);
assistant.setContentAssistProcessor(toggler, EditorConstants.PARTITION_TYPE_BRAINFUCK_CODE);
assistant.addCompletionListener(toggler);
assistant.setStatusLineVisible(true);
assistant.setRepeatedInvocationMode(true);
assistant.setContextInformationPopupOrientation(IContentAssistant.CONTEXT_INFO_ABOVE);
assistant.setProposalPopupOrientation(IContentAssistant.PROPOSAL_OVERLAY);
assistant.setAutoActivationDelay(500);
assistant.enableAutoActivation(false);
assistant.setInformationControlCreator(new AbstractReusableInformationControlCreator() {
@Override
protected IInformationControl doCreateInformationControl(Shell parent) {
return new DefaultInformationControl(parent);
}
});
assistant.setContentAssistProcessor(null, EditorConstants.PARTITION_TYPE_MULTILINE_COMMENT);
return assistant;
}
示例5: getContentAssistant
import org.eclipse.jface.text.contentassist.ContentAssistant; //導入方法依賴的package包/類
@Override
public IContentAssistant getContentAssistant(@Nullable ISourceViewer sourceViewer) {
ContentAssistant a = assistant;
if (a == null) {
assistant = a = new ContentAssistant();
a.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer));
a.setContentAssistProcessor(new RustContentAssistant(editor), IDocument.DEFAULT_CONTENT_TYPE);
a.setProposalPopupOrientation(IContentAssistant.PROPOSAL_OVERLAY);
a.setContextInformationPopupOrientation(IContentAssistant.CONTEXT_INFO_ABOVE);
// assistant.setContextInformationPopupBackground(...);
a.setInformationControlCreator(getInformationControlCreator(sourceViewer));
a.enableAutoInsert(true);
}
if (RustPrefs.get().autocompleteEnabled()) {
a.enableAutoActivation(true);
a.setAutoActivationDelay((int) (1000*RustPrefs.get().autocompleteDelay()));
} else {
a.enableAutoActivation(false);
}
return a;
}
示例6: getContentAssistant
import org.eclipse.jface.text.contentassist.ContentAssistant; //導入方法依賴的package包/類
@Override
public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {
ContentAssistant assistant = new ContentAssistant();
assistant.setDocumentPartitioning(KspRegionType.PARTITIONING);
assistant.setContentAssistProcessor(new KspDefaultContentAssistProcessor(), KspRegionType.DEFAULT.getContentType());
assistant.setContentAssistProcessor(new KspStringContentAssistProcessor(), KspRegionType.STRING.getContentType());
assistant.setInformationControlCreator(getInformationControlCreator(sourceViewer));
assistant.enableAutoActivation(true);
assistant.enableAutoInsert(true);
return assistant;
}
示例7: getContentAssistant
import org.eclipse.jface.text.contentassist.ContentAssistant; //導入方法依賴的package包/類
@Override
public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {
ContentAssistant assistant = new ContentAssistant();
assistant.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer));
assistant.setContentAssistProcessor(new EiffelContentAssistantProcessor(),
IDocument.DEFAULT_CONTENT_TYPE);
assistant.setAutoActivationDelay(0);
assistant.enableAutoActivation(true);
assistant.setProposalSelectorBackground(Display.getDefault().getSystemColor(SWT.COLOR_WHITE));
return assistant;
}
示例8: getContentAssistant
import org.eclipse.jface.text.contentassist.ContentAssistant; //導入方法依賴的package包/類
public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {
// ContentAssistant assistant = new ContentAssistant();
assistant = new ContentAssistant();
assistant.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer));
// note that partitioning affects completions
//TexCompletionProcessor tcp = new TexCompletionProcessor(this.editor.getDocumentModel());
TexCompletionProcessor tcp = new TexCompletionProcessor(this.editor.getDocumentModel(), sourceViewer);
TexMathCompletionProcessor tmcp = new TexMathCompletionProcessor(this.editor.getDocumentModel(), sourceViewer);
// assistant.setContentAssistProcessor(new TexCompletionProcessor(this.editor.getDocumentModel()),
// IDocument.DEFAULT_CONTENT_TYPE);
assistant.setContentAssistProcessor(tcp, IDocument.DEFAULT_CONTENT_TYPE);
//assistant.setContentAssistProcessor(tcp, TexPartitionScanner.TEX_MATH);
assistant.setContentAssistProcessor(tmcp, FastLaTeXPartitionScanner.TEX_MATH);
assistant.setContentAssistProcessor(tcp, FastLaTeXPartitionScanner.TEX_CURLY_BRACKETS);
assistant.setContentAssistProcessor(tcp, FastLaTeXPartitionScanner.TEX_SQUARE_BRACKETS);
assistant.setContentAssistProcessor(tcp, FastLaTeXPartitionScanner.TEX_TIKZPIC);
assistant.enableAutoActivation(TexlipsePlugin.getDefault().getPreferenceStore().getBoolean(TexlipseProperties.TEX_COMPLETION));
assistant.enableAutoInsert(true);
assistant.setAutoActivationDelay(TexlipsePlugin.getDefault().getPreferenceStore().getInt(TexlipseProperties.TEX_COMPLETION_DELAY));
assistant.setProposalPopupOrientation(IContentAssistant.PROPOSAL_OVERLAY);
assistant.setContextInformationPopupOrientation(IContentAssistant.CONTEXT_INFO_ABOVE);
assistant.setInformationControlCreator(getInformationControlCreator(sourceViewer));
return assistant;
}
示例9: getContentAssistant
import org.eclipse.jface.text.contentassist.ContentAssistant; //導入方法依賴的package包/類
@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;
}
示例10: getContentAssistant
import org.eclipse.jface.text.contentassist.ContentAssistant; //導入方法依賴的package包/類
/**
* Content assistant
*/
public IContentAssistant getContentAssistant(ISourceViewer sourceViewer)
{
ContentAssistant assistant = new ContentAssistant();
assistant.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer));
assistant.setContentAssistProcessor(new TLACompletionProcessor(), IDocument.DEFAULT_CONTENT_TYPE);
assistant.enableAutoActivation(true);
assistant.setAutoActivationDelay(500);
assistant.setProposalPopupOrientation(IContentAssistant.PROPOSAL_OVERLAY);
assistant.setContextInformationPopupOrientation(IContentAssistant.CONTEXT_INFO_ABOVE);
assistant.setContextInformationPopupBackground(TLAEditorActivator.getDefault().getTLAColorProvider().getColor(
TLAColorProvider.CONTENT_ASSIST_BACKGROUNG));
return assistant;
}
示例11: getContentAssistant
import org.eclipse.jface.text.contentassist.ContentAssistant; //導入方法依賴的package包/類
public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {
ContentAssistant assistant = new ContentAssistant();
IContentAssistProcessor nclCompletionProcessor = new NCLCompletionProposal();
assistant
.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer));
// set nclCompletionProposal to XML_START_TAG
assistant.setContentAssistProcessor(nclCompletionProcessor,
XMLPartitionScanner.XML_START_TAG);
assistant.setContentAssistProcessor(nclCompletionProcessor,
XMLPartitionScanner.XML_END_TAG);
// set nclCompletionProposal to DEFAULT_CONTENT
assistant.setContentAssistProcessor(nclCompletionProcessor,
IDocument.DEFAULT_CONTENT_TYPE);
assistant
.setContextInformationPopupOrientation(IContentAssistant.CONTEXT_INFO_ABOVE);
assistant
.setInformationControlCreator(getInformationControlCreator(sourceViewer));
// Enable AutoActivation
assistant.enableAutoActivation(true);
assistant.setAutoActivationDelay(500);
Color bgColor = colorManager.getColor(new RGB(255, 255, 255));
assistant.setProposalSelectorBackground(bgColor);
return assistant;
}
示例12: getContentAssistant
import org.eclipse.jface.text.contentassist.ContentAssistant; //導入方法依賴的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
示例13: 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;
}
示例14: getContentAssistant
import org.eclipse.jface.text.contentassist.ContentAssistant; //導入方法依賴的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;
}