From 1e9abcce65c81130ff2acf862efe666f5df686e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20L=C3=A4ubrich?= Date: Tue, 14 Nov 2023 11:46:02 +0100 Subject: [PATCH] Convert BuildpathQuickFixProcessor into reusable UI component MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently the BuildpathQuickFixProcessor is bound to Bndtools toling completely, but now using the adapter pattern can be used in any context where a IProject can be adapted to (bnd) Project Signed-off-by: Christoph Läubrich --- .../core/editors/quickfix/BuildpathQuickFixProcessor.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bndtools.core.services/src/org/bndtools/core/editors/quickfix/BuildpathQuickFixProcessor.java b/bndtools.core.services/src/org/bndtools/core/editors/quickfix/BuildpathQuickFixProcessor.java index 7894ce0da3..ae8849ad71 100644 --- a/bndtools.core.services/src/org/bndtools/core/editors/quickfix/BuildpathQuickFixProcessor.java +++ b/bndtools.core.services/src/org/bndtools/core/editors/quickfix/BuildpathQuickFixProcessor.java @@ -15,6 +15,7 @@ import java.util.stream.Stream; import org.eclipse.core.resources.IResource; +import org.eclipse.core.runtime.Adapters; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IStatus; @@ -64,7 +65,6 @@ import aQute.bnd.osgi.Descriptors; import aQute.bnd.osgi.Descriptors.TypeRef; import aQute.bnd.result.Result; -import bndtools.central.Central; @Component public class BuildpathQuickFixProcessor implements IQuickFixProcessor { @@ -365,7 +365,7 @@ public IJavaCompletionProposal[] getCorrections(IInvocationContext context, IPro if (java == null) return null; - project = Central.getProject(java.getProject()); + project = Adapters.adapt(java.getProject(), Project.class); if (project == null) return null;