本文整理汇总了Java中org.eclipse.ui.texteditor.MarkerAnnotation.isQuickFixableStateSet方法的典型用法代码示例。如果您正苦于以下问题:Java MarkerAnnotation.isQuickFixableStateSet方法的具体用法?Java MarkerAnnotation.isQuickFixableStateSet怎么用?Java MarkerAnnotation.isQuickFixableStateSet使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.ui.texteditor.MarkerAnnotation
的用法示例。
在下文中一共展示了MarkerAnnotation.isQuickFixableStateSet方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: canFix
import org.eclipse.ui.texteditor.MarkerAnnotation; //导入方法依赖的package包/类
public boolean canFix(Annotation annotation) {
if (annotation.isMarkedDeleted())
return false;
// non-persisted annotation
if (annotation instanceof XtextAnnotation) {
XtextAnnotation a = (XtextAnnotation) annotation;
return getResolutionProvider().hasResolutionFor(a.getIssueCode());
}
// persisted markerAnnotation
if (annotation instanceof MarkerAnnotation) {
MarkerAnnotation markerAnnotation = (MarkerAnnotation) annotation;
if (!markerAnnotation.isQuickFixableStateSet())
markerAnnotation.setQuickFixable(getResolutionProvider().hasResolutionFor(
issueUtil.getCode(markerAnnotation)));
return markerAnnotation.isQuickFixable();
}
if (annotation instanceof SpellingAnnotation) {
return true;
}
return false;
}
示例2: getImages
import org.eclipse.ui.texteditor.MarkerAnnotation; //导入方法依赖的package包/类
private Map<String, Image> getImages(Annotation annotation) {
if(annotation.isMarkedDeleted())
return XtextPluginImages.getAnnotationImagesDeleted();
else {
if (annotation instanceof MarkerAnnotation) {
MarkerAnnotation ma = (MarkerAnnotation) annotation;
if(ma.isQuickFixableStateSet() && ma.isQuickFixable())
return XtextPluginImages.getAnnotationImagesFixable();
}
return XtextPluginImages.getAnnotationImagesNonfixable();
}
}
示例3: canFix
import org.eclipse.ui.texteditor.MarkerAnnotation; //导入方法依赖的package包/类
@Override
public boolean canFix(Annotation annotation) {
if (annotation.isMarkedDeleted()) {
return false;
}
if (annotation instanceof MarkerAnnotation) {
MarkerAnnotation markerAnnotation = (MarkerAnnotation) annotation;
if (!markerAnnotation.isQuickFixableStateSet()) {
markerAnnotation.setQuickFixable(quickFixer.hasResolutions(markerAnnotation.getMarker()));
}
return markerAnnotation.isQuickFixable();
}
return false;
}
示例4: getMarkerAnnotationFixes
import org.eclipse.ui.texteditor.MarkerAnnotation; //导入方法依赖的package包/类
private ICompletionProposal[] getMarkerAnnotationFixes(MarkerAnnotation markerAnnotation) {
if (markerAnnotation.isQuickFixableStateSet() && !markerAnnotation.isQuickFixable())
return NO_PROPOSALS;
IMarker marker= markerAnnotation.getMarker();
ICompilationUnit cu= getCompilationUnit(marker);
if (cu == null)
return NO_PROPOSALS;
IEditorInput input= EditorUtility.getEditorInput(cu);
if (input == null)
return NO_PROPOSALS;
IAnnotationModel model= JavaUI.getDocumentProvider().getAnnotationModel(input);
if (model == null)
return NO_PROPOSALS;
ISourceViewer sourceViewer= null;
if (viewer instanceof ISourceViewer)
sourceViewer= (ISourceViewer) viewer;
AssistContext context= new AssistContext(cu, sourceViewer, position.getOffset(), position.getLength());
ArrayList<IJavaCompletionProposal> proposals= new ArrayList<IJavaCompletionProposal>();
JavaCorrectionProcessor.collectProposals(context, model, new Annotation[] { markerAnnotation }, true, false, proposals);
return proposals.toArray(new ICompletionProposal[proposals.size()]);
}