| Summary: | user cannot use their proposals in their quickfixs | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Kelvin <kelvin> |
| Component: | UI | Assignee: | JDT-UI-Inbox <jdt-ui-inbox> |
| Status: | RESOLVED DUPLICATE | QA Contact: | |
| Severity: | major | ||
| Priority: | P3 | CC: | martinae |
| Version: | 2.1 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows 2000 | ||
| Whiteboard: | |||
Martin, any comments I'm confused. So do you have it running? Do you have your own marker (markers created by you), and you contributed a marker resolution generator? If you have this, you get a lightbulb next to your error marker, when you click on it you get all the proposals that your IMarkerResolutionGenerator (generator.getResolutions()) returns. Can you confirm this? The label of the proposals is the one your IMarkerResolutions return, right. The only problem we have is that you can't define an own image (a default image is used) and you can't provide a own hover of the proposal. For this you could file bug report against platform/ui. But this is just a minor problem and should not lead to 'user cannot use their proposals in their quickfixs' as the title of this bug report says. Please elaborate. i can get a list of quickfix proposal, but each quickfix proposal cannot have its hover of the proposal. |
I have a project required that all of my markers should have their own proposals to tell what the quickfix will do. e.g a marker requires a method to be "static", so the proposal should look like ... public <b>static</b> void method() { ... But currencly Eclipse cannot allow user to create our own proposal for our markers. Instead it will display the marker description in the quickfix dialog when you click on the lightblub icon. Code is in org.eclipse.jdt.internal.ui.text.correction.JavaCorrectionProcessor: if (marker.isSubtypeOf(IJavaModelMarker.JAVA_MODEL_PROBLEM_MARKER)) { int problemId= marker.getAttribute(IJavaModelMarker.ID, -1); return problemId != -1 && hasCorrections(problemId); } else { IMarkerHelpRegistry registry = PlatformUI.getWorkbench().getMarkerHelpRegistry(); return registry != null && registry.hasResolutions(marker); } only JAVA_MODEL_PROBLEM_MARKER can have its proposal, other markers will use the default proposal which is displaying the marker description org.eclipse.jdt.internal.ui.text.correction.MarkerResolutionProposal : public String getAdditionalProposalInfo() { try { String problemDesc= (String) fMarker.getAttribute(IMarker.MESSAGE); return CorrectionMessages.getFormattedString ("MarkerResolutionProposal.additionaldesc", problemDesc); //$NON-NLS-1$ } catch (CoreException e) { JavaPlugin.log(e); } return null; } current IMarkerResolution only have a getLabel() method definition. I think it should also have a method to get the proposal and a method to get the image out. Or another way to allow user to use their own proposal in their markers. I did file a feature request (http://bugs.eclipse.org/bugs/show_bug.cgi? id=32175); however, Martin Aeschlimann tell me should file a bug report for this.