Add new source files programmatically [message #989901] |
Sun, 09 December 2012 13:05  |
Eclipse User |
|
|
|
Hello All,
I was successful creating a new C-project programmatically but then wanted to add more and more source files to my project dynamically(click the button and 2 new source files added).
I overviewed the 'Import File System' wizard how files are added to the project and came up with the following code:
IPath containerPath = project.getFullPath();
FileSystemStructureProvider fileSystemStructureProvider = new FileSystemStructureProvider();
List filesToImport = new ArrayList();
filesToImport.add(new File("M:\\f1.c"));
..
ImportOperation operation = new ImportOperation(containerPath, fileSystemStructureProvider, null, filesToImport);
operation.setCreateLinks(true);
operation.setVirtualFolders(true);
but something missing as files are not included to my project. Anyone could know how to include new files to project? Maybe there is a snippet of the code I'm looking for in this forum somewhere?
Thanks in advance for a tip!
|
|
|
|
Powered by
FUDForum. Page generated in 0.09777 seconds