本文整理匯總了Java中org.eclipse.ui.IMarkerHelpRegistry類的典型用法代碼示例。如果您正苦於以下問題:Java IMarkerHelpRegistry類的具體用法?Java IMarkerHelpRegistry怎麽用?Java IMarkerHelpRegistry使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
IMarkerHelpRegistry類屬於org.eclipse.ui包,在下文中一共展示了IMarkerHelpRegistry類的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);
}