org.eclipse.ui.ide.IDE.getMarkerHelpRegistry()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(7.4k)|赞(0)|评价(0)|浏览(377)

本文整理了Java中org.eclipse.ui.ide.IDE.getMarkerHelpRegistry()方法的一些代码示例,展示了IDE.getMarkerHelpRegistry()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。IDE.getMarkerHelpRegistry()方法的具体详情如下:
包路径:org.eclipse.ui.ide.IDE
类名称:IDE
方法名:getMarkerHelpRegistry

IDE.getMarkerHelpRegistry介绍

[英]Returns the marker help registry for the workbench.
[中]返回工作台的标记帮助注册表。

代码示例

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.ide

  1. /**
  2. * Returns the resolutions for the given marker.
  3. *
  4. * @param marker the marker for which to obtain resolutions
  5. * @return the resolutions for the selected marker
  6. */
  7. private IMarkerResolution[] getResolutions(IMarker marker) {
  8. return IDE.getMarkerHelpRegistry().getResolutions(marker);
  9. }

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.m2e.core.ui

  1. public static List<IMarkerResolution> getResolutions(IMarker marker) {
  2. IMarkerResolution[] resolutions = IDE.getMarkerHelpRegistry().getResolutions(marker);
  3. List<IMarkerResolution> sortedResolutions = Arrays.asList(resolutions);
  4. Collections.sort(sortedResolutions,
  5. Comparator.<IMarkerResolution, Integer> comparing(MavenProblemResolution::getOrder)
  6. .thenComparing(IMarkerResolution::getLabel));
  7. return sortedResolutions;
  8. }

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.m2e.core.ui

  1. public static boolean hasResolutions(IMarker marker) {
  2. return IDE.getMarkerHelpRegistry().hasResolutions(marker);
  3. }
  4. }

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.ide

  1. @Override
  2. public boolean test(Object receiver, String property, Object[] args,
  3. Object expectedValue) {
  4. if (property.equals(QUICK_FIX))
  5. return IDE.getMarkerHelpRegistry().hasResolutions(
  6. ((MarkerEntry) receiver).getMarker());
  7. return false;
  8. }

代码示例来源:origin: org.eclipse.pde/org.eclipse.pde.ui

  1. private void populateDataModelForAnnotation(SimpleMarkerAnnotation annotation) {
  2. // grab the local resolutions first
  3. IMarker marker = annotation.getMarker();
  4. if (!fResMap.containsKey(marker)) {
  5. ArrayList<IMarkerResolution> resolutions = new ArrayList<>(5);
  6. IMarkerResolution[] localResolutions = fGenerator.getResolutions(marker);
  7. resolutions.addAll(Arrays.asList(localResolutions));
  8. // grab the contributed resolutions
  9. IMarkerResolution[] contributedResolutions = IDE.getMarkerHelpRegistry().getResolutions(marker);
  10. for (int i = 0; i < contributedResolutions.length; i++) {
  11. IMarkerResolution resolution = contributedResolutions[i];
  12. // only add contributed marker resolutions if they don't come from PDE
  13. if (!(resolution instanceof AbstractPDEMarkerResolution) && !resolutions.contains(contributedResolutions[i]))
  14. resolutions.add(contributedResolutions[i]);
  15. }
  16. if (!resolutions.isEmpty()) {
  17. fResMap.put(marker, resolutions.toArray(new IMarkerResolution[resolutions.size()]));
  18. }
  19. }
  20. }

代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui

  1. private static boolean hasCorrections(IMarker marker) {
  2. if (marker == null || !marker.exists())
  3. return false;
  4. IMarkerHelpRegistry registry= IDE.getMarkerHelpRegistry();
  5. return registry != null && registry.hasResolutions(marker);
  6. }

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui

  1. private static boolean hasCorrections(IMarker marker) {
  2. if (marker == null || !marker.exists())
  3. return false;
  4. IMarkerHelpRegistry registry= IDE.getMarkerHelpRegistry();
  5. return registry != null && registry.hasResolutions(marker);
  6. }

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

  1. private static boolean hasCorrections(IMarker marker) {
  2. if (marker == null || !marker.exists())
  3. return false;
  4. IMarkerHelpRegistry registry= IDE.getMarkerHelpRegistry();
  5. return registry != null && registry.hasResolutions(marker);
  6. }

代码示例来源:origin: org.eclipse/org.eclipse.ajdt.ui

  1. private static boolean hasCorrections(IMarker marker) {
  2. if (marker == null || !marker.exists())
  3. return false;
  4. IMarkerHelpRegistry registry= IDE.getMarkerHelpRegistry();
  5. return registry != null && registry.hasResolutions(marker);
  6. }

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

  1. private static void collectMarkerProposals(SimpleMarkerAnnotation annotation, Collection<IJavaCompletionProposal> proposals) {
  2. IMarker marker= annotation.getMarker();
  3. IMarkerResolution[] res= IDE.getMarkerHelpRegistry().getResolutions(marker);
  4. if (res.length > 0) {
  5. for (int i= 0; i < res.length; i++) {
  6. proposals.add(new MarkerResolutionProposal(res[i], marker));
  7. }
  8. }
  9. }

代码示例来源:origin: org.eclipse/org.eclipse.ajdt.ui

  1. private static void collectMarkerProposals(SimpleMarkerAnnotation annotation, Collection proposals) {
  2. IMarker marker= annotation.getMarker();
  3. IMarkerResolution[] res= IDE.getMarkerHelpRegistry().getResolutions(marker);
  4. if (res.length > 0) {
  5. for (int i= 0; i < res.length; i++) {
  6. proposals.add(new MarkerResolutionProposal(res[i], marker));
  7. }
  8. }
  9. }

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui

  1. private static void collectMarkerProposals(SimpleMarkerAnnotation annotation, Collection<IJavaCompletionProposal> proposals) {
  2. IMarker marker= annotation.getMarker();
  3. IMarkerResolution[] res= IDE.getMarkerHelpRegistry().getResolutions(marker);
  4. if (res.length > 0) {
  5. for (int i= 0; i < res.length; i++) {
  6. proposals.add(new MarkerResolutionProposal(res[i], marker));
  7. }
  8. }
  9. }

代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui

  1. private static void collectMarkerProposals(SimpleMarkerAnnotation annotation, Collection proposals) {
  2. IMarker marker= annotation.getMarker();
  3. IMarkerResolution[] res= IDE.getMarkerHelpRegistry().getResolutions(marker);
  4. if (res.length > 0) {
  5. for (int i= 0; i < res.length; i++) {
  6. proposals.add(new MarkerResolutionProposal(res[i], marker));
  7. }
  8. }
  9. }

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.ide

  1. @Override
  2. public IContext getContext(Object target) {
  3. String contextId = null;
  4. // See if there is a context registered for the current selection
  5. IMarker[] markers = view.getSelectedMarkers();
  6. if(markers.length > 0) {
  7. contextId = IDE.getMarkerHelpRegistry().getHelp(markers[0]);
  8. }
  9. //TODO this needs to be migrated to the ide plug-in
  10. if (contextId == null) {
  11. contextId = PlatformUI.PLUGIN_ID + ".problem_view_context";//$NON-NLS-1$
  12. }
  13. return HelpSystem.getContext(contextId);
  14. }

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.ide

  1. /**
  2. * Returns whether this action should be enabled given the selection.
  3. *
  4. * @param selection the selection
  5. * @return enablement
  6. */
  7. public boolean shouldEnable(IStructuredSelection selection) {
  8. if (selection.size() != 1) {
  9. return false;
  10. }
  11. IMarker marker = (IMarker) selection.getFirstElement();
  12. if (marker == null) {
  13. return false;
  14. }
  15. return IDE.getMarkerHelpRegistry().hasResolutions(marker);
  16. }

代码示例来源:origin: org.eclipse.pde/org.eclipse.pde.ui

  1. @Override
  2. public boolean canFix(Annotation annotation) {
  3. boolean bRetVal = false;
  4. if (annotation instanceof SimpleMarkerAnnotation) {
  5. // check local resolutions first
  6. IMarker marker = ((SimpleMarkerAnnotation) annotation).getMarker();
  7. IMarkerResolution[] localResolutions = fGenerator.getResolutions(marker);
  8. if (localResolutions.length > 0) {
  9. bRetVal = true;
  10. }
  11. // check the contributed resolutions if needed
  12. if (!bRetVal) {
  13. IMarkerResolution[] contributedResolutions = IDE.getMarkerHelpRegistry().getResolutions(marker);
  14. if (contributedResolutions.length > 0) {
  15. bRetVal = true;
  16. }
  17. }
  18. }
  19. return bRetVal;
  20. }

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.ide

  1. IMarkerResolution[] resolutions = IDE.getMarkerHelpRegistry().getResolutions(firstSelectedMarker);
  2. int progressCount = 80;
  3. if (resolutions.length > 1) {

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.ide

  1. String contextId = IDE.getMarkerHelpRegistry().getHelp(marker);
  2. if (contextId != null) {
  3. if (image == null)
  4. if (IDE.getMarkerHelpRegistry().hasResolutions(marker)) {
  5. if (image == MarkerSupportInternalUtilities.getSeverityImage(IMarker.SEVERITY_WARNING)) {
  6. image = WorkbenchPlugin.getDefault().getSharedImages().getImage(IDEInternalWorkbenchImages.IMG_OBJS_FIXABLE_WARNING);

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.ide

  1. .getFirstElement();
  2. if (marker != null) {
  3. contextId = IDE.getMarkerHelpRegistry().getHelp(marker);

相关文章