本文整理汇总了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;
}
示例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);
}
}
示例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);
}