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


Java IMarkerHelpRegistry类代码示例

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


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

示例1: getSuggestions

import org.eclipse.ui.IMarkerHelpRegistry; //导入依赖的package包/类
@Override
public Set<Suggestion> getSuggestions() {
	Set<Suggestion> suggestions = new LinkedHashSet<Suggestion>();
	IMarkerHelpRegistry registry = IDE.getMarkerHelpRegistry();
	IMarker marker = getMarker();
	EPlan plan = ((MarkerPlanAdvisor)getAdvisor()).getPlan();
	if (registry.hasResolutions(marker)) {
		IMarkerResolution[] resolutions = registry.getResolutions(marker);
		for (IMarkerResolution resolution : resolutions) {
			String description = resolution.getLabel() + " for " + getDescription() + " at " + getPrintString(ViolationKey.TIME);
			IUndoableOperation operation = new MarkerResolutionOperation(this, resolution, plan);
			Suggestion suggestion = new Suggestion(null, description, operation);
			suggestions.add(suggestion);
		}
	}
	return suggestions;
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:18,代码来源:MarkerViolation.java

示例2: fixMarkerViolation

import org.eclipse.ui.IMarkerHelpRegistry; //导入依赖的package包/类
private void fixMarkerViolation(IMarkerHelpRegistry registry, final MarkerViolation markerViolation, boolean reportNoFix) {
	IMarker marker = markerViolation.getMarker();
	if (registry.hasResolutions(marker)) {
		IMarkerResolution[] resolutions = registry.getResolutions(marker);
		switch (resolutions.length)  {
		case 0:
			if (reportNoFix) {
				reportNoFix(markerViolation);
			}
			break;
		case 1:
			IMarkerResolution resolution = resolutions[0];
			if (resolution instanceof IPlanMarkerResolution) {
				((IPlanMarkerResolution)resolution).run(marker, plan);
			} else {
				resolution.run(marker);
			}
			break;
		default:
			chooseResolution(marker, resolutions);
		}
	} else if (reportNoFix) {
		reportNoFix(markerViolation);
	}
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:26,代码来源:MarkerPlanAdvisor.java

示例3: hasCorrections

import org.eclipse.ui.IMarkerHelpRegistry; //导入依赖的package包/类
private static boolean hasCorrections(IMarker marker) {
	if (marker == null || !marker.exists())
		return false;

	IMarkerHelpRegistry registry= IDE.getMarkerHelpRegistry();
	return registry != null && registry.hasResolutions(marker);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:8,代码来源:JavaCorrectionProcessor.java


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