Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Programmatically add a file to a project
Programmatically add a file to a project [message #323788] Tue, 08 January 2008 12:12 Go to next message
Eclipse UserFriend
Originally posted by: jeff_r2.verifone.com

I would like to add a file to an existing project (programmatically).

Either would be acceptable:

1. Add the file when an existing project is imported (that is, somehow
plug into the 'General>Existing Projects into Workspace' from the
'File>Import...' menu selection).

2. At some point check a Workspace project for the existence of a
particular file and add it if it doesn’t exist (triggered by some event
such as starting a build, etc.)

Any guidance would be appreciated.
Thanks.
Jeff
Re: Programmatically add a file to a project [message #323789 is a reply to message #323788] Tue, 08 January 2008 13:00 Go to previous messageGo to next message
Eclipse UserFriend
Use the resource notification stuff (IResourceChangedEvent,
IResourceDelta, etc) to get notification of when the project is added.

Then you can just create your file using the IResource API.

All of this is described pretty well in the Resources Overview section
of the Platform Development Programmer's Guider in the help.

Jeff Reich wrote:
> I would like to add a file to an existing project (programmatically).
>
> Either would be acceptable:
>
> 1. Add the file when an existing project is imported (that is, somehow
> plug into the 'General>Existing Projects into Workspace' from the
> 'File>Import...' menu selection).
>
> 2. At some point check a Workspace project for the existence of a
> particular file and add it if it doesn�t exist (triggered by some event
> such as starting a build, etc.)
>
> Any guidance would be appreciated.
> Thanks.
> Jeff
>
>
Re: Programmatically add a file to a project [message #323825 is a reply to message #323789] Wed, 09 January 2008 10:55 Go to previous message
Eclipse UserFriend
Originally posted by: jeff_r2.verifone.com

Thanks, this looks like what I need. Just having trouble bolting it in,
but I'll figure it out eventually.
Previous Topic:How to access menuContribution from WorkbenchWindow - UPDATED
Next Topic:MultipageEditorPart
Goto Forum:
  


Current Time: Mon Jul 14 07:52:22 EDT 2025

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

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

Back to the top