-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SLE-470 Restore backward compatibility with Eclipse < 2018-09
- Loading branch information
1 parent
bb3fd31
commit 3394c50
Showing
12 changed files
with
251 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
101 changes: 101 additions & 0 deletions
101
...onarlint.eclipse.jdt/src/org/sonarlint/eclipse/jdt/internal/MarkerResolverJdtAdapter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
/* | ||
* SonarLint for Eclipse | ||
* Copyright (C) 2015-2021 SonarSource SA | ||
* [email protected] | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser General Public | ||
* License as published by the Free Software Foundation; either | ||
* version 3 of the License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with this program; if not, write to the Free Software Foundation, | ||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
*/ | ||
package org.sonarlint.eclipse.jdt.internal; | ||
|
||
import org.eclipse.core.resources.IMarker; | ||
import org.eclipse.jdt.annotation.Nullable; | ||
import org.eclipse.jdt.ui.text.java.IJavaCompletionProposal; | ||
import org.eclipse.jface.text.IDocument; | ||
import org.eclipse.jface.text.contentassist.IContextInformation; | ||
import org.eclipse.swt.graphics.Image; | ||
import org.eclipse.swt.graphics.Point; | ||
import org.sonarlint.eclipse.ui.quickfixes.ISonarLintMarkerResolver; | ||
|
||
/** | ||
* Inspired by MarkerResolutionProposal | ||
*/ | ||
class MarkerResolverJdtAdapter implements ISonarLintMarkerResolver, IJavaCompletionProposal { | ||
|
||
private final ISonarLintMarkerResolver wrapped; | ||
private final IMarker marker; | ||
|
||
public MarkerResolverJdtAdapter(ISonarLintMarkerResolver resolution, IMarker marker) { | ||
this.wrapped = resolution; | ||
this.marker = marker; | ||
} | ||
|
||
@Override | ||
public String getLabel() { | ||
return wrapped.getLabel(); | ||
} | ||
|
||
@Override | ||
public void run(IMarker marker) { | ||
wrapped.run(marker); | ||
} | ||
|
||
@Override | ||
public void apply(IDocument document) { | ||
wrapped.run(marker); | ||
} | ||
|
||
@Nullable | ||
@Override | ||
public Point getSelection(IDocument document) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public String getAdditionalProposalInfo() { | ||
return wrapped.getDescription(); | ||
} | ||
|
||
@Override | ||
public String getDisplayString() { | ||
return getLabel(); | ||
} | ||
|
||
@Nullable | ||
@Override | ||
public IContextInformation getContextInformation() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public int getRelevance() { | ||
return wrapped.getRelevanceForResolution(); | ||
} | ||
|
||
@Override | ||
public String getDescription() { | ||
return wrapped.getDescription(); | ||
} | ||
|
||
@Override | ||
public Image getImage() { | ||
return wrapped.getImage(); | ||
} | ||
|
||
@Override | ||
public int getRelevanceForResolution() { | ||
return wrapped.getRelevanceForResolution(); | ||
} | ||
|
||
} |
30 changes: 30 additions & 0 deletions
30
...eclipse.jdt/src/org/sonarlint/eclipse/jdt/internal/MarkerResolverRelevanceJdtAdapter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* SonarLint for Eclipse | ||
* Copyright (C) 2015-2021 SonarSource SA | ||
* [email protected] | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser General Public | ||
* License as published by the Free Software Foundation; either | ||
* version 3 of the License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with this program; if not, write to the Free Software Foundation, | ||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
*/ | ||
package org.sonarlint.eclipse.jdt.internal; | ||
|
||
import org.eclipse.core.resources.IMarker; | ||
import org.eclipse.ui.IMarkerResolutionRelevance; | ||
import org.sonarlint.eclipse.ui.quickfixes.ISonarLintMarkerResolver; | ||
|
||
class MarkerResolverRelevanceJdtAdapter extends MarkerResolverJdtAdapter implements IMarkerResolutionRelevance { | ||
public MarkerResolverRelevanceJdtAdapter(ISonarLintMarkerResolver resolution, IMarker marker) { | ||
super(resolution, marker); | ||
} | ||
} |
60 changes: 60 additions & 0 deletions
60
...se.ui/src/org/sonarlint/eclipse/ui/internal/markers/MarkerResolutionRelevanceAdapter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/* | ||
* SonarLint for Eclipse | ||
* Copyright (C) 2015-2021 SonarSource SA | ||
* [email protected] | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser General Public | ||
* License as published by the Free Software Foundation; either | ||
* version 3 of the License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with this program; if not, write to the Free Software Foundation, | ||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
*/ | ||
package org.sonarlint.eclipse.ui.internal.markers; | ||
|
||
import org.eclipse.core.resources.IMarker; | ||
import org.eclipse.swt.graphics.Image; | ||
import org.eclipse.ui.IMarkerResolutionRelevance; | ||
import org.sonarlint.eclipse.ui.quickfixes.ISonarLintMarkerResolver; | ||
|
||
public class MarkerResolutionRelevanceAdapter implements ISonarLintMarkerResolver, IMarkerResolutionRelevance { | ||
|
||
private final ISonarLintMarkerResolver wrapped; | ||
|
||
public MarkerResolutionRelevanceAdapter(ISonarLintMarkerResolver wrapped) { | ||
this.wrapped = wrapped; | ||
} | ||
|
||
@Override | ||
public String getLabel() { | ||
return wrapped.getLabel(); | ||
} | ||
|
||
@Override | ||
public void run(IMarker marker) { | ||
wrapped.run(marker); | ||
} | ||
|
||
@Override | ||
public String getDescription() { | ||
return wrapped.getDescription(); | ||
} | ||
|
||
@Override | ||
public Image getImage() { | ||
return wrapped.getImage(); | ||
} | ||
|
||
@Override | ||
public int getRelevanceForResolution() { | ||
return wrapped.getRelevanceForResolution(); | ||
} | ||
|
||
} |
Oops, something went wrong.