當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。