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

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

本文整理了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

/**
 * 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);
}

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

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;
}

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

public static boolean hasResolutions(IMarker marker) {
  return IDE.getMarkerHelpRegistry().hasResolutions(marker);
 }
}

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

@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;
}

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

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()]));
    }
  }
}

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

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

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

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

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

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

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

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

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

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));
    }
  }
}

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

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));
    }
  }
}

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

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));
    }
  }
}

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

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));
    }
  }
}

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

@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);
}

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

/**
 * 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);
}

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

@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;
}

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

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

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

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);

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

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

相关文章