public IClasspathEntry build() { return JavaCore.newSourceEntry(this.path, this.includes, this.excludes, this.output, this.attributes); }
/** * Returns a default class path. * This is the root of the project */ protected IClasspathEntry[] defaultClasspath() { return new IClasspathEntry[] { JavaCore.newSourceEntry(this.project.getFullPath())}; }
/** * Returns a default class path. * This is the root of the project */ protected IClasspathEntry[] defaultClasspath() { return new IClasspathEntry[] { JavaCore.newSourceEntry(this.project.getFullPath())}; }
/** * Returns a default class path. * This is the root of the project */ protected IClasspathEntry[] defaultClasspath() { return new IClasspathEntry[] { JavaCore.newSourceEntry(this.project.getFullPath())}; }
/** * Returns a default class path. * This is the root of the project */ protected IClasspathEntry[] defaultClasspath() { return new IClasspathEntry[] { JavaCore.newSourceEntry(this.project.getFullPath())}; }
/** * Returns a default class path. * This is the root of the project */ protected IClasspathEntry[] defaultClasspath() { return new IClasspathEntry[] { JavaCore.newSourceEntry(this.project.getFullPath())}; }
/** * Returns a default class path. * This is the root of the project */ protected IClasspathEntry[] defaultClasspath() { return new IClasspathEntry[] { JavaCore.newSourceEntry(this.project.getFullPath())}; }
/** * add the source folder to classpath dir (IClasspathEntry.CPE_SOURCE) */ public void addJavaSourceToClasspathEntries() { IPath sourceClassPath = new Path(getFullSourcePath()); addToClasspathEntries(new IClasspathEntry[]{JavaCore.newSourceEntry(sourceClassPath)}); }
private IClasspathEntry[] getClasspathEntries(String sourceFolder, String componentName, IProject jProject) { ArrayList list = new ArrayList(); list.add(JavaCore.newSourceEntry(jProject.getFullPath().append(sourceFolder))); IClasspathEntry[] classpath = new IClasspathEntry[list.size()]; IPath newOutputPath = null; for (int i = 0; i < classpath.length; i++) { classpath[i] = (IClasspathEntry) list.get(i); newOutputPath = Path.fromOSString(Path.SEPARATOR +jProject.getName() + "/bin/"); ((ClasspathEntry)classpath[i]).specificOutputLocation = newOutputPath; } return classpath; }
public AddToClasspathChange(IJavaProject project, String sourceFolderName){ this(project, JavaCore.newSourceEntry(project.getPath().append(sourceFolderName))); }
public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { IPath srcPath = new Path(srcDir); IPath outPath = new Path(outDir); IStatus status = Status.OK_STATUS; final IJavaProject jproj = JavaCore.create(project); final IClasspathEntry[] cp = {JavaCore.newSourceEntry(srcPath)}; try { jproj.setRawClasspath(cp, outPath, null); jproj.save(null, true); } catch (JavaModelException e) { e.printStackTrace(); } return status; }
public static void addFolderToClasspath(IJavaProject project, String folderName, boolean create, IProgressMonitor monitor) throws JavaModelException, CoreException { List<IClasspathEntry> list = new ArrayList<IClasspathEntry>(); list.addAll(Arrays.asList(project.getRawClasspath())); IFolder folder = project.getProject().getFolder(folderName); if (create || folder.exists()) { if (create) createFolder(folder, monitor); IPackageFragmentRoot ipackagefragmentroot = project.getPackageFragmentRoot(folder); list.add(JavaCore.newSourceEntry(ipackagefragmentroot.getPath())); project.setRawClasspath((IClasspathEntry[]) list.toArray(new IClasspathEntry[list.size()]), null); } }
private void createPackageFragmentRoot(IPackageFragmentRoot root) throws CoreException { final IJavaProject project= root.getJavaProject(); if (!project.exists()) { // createJavaProject(project.getProject()); } final IFolder folder= project.getProject().getFolder(root.getElementName()); if (!folder.exists()) { ResourceUtil.createFolder(folder, true, true, new NullProgressMonitor()); } final List<IClasspathEntry> list= Arrays.asList(project.getRawClasspath()); list.add(JavaCore.newSourceEntry(folder.getFullPath())); project.setRawClasspath(list.toArray(new IClasspathEntry[list.size()]), new NullProgressMonitor()); }
private void createPackageFragmentRoot(IPackageFragmentRoot root) throws CoreException { final IJavaProject project= root.getJavaProject(); if (!project.exists()) createJavaProject(project.getProject()); final IFolder folder= project.getProject().getFolder(root.getElementName()); if (!folder.exists()) CoreUtility.createFolder(folder, true, true, new NullProgressMonitor()); final List list= Arrays.asList(project.getRawClasspath()); list.add(JavaCore.newSourceEntry(folder.getFullPath())); project.setRawClasspath((IClasspathEntry[]) list.toArray(new IClasspathEntry[list.size()]), new NullProgressMonitor()); }
private void createPackageFragmentRoot(IPackageFragmentRoot root) throws CoreException { final IJavaProject project= root.getJavaProject(); if (!project.exists()) createJavaProject(project.getProject()); final IFolder folder= project.getProject().getFolder(root.getElementName()); if (!folder.exists()) CoreUtility.createFolder(folder, true, true, new NullProgressMonitor()); final List<IClasspathEntry> list= Arrays.asList(project.getRawClasspath()); list.add(JavaCore.newSourceEntry(folder.getFullPath())); project.setRawClasspath(list.toArray(new IClasspathEntry[list.size()]), new NullProgressMonitor()); }
protected void addSourceFolder(IJavaProject project, List<IClasspathEntry> list, String s, IProgressMonitor monitor) throws CoreException { IFolder folder = project.getProject().getFolder(s); FileUtils.createFolder(folder, monitor); IPackageFragmentRoot ipackagefragmentroot = project.getPackageFragmentRoot(folder); list.add(JavaCore.newSourceEntry(ipackagefragmentroot.getPath())); }
private void createPackageFragmentRoot(IPackageFragmentRoot root) throws CoreException { final IJavaProject project= root.getJavaProject(); if (!project.exists()) createJavaProject(project.getProject()); final IFolder folder= project.getProject().getFolder(root.getElementName()); if (!folder.exists()) CoreUtility.createFolder(folder, true, true, new NullProgressMonitor()); final List<IClasspathEntry> list= Arrays.asList(project.getRawClasspath()); list.add(JavaCore.newSourceEntry(folder.getFullPath())); project.setRawClasspath(list.toArray(new IClasspathEntry[list.size()]), new NullProgressMonitor()); }
/** * @param sourceSourceFolder * @return */ private IFolder getOrCreateTargetSourceFolder(IFolder sourceSourceFolder) throws CoreException { IFolder targetFolder = clientProject.getFolder(sourceSourceFolder.getProjectRelativePath()); if(targetFolder == null || !targetFolder.exists()) { mkFolders(targetFolder.getFullPath(), workspace.getRoot()); JemProjectUtilities.appendJavaClassPath(clientProject, JavaCore.newSourceEntry(targetFolder.getFullPath())); } return targetFolder; }
public static IFolder addSourceFolder(IJavaProject javaProject, String folderName) throws CoreException, JavaModelException { IProject project = javaProject.getProject(); IPath projectPath = project.getFullPath(); deleteClasspathEntry(javaProject, projectPath); IFolder srcFolder = createSubFolder(project, folderName); //$NON-NLS-1$ IClasspathEntry srcFolderClasspathEntry = JavaCore.newSourceEntry(srcFolder.getFullPath()); addToClasspath(javaProject, srcFolderClasspathEntry); return srcFolder; }
public static IFolder addSourceFolder(IJavaProject javaProject, String folderName, String[] inclusionPatterns, String[] exclusionPatterns) throws CoreException, JavaModelException { IProject project = javaProject.getProject(); IPath projectPath = project.getFullPath(); deleteClasspathEntry(javaProject, projectPath); IFolder srcFolder = createSubFolder(project, folderName); //$NON-NLS-1$ IClasspathEntry srcFolderClasspathEntry = JavaCore.newSourceEntry(srcFolder.getFullPath(), getInclusionPatterns(inclusionPatterns), getExclusionPatterns(exclusionPatterns), null); addToClasspath(javaProject, srcFolderClasspathEntry); return srcFolder; }