Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 32259 - getAdditionalProposalInfo() should return user proposal information, instead of return marker description
Summary: getAdditionalProposalInfo() should return user proposal information, instead ...
Status: RESOLVED DUPLICATE of bug 32262
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.1   Edit
Hardware: All All
: P3 major (vote)
Target Milestone: 3.0   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: api
Depends on:
Blocks:
 
Reported: 2003-02-19 12:22 EST by Kelvin CLA
Modified: 2004-05-07 10:29 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kelvin CLA 2003-02-19 12:22:04 EST
I have a project required that all of my markers should have their own 
additional proposal information
to tell what the quickfix will do.

e.g  a marker requires a method to be "static", so the additional proposal 
information should look like
     ...
     public <b>static</b> void method() {
     ...
But currencly Eclipse cannot allow user to create our own additional proposal 
information 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 additional proposal information, 
other markers will use the default additional proposal information 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 additional proposal information and a 
method to get the image out. Or another way to allow user to use their own 
additional proposal information in their markers.
Comment 1 Nick Edgar CLA 2003-02-28 16:02:58 EST
I am not sure how getAdditionalProposalInfo() is used, so I can't see why the 
current IMarkerResolution API is insufficient.
Moving to JDT Text for comment.
Comment 2 Kai-Uwe Maetzel CLA 2003-03-03 06:39:58 EST
Quickfix uses a structure similar to content assist. When the list with 
proposals is shown, the framework asks the selected proposal for additional 
information to be displayed in a tooltip-like window next to the proposal 
popup. JDT generated Quick fix proposals deliver, e.g., the resulting code 
structure as additional info

The only existing way to contribute custom Quick fix proposals is via marker 
resolutions. Marker resolutions do not provide a description about themselves 
that could be displayed.

Moving back to Platform UI.
Comment 3 Nick Edgar CLA 2003-03-03 11:39:04 EST
This seems like a good addition, however we are feature-frozen for 2.1.
Will consider for 2.2.
Comment 4 Nick Edgar CLA 2004-05-07 10:29:40 EDT

*** This bug has been marked as a duplicate of 32262 ***