@Override public IPath getDefaultOutputLocation() { try { return project.getOutputLocation(); } catch (JavaModelException e) { throw new RuntimeException(e); } } }
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { try { project.setRawClasspath(newEntries, project.getOutputLocation(), monitor); } catch (CoreException e) { throw new InvocationTargetException(e); } } });
@Override public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { try { project.setRawClasspath(newEntries, project.getOutputLocation(), monitor); } catch (CoreException e) { throw new InvocationTargetException(e); } } });
@Override public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { try { project.setRawClasspath(newEntries, project.getOutputLocation(), monitor); } catch (CoreException e) { throw new InvocationTargetException(e); } } });
@Override public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { try { project.setRawClasspath(newEntries, project.getOutputLocation(), monitor); } catch (CoreException e) { throw new InvocationTargetException(e); } } });
public static IPath[] getOutputLocations(IJavaProject project) throws CoreException { List<IPath> result = new ArrayList<IPath>(); result.add(project.getOutputLocation()); IClasspathEntry[] entries = project.getRawClasspath(); for (int i = 0; i < entries.length; i++) { IClasspathEntry entry = entries[i]; if (entry.getEntryKind() == IClasspathEntry.CPE_SOURCE) { result.add(entry.getOutputLocation()); } } return result.toArray(new IPath[result.size()]); }
public static ClasspathChange addEntryChange(IJavaProject project, IClasspathEntry entryToAdd) throws JavaModelException { IClasspathEntry[] rawClasspath= project.getRawClasspath(); IClasspathEntry[] newClasspath= new IClasspathEntry[rawClasspath.length + 1]; System.arraycopy(rawClasspath, 0, newClasspath, 0, rawClasspath.length); newClasspath[rawClasspath.length]= entryToAdd; IPath outputLocation= project.getOutputLocation(); return newChange(project, newClasspath, outputLocation); }
public static ClasspathChange addEntryChange(IJavaProject project, IClasspathEntry entryToAdd) throws JavaModelException { IClasspathEntry[] rawClasspath= project.getRawClasspath(); IClasspathEntry[] newClasspath= new IClasspathEntry[rawClasspath.length + 1]; System.arraycopy(rawClasspath, 0, newClasspath, 0, rawClasspath.length); newClasspath[rawClasspath.length]= entryToAdd; IPath outputLocation= project.getOutputLocation(); return newChange(project, newClasspath, outputLocation); }
public static ClasspathChange addEntryChange(IJavaProject project, IClasspathEntry entryToAdd) throws JavaModelException { IClasspathEntry[] rawClasspath= project.getRawClasspath(); IClasspathEntry[] newClasspath= new IClasspathEntry[rawClasspath.length + 1]; System.arraycopy(rawClasspath, 0, newClasspath, 0, rawClasspath.length); newClasspath[rawClasspath.length]= entryToAdd; IPath outputLocation= project.getOutputLocation(); return newChange(project, newClasspath, outputLocation); }
public static boolean isNotInOutputFolder(IFile file, IJavaProject jp) { try { IPath out = jp.getOutputLocation(); return !out.isPrefixOf(file.getFullPath()); } catch (JavaModelException e) { return true; } }
public static ClasspathChange removeEntryChange(IJavaProject project, IClasspathEntry entryToRemove) throws JavaModelException { IClasspathEntry[] rawClasspath= project.getRawClasspath(); ArrayList<IClasspathEntry> newClasspath= new ArrayList<>(); for (int i= 0; i < rawClasspath.length; i++) { IClasspathEntry curr= rawClasspath[i]; if (curr.getEntryKind() != entryToRemove.getEntryKind() || !curr.getPath().equals(entryToRemove.getPath())) { newClasspath.add(curr); } } IClasspathEntry[] entries= newClasspath.toArray(new IClasspathEntry[newClasspath.size()]); IPath outputLocation= project.getOutputLocation(); return newChange(project, entries, outputLocation); }
public boolean validateClasspath() throws JavaModelException { IJavaProject javaProject= getJavaProject(); IPath outputLocation= javaProject.getOutputLocation(); IClasspathEntry[] newClasspathEntries= getNewClasspathEntries(); return JavaConventions.validateClasspath(javaProject, newClasspathEntries, outputLocation).isOK(); }
private boolean isOutputFolder(IFolder folder) { try { IJavaProject javaProject= JavaCore.create(folder.getProject()); IPath outputFolderPath= javaProject.getOutputLocation(); return folder.getFullPath().equals(outputFolderPath); } catch (JavaModelException ex) { return false; } }
private boolean isOutputFolder(IFolder folder) { try { IJavaProject javaProject= JavaCore.create(folder.getProject()); IPath outputFolderPath= javaProject.getOutputLocation(); return folder.getFullPath().equals(outputFolderPath); } catch (JavaModelException ex) { return false; } }
public static Set<File> getOutputDirectories(IJavaProject project) throws JavaModelException { final Set<File> locations = new LinkedHashSet<>(); addWorkspaceLocation(locations, project.getOutputLocation()); for (IClasspathEntry cpe : project.getRawClasspath()) { if (cpe.getEntryKind() == IClasspathEntry.CPE_SOURCE && cpe.getOutputLocation() != null) { addWorkspaceLocation(locations, cpe.getOutputLocation()); } } return locations; }
private IPath getOutputLocation(IJavaProject javaProject) { try { return javaProject.getOutputLocation(); } catch (CoreException e) { IProject project= javaProject.getProject(); IPath projPath= project.getFullPath(); return projPath.append(PreferenceConstants.getPreferenceStore().getString(PreferenceConstants.SRCBIN_BINNAME)); } }
private IPath getOutputLocation(IJavaProject javaProject) { try { return javaProject.getOutputLocation(); } catch (CoreException e) { IProject project= javaProject.getProject(); IPath projPath= project.getFullPath(); return projPath.append(PreferenceConstants.getPreferenceStore().getString(PreferenceConstants.SRCBIN_BINNAME)); } }
private IPath getOutputLocation(IJavaProject javaProject) { try { return javaProject.getOutputLocation(); } catch (CoreException e) { IProject project= javaProject.getProject(); IPath projPath= project.getFullPath(); return projPath.append(PreferenceConstants.getPreferenceStore().getString(PreferenceConstants.SRCBIN_BINNAME)); } }
private IPath getOutputLocation(IJavaProject javaProject) { try { return javaProject.getOutputLocation(); } catch (CoreException e) { IProject project= javaProject.getProject(); IPath projPath= project.getFullPath(); return projPath.append(PreferenceConstants.getPreferenceStore().getString(PreferenceConstants.SRCBIN_BINNAME)); } }
private static void updateReferencedClasspathEntry(IJavaProject javaProject, IClasspathEntry newEntry, IProgressMonitor monitor) throws JavaModelException { List<IClasspathEntry> newEntries = updateElements(javaProject.getReferencedClasspathEntries(), newEntry, (entry) -> { return entry.getEntryKind() == newEntry.getEntryKind() && entry.getPath().equals(newEntry.getPath()); }); javaProject.setRawClasspath(javaProject.getRawClasspath(), newEntries.toArray(new IClasspathEntry[0]), javaProject.getOutputLocation(), monitor); }