Community
Participate
Working Groups
We need some API to update the resolutions when multiple ones are selected.
CCing Martin and Benno. See also bug 114570.
As we now have org.eclipse.ui.IMarkerResolution and org.eclipse.ui.IMarkerResolution2 I am proposing adding an abstract superclass WorkbenchMarkerResolution that implements IMarkerResolution2 and adds methods to handle 1) Identifying that markers resolutions are equal. I can do this by making it implement Comparable. Right now I have to use the strings to identify two equal resolutions. 2) Refreshing resolutions. It needs a method #getUpdatesResoution(WorkbenchMarkerResolution) that can take the previous one selected by the user (the argument) and get a new one in return (right now I have to compare by strings). By default this will return null which will cancel the resolution. I will only enable multi select on resolution sets that are all WorkbenchMarkerResolutions.
Additional things we have to keep in mind: - some quick fixes put the editor in linked mode. Don't know what happens here when we have a modal dialog in front - some quick fixes pop up a modal dialog. May be we should restrict the quick fixes which can be applied in multi mode to those that can be executed "head less".
Can you explain when getUpdatesResoution(WorkbenchMarkerResolution) is called. Just before the proposal is applied? What argument is passed? The last proposal that was just applied before? What could I do with this argument?
Imagine a scenario with 2 markers. User selects a resolution for marker A and hits next. They send select a resolution for marker B. Then they press finish. I apply resolution A. Then I send getUpdatesResoution(WorkbenchMarkerResolution) with resolution B. You return me an upodate resolution or null if it is no longer valid.
You said that's on IMarkerResolution: So is it newResolutionB= resolutionB.getUpdatesResoution(resolutionA)? What if you have 3 resolutions? newResolutionC= resolutionC.getUpdatesResoution(newResolutionB) or resolutionB.getUpdatesResoution(resolutionB) or maybe resolutionB.getUpdatesResoution(newResolutionA) ? What could resolutionC do with the argument resolutionB? Maybe it doesn't know resolutionB at all (from a different plugin)... Why not having this on IMarkerResolutionGenerator? The problem is still: If resolutionA knew that you also resolutionB is selected, a easier fix could be provided. So what I think is worth to have a look at is something like: IMarkerResolutionGenerator.getResolutions(IMarker[] marker) : IMarkerResolution[]
I see you point - the argument is redundant. newResolutionB= resolutionB.getUpdatedResoution() The user has already selected the resolution they want. If it can't be applied we do nothing and let them try again afterwards - I don't want to try and be too smart. Asking for all of the resolutions again requires the user to reselect which I want to avoid as the finish button should just complete the wizard and warn the user about unapplied resolutions.
*** Bug 114570 has been marked as a duplicate of this bug. ***
WorkbenchMarkerResolution has been released to org.eclipse.ui.views markers for build >20051116 Here is the specification /** * WorkbenchMarkerResolution is the resolution that can be grouped * with others that are similar to allow multi selection. * @since 3.2 * <strong>NOTE:</strong> This API is experimental and subject to * change in the 3.2 development cycle. * */ public abstract class WorkbenchMarkerResolution implements IMarkerResolution2 { /** * Return whether or not the receiver can be grouped with * resolution in the Quick Fix dialog. * @param resolution * @return boolean <code>true</code> if the receiver can * be grouped with resolution */ public abstract boolean canBeGroupedWith(WorkbenchMarkerResolution resolution); /** * Return an updated WorkbenchMarkerResolution for the receiver. * This is called after another WorkbenchMarkerResolution has been * applied in changes are required. * @return WorkbenchMarkerResolution */ public abstract WorkbenchMarkerResolution getUpdatedResolution();
verified in 20051113-0100