Skip to content

Commit

Permalink
Convert BuildpathQuickFixProcessor into reusable UI component
Browse files Browse the repository at this point in the history
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 <laeubi@laeubi-soft.de>
  • Loading branch information
laeubi committed Nov 14, 2023
1 parent 928e84a commit 1e9abcc
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit 1e9abcc

Please sign in to comment.