本文整理汇总了Java中org.eclipse.jface.text.quickassist.IQuickAssistProcessor类的典型用法代码示例。如果您正苦于以下问题:Java IQuickAssistProcessor类的具体用法?Java IQuickAssistProcessor怎么用?Java IQuickAssistProcessor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IQuickAssistProcessor类属于org.eclipse.jface.text.quickassist包,在下文中一共展示了IQuickAssistProcessor类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addProposals
import org.eclipse.jface.text.quickassist.IQuickAssistProcessor; //导入依赖的package包/类
private void addProposals(final SubMenuManager quickFixMenu) {
IAnnotationModel sourceModel = sourceViewer.getAnnotationModel();
Iterator annotationIterator = sourceModel.getAnnotationIterator();
while (annotationIterator.hasNext()) {
Annotation annotation = (Annotation) annotationIterator.next();
boolean isDeleted = annotation.isMarkedDeleted();
boolean isIncluded = includes(sourceModel.getPosition(annotation),
getTextWidget().getCaretOffset());
boolean isFixable = sourceViewer.getQuickAssistAssistant().canFix(
annotation);
if (!isDeleted && isIncluded && isFixable) {
IQuickAssistProcessor processor = sourceViewer
.getQuickAssistAssistant()
.getQuickAssistProcessor();
IQuickAssistInvocationContext context = sourceViewer
.getQuickAssistInvocationContext();
ICompletionProposal[] proposals = processor
.computeQuickAssistProposals(context);
for (ICompletionProposal proposal : proposals)
quickFixMenu.add(createQuickFixAction(proposal));
}
}
}
示例2: getQuickAssistAssistant
import org.eclipse.jface.text.quickassist.IQuickAssistProcessor; //导入依赖的package包/类
@Override
public IQuickAssistAssistant getQuickAssistAssistant(ISourceViewer sourceViewer) {
// create a content assistant:
PyCorrectionAssistant assistant = new PyCorrectionAssistant();
// next create a content assistant processor to populate the completions window
IQuickAssistProcessor processor = new PythonCorrectionProcessor(this.getEdit());
// Correction assist works on all
assistant.setQuickAssistProcessor(processor);
assistant.setInformationControlCreator(getInformationControlCreator(sourceViewer));
//delay and auto activate set on PyContentAssistant constructor.
return assistant;
}
示例3: createSourceViewerConfiguration
import org.eclipse.jface.text.quickassist.IQuickAssistProcessor; //导入依赖的package包/类
@Override
public SourceViewerConfiguration createSourceViewerConfiguration() {
PyContentAssistant contentAssist = new PyContentAssistant();
IContentAssistProcessor processor = createConsoleCompletionProcessor(contentAssist);
contentAssist.setContentAssistProcessor(processor, PydevScriptConsoleSourceViewerConfiguration.PARTITION_TYPE);
contentAssist.enableAutoActivation(true);
contentAssist.enableAutoInsert(false);
contentAssist.setAutoActivationDelay(PyCodeCompletionPreferencesPage.getAutocompleteDelay());
PyCorrectionAssistant quickAssist = new PyCorrectionAssistant();
// next create a content assistant processor to populate the completions window
IQuickAssistProcessor quickAssistProcessor = createConsoleQuickAssistProcessor(quickAssist);
// Correction assist works on all
quickAssist.setQuickAssistProcessor(quickAssistProcessor);
SourceViewerConfiguration cfg = new PydevScriptConsoleSourceViewerConfiguration(createHover(), contentAssist,
quickAssist);
return cfg;
}
示例4: BannedElement
import org.eclipse.jface.text.quickassist.IQuickAssistProcessor; //导入依赖的package包/类
/**
* @param length the length of the marker underline. Length == 0 results in a
* marker in the vertical ruler and no underline
*/
BannedElement(String message, String markerId, int iMarkerSeverity, int iMessageSeverity,
DocumentLocation start, int length, IQuickAssistProcessor processor) {
Preconditions.checkNotNull(message, "element name is null");
Preconditions.checkNotNull(markerId, "markerId is null");
Preconditions.checkNotNull(start, "start is null");
Preconditions.checkArgument(length >= 0, "length < 0");
this.message = message;
this.start = start;
this.length = length;
this.markerId = markerId;
this.iMarkerSeverity = iMarkerSeverity;
this.iMessageSeverity = iMessageSeverity;
this.processor = processor;
}
示例5: createMessage
import org.eclipse.jface.text.quickassist.IQuickAssistProcessor; //导入依赖的package包/类
/**
* Creates a message from a given {@link BannedElement}.
*/
void createMessage(IReporter reporter, BannedElement element, int elementOffset) {
IMessage message = new LocalizedMessage(element.getIMessageSeverity(), element.getMessage());
message.setTargetObject(this);
message.setMarkerId(element.getMarkerId());
message.setLineNo(element.getStart().getLineNumber());
message.setOffset(elementOffset);
message.setLength(element.getLength());
message.setAttribute(IQuickAssistProcessor.class.getName(), element.getQuickAssistProcessor());
reporter.addMessage(this, message);
}
示例6: addMessage
import org.eclipse.jface.text.quickassist.IQuickAssistProcessor; //导入依赖的package包/类
@Override
protected void addMessage(IMessage message, WebResourcesFinderType type) {
IReporter reporter = getReporter();
IQuickAssistProcessor processor = getQuickAssistProcessor(type);
if (reporter instanceof IncrementalReporter && processor != null) {
AnnotationInfo info = new AnnotationInfo(message,
AnnotationInfo.NO_PROBLEM_ID, processor);
((IncrementalReporter) reporter).addAnnotationInfo(getValidator(),
info);
} else {
super.addMessage(message, type);
}
}
示例7: getQuickAssistProcessor
import org.eclipse.jface.text.quickassist.IQuickAssistProcessor; //导入依赖的package包/类
private IQuickAssistProcessor getQuickAssistProcessor(
WebResourcesFinderType type) {
switch (type) {
case LINK_HREF:
case SCRIPT_SRC:
return new WebResourceQuickFixProcessor();
default:
return null;
}
}
示例8: getQuickAssistProcessor
import org.eclipse.jface.text.quickassist.IQuickAssistProcessor; //导入依赖的package包/类
IQuickAssistProcessor getQuickAssistProcessor() {
return processor;
}
示例9: createConsoleQuickAssistProcessor
import org.eclipse.jface.text.quickassist.IQuickAssistProcessor; //导入依赖的package包/类
@Override
protected IQuickAssistProcessor createConsoleQuickAssistProcessor(QuickAssistAssistant quickAssist) {
return new PydevConsoleQuickAssistProcessor((PyCorrectionAssistant) quickAssist);
}
示例10: createConsoleQuickAssistProcessor
import org.eclipse.jface.text.quickassist.IQuickAssistProcessor; //导入依赖的package包/类
/**
* @return the assistant that should handle quick assist requests (quick fixes)
*/
protected abstract IQuickAssistProcessor createConsoleQuickAssistProcessor(QuickAssistAssistant quickAssist);