/** Creates specified Java project. */ public static IJavaProject createJavaProject(String projectName, IProgressMonitor monitor) throws CoreException { IProject project = SpringCoreUtils.createProject(projectName, null, monitor); if (monitor.isCanceled()) { throw new OperationCanceledException(); } if (!project.hasNature(JavaCore.NATURE_ID)) { SpringCoreUtils.addProjectNature(project, JavaCore.NATURE_ID, monitor); } IJavaProject jproject = JavaCore.create(project); // append JRE entry jproject.setRawClasspath(new IClasspathEntry[] {getJreVariableEntry()}, monitor); jproject.setOutputLocation(project.getFullPath(), monitor); if (monitor.isCanceled()) { throw new OperationCanceledException(); } return jproject; }
private boolean isApplicable(IJavaProject project) { // Maybe this should only apply to spring boot projects. But for now allow it to apply // to any spring project. return SpringCoreUtils.hasNature(project.getProject(), SpringCoreUtils.NATURE_ID); }
/** * Supports both an normal {@link IProject} and a {@link IJavaProject} but it needs to have the * Spring nature. */ @Override public boolean supports(IProject project) { return SpringCoreUtils.isSpringProject(project); }