|
18 | 18 | import org.eclipse.core.resources.IFolder; |
19 | 19 | import org.eclipse.core.resources.IProject; |
20 | 20 | import org.eclipse.core.resources.IResource; |
| 21 | +import org.eclipse.core.runtime.Adapters; |
21 | 22 | import org.eclipse.core.runtime.CoreException; |
22 | | -import org.eclipse.core.runtime.IAdaptable; |
23 | 23 | import org.eclipse.core.runtime.IPath; |
24 | 24 | import org.eclipse.core.runtime.NullProgressMonitor; |
25 | 25 | import org.eclipse.ui.IFileEditorInput; |
26 | 26 |
|
27 | 27 | import org.eclipse.m2e.core.MavenPlugin; |
28 | 28 | import org.eclipse.m2e.core.embedder.ArtifactKey; |
29 | 29 | import org.eclipse.m2e.core.internal.IMavenConstants; |
| 30 | +import org.eclipse.m2e.core.internal.project.ResolverConfigurationIO; |
30 | 31 | import org.eclipse.m2e.core.project.IMavenProjectFacade; |
31 | 32 | import org.eclipse.m2e.core.project.IMavenProjectRegistry; |
32 | | -import org.eclipse.m2e.core.project.IProjectConfiguration; |
33 | 33 | import org.eclipse.m2e.core.project.MavenProjectUtils; |
34 | 34 |
|
35 | 35 |
|
@@ -60,19 +60,11 @@ public class MavenPropertyTester extends PropertyTester { |
60 | 60 | @Override |
61 | 61 | public boolean test(Object receiver, String property, Object[] args, Object expectedValue) { |
62 | 62 | if(WORKSPACE_RESULUTION_ENABLE.equals(property)) { |
63 | | - boolean enableWorkspaceResolution = true; |
64 | | - IAdaptable adaptable = (IAdaptable) receiver; |
65 | | - |
66 | | - IProject projectAdapter = adaptable.getAdapter(IProject.class); |
| 63 | + IProject projectAdapter = Adapters.adapt(receiver, IProject.class); |
67 | 64 | if(projectAdapter != null) { |
68 | | - IMavenProjectRegistry projectManager = MavenPlugin.getMavenProjectRegistry(); |
69 | | - IMavenProjectFacade projectFacade = projectManager.create(projectAdapter, new NullProgressMonitor()); |
70 | | - if(projectFacade != null) { |
71 | | - IProjectConfiguration configuration = projectFacade.getConfiguration(); |
72 | | - return !configuration.isResolveWorkspaceProjects(); |
73 | | - } |
| 65 | + return !ResolverConfigurationIO.isResolveWorkspaceProjects(projectAdapter); |
74 | 66 | } |
75 | | - return enableWorkspaceResolution; |
| 67 | + return true; |
76 | 68 | } |
77 | 69 |
|
78 | 70 | if(HAS_ARTIFACT_KEY.equals(property)) { |
|
0 commit comments