use of org.eclipse.jdt.ls.core.internal.preferences.PreferenceManager in project eclipse.jdt.ls by eclipse.
the class JavaLanguageServerPlugin method start.
/*
* (non-Javadoc)
* @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
*/
@Override
public void start(BundleContext bundleContext) throws BackingStoreException {
try {
Platform.getBundle(ResourcesPlugin.PI_RESOURCES).start(Bundle.START_TRANSIENT);
} catch (BundleException e) {
logException(e.getMessage(), e);
}
try {
redirectStandardStreams();
} catch (FileNotFoundException e) {
logException(e.getMessage(), e);
}
JavaLanguageServerPlugin.context = bundleContext;
JavaLanguageServerPlugin.pluginInstance = this;
// Set the ID to use for preference lookups
JavaManipulation.setPreferenceNodeId(PLUGIN_ID);
preferenceManager = new PreferenceManager();
initializeJDTOptions();
projectsManager = new ProjectsManager(preferenceManager);
try {
ResourcesPlugin.getWorkspace().addSaveParticipant(PLUGIN_ID, projectsManager);
} catch (CoreException e) {
logException(e.getMessage(), e);
}
contentProviderManager = new ContentProviderManager(preferenceManager);
logInfo(getClass() + " is started");
configureProxy();
}
use of org.eclipse.jdt.ls.core.internal.preferences.PreferenceManager in project eclipse.jdt.ls by eclipse.
the class GradleProjectImporter method applies.
/* (non-Javadoc)
* @see org.eclipse.jdt.ls.core.internal.managers.IProjectImporter#applies(org.eclipse.core.runtime.IProgressMonitor)
*/
@Override
public boolean applies(IProgressMonitor monitor) throws CoreException {
if (rootFolder == null) {
return false;
}
PreferenceManager preferencesManager = JavaLanguageServerPlugin.getPreferencesManager();
if (preferencesManager != null && !preferencesManager.getPreferences().isImportGradleEnabled()) {
return false;
}
if (directories == null) {
BasicFileDetector gradleDetector = new BasicFileDetector(rootFolder.toPath(), BUILD_GRADLE_DESCRIPTOR).includeNested(false).addExclusions(// default gradle build dir
"**/build");
directories = gradleDetector.scan(monitor);
}
return !directories.isEmpty();
}
use of org.eclipse.jdt.ls.core.internal.preferences.PreferenceManager in project eclipse.jdt.ls by eclipse.
the class SaveActionHandlerTest method setup.
@Override
@Before
public void setup() throws Exception {
importProjects("eclipse/hello");
project = WorkspaceHelper.getProject("hello");
preferenceManager = mock(PreferenceManager.class);
Preferences preferences = mock(Preferences.class);
when(preferences.isJavaSaveActionsOrganizeImportsEnabled()).thenReturn(Boolean.TRUE);
when(preferenceManager.getPreferences()).thenReturn(preferences);
monitor = mock(IProgressMonitor.class);
when(monitor.isCanceled()).thenReturn(false);
handler = new SaveActionHandler(preferenceManager);
}
use of org.eclipse.jdt.ls.core.internal.preferences.PreferenceManager in project eclipse.jdt.ls by eclipse.
the class HoverHandlerTest method setup.
@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);
when(preferenceManager.getPreferences()).thenReturn(new Preferences());
handler = new HoverHandler(preferenceManager);
}
use of org.eclipse.jdt.ls.core.internal.preferences.PreferenceManager in project eclipse.jdt.ls by eclipse.
the class NavigateToDefinitionHandlerTest method setUp.
@Before
public void setUp() throws Exception {
preferenceManager = mock(PreferenceManager.class);
when(preferenceManager.getPreferences()).thenReturn(new Preferences());
handler = new NavigateToDefinitionHandler(preferenceManager);
importProjects("maven/salut");
project = WorkspaceHelper.getProject("salut");
}
Aggregations