Package com.iizigo.quickfix
Class QuickFixAdapter
java.lang.Object
org.eclipse.ui.views.markers.WorkbenchMarkerResolution
com.iizigo.quickfix.QuickFixAdapter
- All Implemented Interfaces:
- IQuickFixer,- IMarkerResolution,- IMarkerResolution2
- Direct Known Subclasses:
- CloseProjectQuickFixer,- CreateModuleFolders,- DeleteFile,- DeleteProperty,- DeleteRect,- GotoProperty,- RecoverModuleSettings,- RenameResource
The quick-fixes adapter class to Eclipse. It handles resolution of quick-fixes that can be grouped with others that are similar to allow multi-selection.
- Author:
- Christopher Mindus
- Constructor SummaryConstructors
- Method SummaryModifier and TypeMethodDescription- booleanChecks if this resolution can be grouped together with other ones.- IMarker[]- findOtherMarkers- (IMarker[] markers) Iterate through the list of supplied markers.Returns optional additional information about the resolution.- getImage()Returns the image to be displayed in the list of resolutions.- abstract String- getLabel()Returns a short label indicating what the resolution will do.Gets the marker if the- isMarkerRequired()is true.- booleanIndicates if the label returned and also the description depends on the marker selected.- abstract voidRuns this resolution.- voidCall to set the marker in a new instance of the quick-fixer.- Methods inherited from class org.eclipse.ui.views.markers.WorkbenchMarkerResolution- run
- Constructor Details- QuickFixAdapterpublic QuickFixAdapter()
 
- Method Details- getDescriptionReturns optional additional information about the resolution. The additional information will be presented to assist the user in deciding if the selected proposal is the desired choice.- Specified by:
- getDescriptionin interface- IMarkerResolution2
- Returns:
- the additional information or null
 
- getImageReturns the image to be displayed in the list of resolutions. The image would typically be shown to the left of the display string.- Specified by:
- getImagein interface- IMarkerResolution2
- Returns:
- the image to be shown or nullif no image is desired
 
- getLabelReturns a short label indicating what the resolution will do.- Specified by:
- getLabelin interface- IMarkerResolution
- Specified by:
- getLabelin interface- IQuickFixer
- Returns:
- a short label for this resolution
 
- isMarkerRequiredpublic boolean isMarkerRequired()Indicates if the label returned and also the description depends on the marker selected. In case this method returns true, a new Quick-Fix of the same instance is created followed by- setMarker(marker). The implementation of- getLabel()can therefore be redirected to- getLabel(marker)instead.- Specified by:
- isMarkerRequiredin interface- IQuickFixer
- Returns:
- false by default.
 
- setMarkerCall to set the marker in a new instance of the quick-fixer.- Specified by:
- setMarkerin interface- IQuickFixer
- Parameters:
- marker- The marker.
 
- getMarkerGets the marker if the- isMarkerRequired()is true.
- runRuns this resolution.- Specified by:
- runin interface- IMarkerResolution
- Specified by:
- runin interface- IQuickFixer
- Parameters:
- marker- the marker to resolve
 
- canBeGroupedpublic boolean canBeGrouped()Checks if this resolution can be grouped together with other ones. By default it can be grouped, but e.g. the "Go to Property" should not be grouped (you can't go to several places at once).- Returns:
- true by default, override to return false for e.g. the "Go to Property" quick-fixer.
 
- findOtherMarkersIterate through the list of supplied markers. Return any that can also have the receiver applied to them.- Specified by:
- findOtherMarkersin class- WorkbenchMarkerResolution
- Parameters:
- markers- The array of markers.
- Returns:
- IMarker[]