Java源码示例:org.eclipse.ui.IMarkerResolution2

示例1
@Override
public String getAdditionalProposalInfo() {
    if (markerResolution instanceof IMarkerResolution2) {
        return ((IMarkerResolution2) markerResolution).getDescription();
    }
    return null;
}
 
示例2
@Override
public Image getImage() {
    if (markerResolution instanceof IMarkerResolution2) {
        return ((IMarkerResolution2) markerResolution).getImage();
    }
    return null;
}
 
示例3
@Override
public IContextInformation getContextInformation() {
    if (markerResolution instanceof IMarkerResolution2) {
        IMarkerResolution2 mr2 = (IMarkerResolution2) markerResolution;
        String displayString = mr2.getDescription() == null ? mr2.getLabel() : mr2.getDescription();

        return new ContextInformation(mr2.getImage(), mr2.getLabel(), displayString);
    }
    return null;
}
 
示例4
public String getAdditionalProposalInfo() {
	if (fResolution instanceof IMarkerResolution2) {
		return ((IMarkerResolution2) fResolution).getDescription();
	}
	if (fResolution instanceof IJavaCompletionProposal) {
		return ((IJavaCompletionProposal) fResolution).getAdditionalProposalInfo();
	}
	try {
		String problemDesc= (String) fMarker.getAttribute(IMarker.MESSAGE);
		return Messages.format(CorrectionMessages.MarkerResolutionProposal_additionaldesc, problemDesc);
	} catch (CoreException e) {
		JavaPlugin.log(e);
	}
	return null;
}
 
示例5
public Image getImage() {
	if (fResolution instanceof IMarkerResolution2) {
		return ((IMarkerResolution2) fResolution).getImage();
	}
	if (fResolution instanceof IJavaCompletionProposal) {
		return ((IJavaCompletionProposal) fResolution).getImage();
	}
	return JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE);
}