Chris
Chris

Reputation: 7855

How to initialize project when it is imported

I have an eclipse plugin and a custom project type. When the project is created through the wizard i can do as much setup code as i want. While using the plugin an .xml file is created containing plugin specific information about some resources inside the project.

Now when the project is checked into a versioning system the xml file is included. When someone checks out the project into eclipse again i would have to read the .xml file and apply the information to the resources again.

Is there a place where i can put code that is executed when a project of my custom project nature is beeing imported from somewhere else ?

Upvotes: 0

Views: 38

Answers (1)

greg-449
greg-449

Reputation: 111142

You could use an IResourceChangeListener to listen for resource changes.

Your listener should get an IResourceDelta for the project with the 'kind' flag set to IResourceDelta.ADDED.

Upvotes: 1

Related Questions