get the list of sources files which exist in eclipse project explorer using CDT [message #912854] |
Fri, 14 September 2012 09:38 |
anil kumar Messages: 17 Registered: January 2012 |
Junior Member |
|
|
i am working on CDT eclipse plug in development, i am trying to get the list of sources files which exist in eclipse project explorer using CDT code using following code ,which results null.
Case1: IFile[] files2 = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocationURI(new URI("file:/"+workingDirectory)); for (IFile file : files2) { System.out.println("fullpath " +file.getFullPath());
}
Case2:
IFile[] files = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocationURI(getProject().getRawLocationURI()); for (IFile file : files) { System.out.println("fullpath " +file.getFullPath());
}
Case3: IFile[] files3 = ResourceLookup.findFilesByName(getProject().getFullPath(),ResourcesPlugin.getWorkspace().getRoot().getProjects(),false); for (IFile file : files3) { System.out.println("fullpath " +file.getFullPath());
}
Case4: IFolder srcFolder = project.getFolder("src");
Case 1 ,2,3 giving me output null, where i am expecting list of files of existing project say "helloworld"; in Case 4: i am getting the list of "helloworld/src" files, but i am expecting to get the files from the existing project mean main root ,ex:"helloworld" please suggest me on this
|
|
|
Powered by
FUDForum. Page generated in 0.03425 seconds