Java 类org.eclipse.ui.IMarkerHelpRegistry 实例源码

项目:OpenSPIFe    文件:MarkerViolation.java   
@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;
}
项目:OpenSPIFe    文件:MarkerPlanAdvisor.java   
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);
    }
}
项目:Eclipse-Postfix-Code-Completion    文件:JavaCorrectionProcessor.java   
private static boolean hasCorrections(IMarker marker) {
    if (marker == null || !marker.exists())
        return false;

    IMarkerHelpRegistry registry= IDE.getMarkerHelpRegistry();
    return registry != null && registry.hasResolutions(marker);
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:JavaCorrectionProcessor.java   
private static boolean hasCorrections(IMarker marker) {
    if (marker == null || !marker.exists())
        return false;

    IMarkerHelpRegistry registry= IDE.getMarkerHelpRegistry();
    return registry != null && registry.hasResolutions(marker);
}