Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Add new source files programmatically(Add new source files programmatically)
Add new source files programmatically [message #989901] Sun, 09 December 2012 18:05 Go to next message
darek cygan is currently offline darek cyganFriend
Messages: 1
Registered: December 2012
Junior Member
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!
Re: Add new source files programmatically [message #1000389 is a reply to message #989901] Mon, 14 January 2013 16:26 Go to previous message
Cong Chen is currently offline Cong ChenFriend
Messages: 7
Registered: January 2013
Junior Member
Did you want to add source files into your project dynamically? Is that possible?
Previous Topic:External #define -> indexer
Next Topic:Compling problems with new subdirs
Goto Forum:
  


Current Time: Fri Apr 26 06:00:20 GMT 2024

Powered by FUDForum. Page generated in 0.02598 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top