/** * Returns the resolutions for the given marker. * * @param marker the marker for which to obtain resolutions * @return the resolutions for the selected marker */ private IMarkerResolution[] getResolutions(IMarker marker) { return IDE.getMarkerHelpRegistry().getResolutions(marker); }
public static List<IMarkerResolution> getResolutions(IMarker marker) { IMarkerResolution[] resolutions = IDE.getMarkerHelpRegistry().getResolutions(marker); List<IMarkerResolution> sortedResolutions = Arrays.asList(resolutions); Collections.sort(sortedResolutions, Comparator.<IMarkerResolution, Integer> comparing(MavenProblemResolution::getOrder) .thenComparing(IMarkerResolution::getLabel)); return sortedResolutions; }
public static boolean hasResolutions(IMarker marker) { return IDE.getMarkerHelpRegistry().hasResolutions(marker); } }
@Override public boolean test(Object receiver, String property, Object[] args, Object expectedValue) { if (property.equals(QUICK_FIX)) return IDE.getMarkerHelpRegistry().hasResolutions( ((MarkerEntry) receiver).getMarker()); return false; }
private void populateDataModelForAnnotation(SimpleMarkerAnnotation annotation) { // grab the local resolutions first IMarker marker = annotation.getMarker(); if (!fResMap.containsKey(marker)) { ArrayList<IMarkerResolution> resolutions = new ArrayList<>(5); IMarkerResolution[] localResolutions = fGenerator.getResolutions(marker); resolutions.addAll(Arrays.asList(localResolutions)); // grab the contributed resolutions IMarkerResolution[] contributedResolutions = IDE.getMarkerHelpRegistry().getResolutions(marker); for (int i = 0; i < contributedResolutions.length; i++) { IMarkerResolution resolution = contributedResolutions[i]; // only add contributed marker resolutions if they don't come from PDE if (!(resolution instanceof AbstractPDEMarkerResolution) && !resolutions.contains(contributedResolutions[i])) resolutions.add(contributedResolutions[i]); } if (!resolutions.isEmpty()) { fResMap.put(marker, resolutions.toArray(new IMarkerResolution[resolutions.size()])); } } }
private static boolean hasCorrections(IMarker marker) { if (marker == null || !marker.exists()) return false; IMarkerHelpRegistry registry= IDE.getMarkerHelpRegistry(); return registry != null && registry.hasResolutions(marker); }
private static boolean hasCorrections(IMarker marker) { if (marker == null || !marker.exists()) return false; IMarkerHelpRegistry registry= IDE.getMarkerHelpRegistry(); return registry != null && registry.hasResolutions(marker); }
private static boolean hasCorrections(IMarker marker) { if (marker == null || !marker.exists()) return false; IMarkerHelpRegistry registry= IDE.getMarkerHelpRegistry(); return registry != null && registry.hasResolutions(marker); }
private static boolean hasCorrections(IMarker marker) { if (marker == null || !marker.exists()) return false; IMarkerHelpRegistry registry= IDE.getMarkerHelpRegistry(); return registry != null && registry.hasResolutions(marker); }
private static void collectMarkerProposals(SimpleMarkerAnnotation annotation, Collection<IJavaCompletionProposal> proposals) { IMarker marker= annotation.getMarker(); IMarkerResolution[] res= IDE.getMarkerHelpRegistry().getResolutions(marker); if (res.length > 0) { for (int i= 0; i < res.length; i++) { proposals.add(new MarkerResolutionProposal(res[i], marker)); } } }
private static void collectMarkerProposals(SimpleMarkerAnnotation annotation, Collection proposals) { IMarker marker= annotation.getMarker(); IMarkerResolution[] res= IDE.getMarkerHelpRegistry().getResolutions(marker); if (res.length > 0) { for (int i= 0; i < res.length; i++) { proposals.add(new MarkerResolutionProposal(res[i], marker)); } } }
private static void collectMarkerProposals(SimpleMarkerAnnotation annotation, Collection<IJavaCompletionProposal> proposals) { IMarker marker= annotation.getMarker(); IMarkerResolution[] res= IDE.getMarkerHelpRegistry().getResolutions(marker); if (res.length > 0) { for (int i= 0; i < res.length; i++) { proposals.add(new MarkerResolutionProposal(res[i], marker)); } } }
private static void collectMarkerProposals(SimpleMarkerAnnotation annotation, Collection proposals) { IMarker marker= annotation.getMarker(); IMarkerResolution[] res= IDE.getMarkerHelpRegistry().getResolutions(marker); if (res.length > 0) { for (int i= 0; i < res.length; i++) { proposals.add(new MarkerResolutionProposal(res[i], marker)); } } }
@Override public IContext getContext(Object target) { String contextId = null; // See if there is a context registered for the current selection IMarker[] markers = view.getSelectedMarkers(); if(markers.length > 0) { contextId = IDE.getMarkerHelpRegistry().getHelp(markers[0]); } //TODO this needs to be migrated to the ide plug-in if (contextId == null) { contextId = PlatformUI.PLUGIN_ID + ".problem_view_context";//$NON-NLS-1$ } return HelpSystem.getContext(contextId); }
/** * Returns whether this action should be enabled given the selection. * * @param selection the selection * @return enablement */ public boolean shouldEnable(IStructuredSelection selection) { if (selection.size() != 1) { return false; } IMarker marker = (IMarker) selection.getFirstElement(); if (marker == null) { return false; } return IDE.getMarkerHelpRegistry().hasResolutions(marker); }
@Override public boolean canFix(Annotation annotation) { boolean bRetVal = false; if (annotation instanceof SimpleMarkerAnnotation) { // check local resolutions first IMarker marker = ((SimpleMarkerAnnotation) annotation).getMarker(); IMarkerResolution[] localResolutions = fGenerator.getResolutions(marker); if (localResolutions.length > 0) { bRetVal = true; } // check the contributed resolutions if needed if (!bRetVal) { IMarkerResolution[] contributedResolutions = IDE.getMarkerHelpRegistry().getResolutions(marker); if (contributedResolutions.length > 0) { bRetVal = true; } } } return bRetVal; }
IMarkerResolution[] resolutions = IDE.getMarkerHelpRegistry().getResolutions(firstSelectedMarker); int progressCount = 80; if (resolutions.length > 1) {
String contextId = IDE.getMarkerHelpRegistry().getHelp(marker); if (contextId != null) { if (image == null) if (IDE.getMarkerHelpRegistry().hasResolutions(marker)) { if (image == MarkerSupportInternalUtilities.getSeverityImage(IMarker.SEVERITY_WARNING)) { image = WorkbenchPlugin.getDefault().getSharedImages().getImage(IDEInternalWorkbenchImages.IMG_OBJS_FIXABLE_WARNING);
.getFirstElement(); if (marker != null) { contextId = IDE.getMarkerHelpRegistry().getHelp(marker);