Bug 519549 - Order of jdt.ui quickfixes differ in editor and in quickfix
page
Change-Id: Iccf4972ed9df0482c1c7aa982ad022fb9df37f68
Signed-off-by: Vikas Chandra <Vikas.Chandra@in.ibm.com>
diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/CorrectionMarkerResolutionGenerator.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/CorrectionMarkerResolutionGenerator.java
index c3a749b..d0af6f4 100644
--- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/CorrectionMarkerResolutionGenerator.java
+++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/CorrectionMarkerResolutionGenerator.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2017 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -37,6 +37,7 @@
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IMarkerResolution;
import org.eclipse.ui.IMarkerResolutionGenerator2;
+import org.eclipse.ui.IMarkerResolutionRelevance;
import org.eclipse.ui.views.markers.WorkbenchMarkerResolution;
import org.eclipse.ui.texteditor.ITextEditor;
@@ -67,7 +68,7 @@
public class CorrectionMarkerResolutionGenerator implements IMarkerResolutionGenerator2 {
- public static class CorrectionMarkerResolution extends WorkbenchMarkerResolution {
+ public static class CorrectionMarkerResolution extends WorkbenchMarkerResolution implements IMarkerResolutionRelevance {
private static final IMarker[] NO_MARKERS= new IMarker[0];
@@ -193,6 +194,13 @@
}
@Override
+ public int getRelevanceForResolution() {
+ if (fProposal != null)
+ return fProposal.getRelevance();
+ return 0;
+ }
+
+ @Override
public IMarker[] findOtherMarkers(IMarker[] markers) {
if (!(fProposal instanceof FixCorrectionProposal))
return NO_MARKERS;