Java Code Examples for org.eclipse.jdt.core.JavaCore#initializeAfterLoad()

The following examples show how to use org.eclipse.jdt.core.JavaCore#initializeAfterLoad() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JavaProjectSetupUtil.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
/**
 * @since 2.17
 */
public static IJavaProject createJavaProject(String projectName, boolean build) throws CoreException {
	IProject project = createSimpleProject(projectName);
	JavaCore.initializeAfterLoad(monitor());
	IJavaProject javaProject = makeJavaProject(project, build);
	return javaProject;
}
 
Example 2
Source File: JavaSyntaxServerTestPlugin.java    From eclipse.jdt.ls with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public void start(BundleContext context) throws Exception {
	JavaCore.initializeAfterLoad(new NullProgressMonitor());
	IWorkspace workspace = ResourcesPlugin.getWorkspace();
	IWorkspaceDescription description = workspace.getDescription();
	description.setAutoBuilding(false);
	workspace.setDescription(description);
}
 
Example 3
Source File: JavaLanguageServerTestPlugin.java    From eclipse.jdt.ls with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public void start(BundleContext context) throws Exception {
	TestVMType.setTestJREAsDefault("1.8");
	JavaCore.initializeAfterLoad(new NullProgressMonitor());
	IWorkspace workspace = ResourcesPlugin.getWorkspace();
	IWorkspaceDescription description = workspace.getDescription();
	description.setAutoBuilding(true);
	workspace.setDescription(description);
}
 
Example 4
Source File: AbstractCompilationUnitBasedTest.java    From eclipse.jdt.ls with Eclipse Public License 2.0 5 votes vote down vote up
@Before
public void setup() throws Exception{
	importProjects("eclipse/hello");
	project = WorkspaceHelper.getProject("hello");
	wcOwner = new LanguageServerWorkingCopyOwner(connection);
	server= new JDTLanguageServer(projectsManager, preferenceManager);
	JavaCore.initializeAfterLoad(null);
}
 
Example 5
Source File: InitializeAfterLoadJob.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
@Override
protected IStatus run(IProgressMonitor monitor) {
	monitor.beginTask("", 10); //$NON-NLS-1$
	try {
		JavaCore.initializeAfterLoad(new SubProgressMonitor(monitor, 6));
		JavaPlugin.initializeAfterLoad(new SubProgressMonitor(monitor, 4));
	} catch (CoreException e) {
		JavaPlugin.log(e);
		return e.getStatus();
	}
	return Status.OK_STATUS;
}
 
Example 6
Source File: JavaProjectSetupUtil.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public static IJavaProject createJavaProject(String projectName) throws CoreException {
	IProject project = createSimpleProject(projectName);
	JavaCore.initializeAfterLoad(monitor());
	IJavaProject javaProject = makeJavaProject(project);
	return javaProject;
}