FileObject getSourceFileObject() { FileObject[] roots = sourcePath.getRoots(); if (roots != null && roots.length > 0) { return roots[0]; } return null; }
FileObject getSourceFileObject(){ FileObject[] roots = mySourcePath.getRoots(); if ( roots!= null && roots.length >0 ){ return roots[0]; } return null; }
public SpringIndex(ClassPath cp) { this.binaryRoots = cp.getRoots(); }
private static void addSourceRoots(ClassPath ecp, List<FileObject> allSourceRoots, Set<FileObject> preferredRoots) { FileObject[] sourceRoots = ecp.getRoots(); for (FileObject fr : sourceRoots) { if (!preferredRoots.contains(fr) && !fr.isVirtual()) { allSourceRoots.add(fr); preferredRoots.add(fr); } } }
private String[] getSourceRoots(ClassPath classPath) { FileObject[] sourceRoots = classPath.getRoots(); List<String> roots = new ArrayList<String>(sourceRoots.length); for (FileObject fo : sourceRoots) { String root = getRoot(fo); if (root != null) { roots.add(root); } } return roots.toArray(new String[0]); }
private String[] getSourceRoots(ClassPath classPath) { FileObject[] sourceRoots = classPath.getRoots(); List<String> roots = new ArrayList<String>(sourceRoots.length); for (FileObject fo : sourceRoots) { String root = getRoot(fo); if (root != null) { roots.add(root); } } return roots.toArray(new String[0]); }
private static void addSourceRoots(ClassPath ecp, List<FileObject> allSourceRoots, Set<FileObject> preferredRoots) { FileObject[] sourceRoots = ecp.getRoots(); for (FileObject fr : sourceRoots) { if (!preferredRoots.contains(fr) && !fr.isVirtual()) { allSourceRoots.add(fr); preferredRoots.add(fr); } } }
private static Set<String> getSourceRootsSet(ClassPath classPath) { FileObject[] sourceRoots = classPath.getRoots(); Set<String> roots = new HashSet<String>(sourceRoots.length); for (FileObject fo : sourceRoots) { String root = getRoot(fo); if (root != null) { roots.add(root); } } return roots; }
public FileObject[] getRoots () { //No need for caching, platforms does. ClassPath sources = this.platform.getSourceFolders(); return sources.getRoots(); }
public String getSourcePath() { return toRelativePaths(Arrays.asList(sources.getRoots())); }
public SpringIndex(FileObject fo) { this.binaryRoots = (ClassPath.getClassPath(fo, ClassPath.EXECUTE).getRoots()); }
private static String getLibrariesPath(ClassPath classPath) { StringBuilder librariesPath = new StringBuilder(); for (FileObject root : classPath.getRoots()) { if (librariesPath.length() > 0) { librariesPath.append(','); } FileObject archiveFile = FileUtil.getArchiveFile(root); if (archiveFile != null) { librariesPath.append(archiveFile.getPath()); } } return librariesPath.toString(); }
public static String getCommandLine(ClasspathInfo cpInfo) { ClassPath sourceCP = cpInfo.getClassPath(PathKind.SOURCE); FileObject[] roots = sourceCP != null ? sourceCP.getRoots() : new FileObject[0]; FileObject file = roots.length > 0 ? roots[0] : null; for (CompilerSettings cs : Lookup.getDefault().lookupAll(CompilerSettings.class)) { String cl = cs.buildCommandLine(file); if (cl != null) return cl; } return ""; }
private void removeSourceButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_removeSourceButtonActionPerformed final J2MEPlatform platform = findSelectedPlatform(); if (platform == null) return; final Object selectedValue = sourceList.getSelectedValue(); if (selectedValue == null) return; int i = sourceList.getSelectedIndex(); final ArrayList<FileObject> list = new ArrayList<FileObject>(Arrays.asList(platform.getSourceFolders().getRoots())); list.remove(selectedValue); platform.setSourceFolders(list); descriptorUpdated(); if (i >= sourceList.getModel().getSize()) i--; if (i >= 0) sourceList.setSelectedIndex(i); }//GEN-LAST:event_removeSourceButtonActionPerformed
private void addSourceButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addSourceButtonActionPerformed final J2MEPlatform platform = findSelectedPlatform(); if (platform == null) return; final String value = browse(NbBundle.getMessage(DetectPanel.class, "TITLE_DetectPanel_SelectSource")); // NOI18N if (value == null) return; final FileObject o = platform.resolveRelativePathToFileObject(value); if (o == null) return; final ArrayList<FileObject> list = new ArrayList<FileObject>(Arrays.asList(platform.getSourceFolders().getRoots())); list.add(o); platform.setSourceFolders(list); descriptorUpdated(); }//GEN-LAST:event_addSourceButtonActionPerformed
@Override public File[] getRequiredLibraries() { ClassPath cp = ClassPathFactory.createClassPath( ProjectClassPathSupport.createPropertyBasedClassPathImplementation( FileUtil.toFile(project.getProjectDirectory()), project.evaluator(), new String[]{"javac.classpath"})); List<File> files = new ArrayList<File>(); for (FileObject fo : cp.getRoots()) { fo = FileUtil.getArchiveFile(fo); if (fo == null) { continue; } files.add(FileUtil.toFile(fo)); } return files.toArray(new File[files.size()]); }
@Override public File[] getRequiredLibraries() { ClassPath cp = ClassPathFactory.createClassPath( ProjectClassPathSupport.createPropertyBasedClassPathImplementation( FileUtil.toFile(project.getProjectDirectory()), project.evaluator(), new String[]{"javac.classpath"})); List<File> files = new ArrayList<File>(); for (FileObject fo : cp.getRoots()) { fo = FileUtil.getArchiveFile(fo); if (fo == null) { continue; } files.add(FileUtil.toFile(fo)); } return files.toArray(new File[files.size()]); }
private static boolean isAptBuildGeneratedFolder(@NonNull final FileObject root) { final ClassPath scp = ClassPath.getClassPath(root, ClassPath.SOURCE); if (scp != null) { for (FileObject srcRoot : scp.getRoots()) { if (root.toURL().equals( AnnotationProcessingQuery.getAnnotationProcessingOptions(srcRoot).sourceOutputDirectory())) { return true; } } } return false; }
private static void listenOnProcessorPath( @NullAllowed final ClassPath cp, @NonNull final APTUtils target) { if (cp != null) { cp.addPropertyChangeListener(WeakListeners.propertyChange(target, cp)); cp.getRoots();//so that the ClassPath starts listening on the filesystem } }
private static boolean isAptBuildGeneratedFolder( @NonNull final URL root, @NonNull final ClassPath srcPath) { Parameters.notNull("root", root); //NOI18N Parameters.notNull("srcPath", srcPath); //NOI18N for (FileObject srcRoot : srcPath.getRoots()) { if (root.equals(AnnotationProcessingQuery.getAnnotationProcessingOptions(srcRoot).sourceOutputDirectory())) { return true; } } return false; }