use of org.eclipse.jdt.ls.core.internal.preferences.PreferenceManager in project eclipse.jdt.ls by eclipse.
the class CodeLensHandlerTest method setup.
@Before
public void setup() throws Exception {
importProjects("eclipse/hello");
project = WorkspaceHelper.getProject("hello");
preferenceManager = mock(PreferenceManager.class);
when(preferenceManager.getPreferences()).thenReturn(new Preferences());
handler = new CodeLensHandler(preferenceManager);
}
use of org.eclipse.jdt.ls.core.internal.preferences.PreferenceManager in project eclipse.jdt.ls by eclipse.
the class ReferencesHandlerTest method setup.
@Before
public void setup() throws Exception {
importProjects("eclipse/hello");
project = WorkspaceHelper.getProject("hello");
preferenceManager = mock(PreferenceManager.class);
when(preferenceManager.getPreferences()).thenReturn(new Preferences());
handler = new ReferencesHandler(preferenceManager);
}
use of org.eclipse.jdt.ls.core.internal.preferences.PreferenceManager in project eclipse.jdt.ls by eclipse.
the class RenameHandlerTest method setup.
@Before
public void setup() throws Exception {
IJavaProject javaProject = newEmptyProject();
sourceFolder = javaProject.getPackageFragmentRoot(javaProject.getProject().getFolder("src"));
preferenceManager = mock(PreferenceManager.class);
Preferences p = mock(Preferences.class);
when(preferenceManager.getPreferences()).thenReturn(p);
when(p.isRenameEnabled()).thenReturn(true);
handler = new RenameHandler(preferenceManager);
}
use of org.eclipse.jdt.ls.core.internal.preferences.PreferenceManager in project eclipse.jdt.ls by eclipse.
the class SignatureHelpHandlerTest method setup.
@Override
@Before
public void setup() throws Exception {
importProjects("eclipse/hello");
project = WorkspaceHelper.getProject("hello");
IJavaProject javaProject = JavaCore.create(project);
sourceFolder = javaProject.getPackageFragmentRoot(javaProject.getProject().getFolder("src"));
preferenceManager = mock(PreferenceManager.class);
Preferences p = mock(Preferences.class);
when(preferenceManager.getPreferences(null)).thenReturn(p);
when(p.isSignatureHelpEnabled()).thenReturn(true);
handler = new SignatureHelpHandler(preferenceManager);
}
use of org.eclipse.jdt.ls.core.internal.preferences.PreferenceManager in project eclipse.jdt.ls by eclipse.
the class MavenProjectImporter method applies.
@Override
public boolean applies(IProgressMonitor monitor) throws OperationCanceledException, CoreException {
PreferenceManager preferencesManager = JavaLanguageServerPlugin.getPreferencesManager();
if (preferencesManager != null && !preferencesManager.getPreferences().isImportMavenEnabled()) {
return false;
}
Set<MavenProjectInfo> files = getMavenProjectInfo(monitor);
if (files != null) {
Iterator<MavenProjectInfo> iter = files.iterator();
while (iter.hasNext()) {
MavenProjectInfo projectInfo = iter.next();
File dir = projectInfo.getPomFile() == null ? null : projectInfo.getPomFile().getParentFile();
if (dir != null && exclude(dir.toPath())) {
iter.remove();
}
}
}
return files != null && !files.isEmpty();
}
Aggregations