本文整理汇总了Java中org.eclipse.ui.IMarkerHelpRegistry.hasResolutions方法的典型用法代码示例。如果您正苦于以下问题:Java IMarkerHelpRegistry.hasResolutions方法的具体用法?Java IMarkerHelpRegistry.hasResolutions怎么用?Java IMarkerHelpRegistry.hasResolutions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.ui.IMarkerHelpRegistry
的用法示例。
在下文中一共展示了IMarkerHelpRegistry.hasResolutions方法的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);
}