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


Java MarkerAnnotation.isQuickFixableStateSet方法代码示例

本文整理汇总了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;
}
 
开发者ID:cplutte,项目名称:bts,代码行数:26,代码来源:XtextQuickAssistProcessor.java

示例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();
	}
}
 
开发者ID:cplutte,项目名称:bts,代码行数:13,代码来源:XtextMarkerAnnotationImageProvider.java

示例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;
}
 
开发者ID:RepreZen,项目名称:KaiZen-OpenAPI-Editor,代码行数:15,代码来源:JsonQuickAssistProcessor.java

示例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()]);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:30,代码来源:ProblemHover.java


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